Thursday, December 4, 2014

Tip of the Day: Understanding SATTACH TEMPORARY Command
Product.: R:BASE eXtreme 9.5 (32/64) and Oterro 9.5 (32/64)
Build...: 9.5.4.31125 or higher www.rcornucopia.com www.rupdates.com
Section.: Connecting to Foreign Data
Keywords: ODBC, HELP SATTACH
Options.: www.oterro.com

The SATTACH command is used to attach a specified table from a foreign
database to a connected R:BASE database.

The optional TEMPORARY command allows you to create a Temporary Table with
the SATTACH command. The temporary tables will disappear when the database
is disconnected.

Prior to the recent update (Build: 9.5.4.31125), SATTACH TEMPORARY used to
create a TEMPORARY R:BASE table, rather than a TEMPORARY SERVER table.

The problem with this logic occurred in the UNLOAD process for the tables.

For example, after SCONNECTing the BluzVan95_64 (System DSN) based on
the sample BluzVan (64) database, after using the following command, the
table would be added.

SATTACH TEMPORARY SongList USING Song_ID, SongTitle, Album_ID

Prior to the recent update (Build: 9.5.4.31125), R:BASE recognized the
table to be an actual R:BASE table, and temporary, and not a SERVER table,
and temporary.

The UNLOAD STRUCTURE output was the following:

DROP TABLE SongList
SET QUOTES=NULL
SET QUOTES='
SET DELIMIT=NULL
SET DELIMIT=','
SET LINEEND=NULL
SET LINEEND='^'
SET SEMI=NULL
SET SEMI=';'
SET PLUS=NULL
SET PLUS='+'
SET SINGLE=NULL
SET SINGLE='_'
SET MANY=NULL
SET MANY='%'
SET IDQUOTES=NULL
SET IDQUOTES='`'
SET CURRENCY '$' PREF 2 B
DISCONNECT
SET STATICDB OFF
SET ROWLOCKS ON
SET FASTLOCK OFF
CREATE SCHEMA AUTHOR RRBYW18 NONE
CREATE TEMPORARY TABLE `SongList` +
(`Song_ID` INTEGER , +
`SongTitle` TEXT (40) , +
`Album_ID` INTEGER )
COMMENT ON TABLE `SongList` IS +
'Server table - SongList BluzVan95_64'
RETURN

But in order to recreate the attached Server table, the following is
correct, and is expected:

SCONNECT BluzVan95_64
SATTACH TEMPORARY SongList USING +
Song_ID , +
SongTitle , +
Album_ID
RETURN

Now, the difference between SATTACH and SATTACH TEMPORARY, is that a
TEMPORARY SERVER table will be DROPped when the database is DISConnected.

One solution may be to add the SERVER table, and then perform a PROJECT
TEMPORARY off of the Server table.

Or, you have the option to work directly with the ODBC source.

Last but not least ...

If you wish to SATTACH MS SQL, Oracle, Sybase, DB2, or Pervasive PSQL
databases to retrieve data, or use your favorite R:BASE as a front-end,
you should use R:BASE eXtreme 9.5 (64) to take advantage of long database,
table/view, column names, not to mention the eXclusively R:BASE 9.5 (64)
data types, such as BIGNUM, BSTR, and GUID.

Note:

While performing routine maintenance and re-building R:BASE database,
prior to using the UNLOAD ALL command, always make sure that you first
DISCONNECT and then re-CONNECT the database in order to DROP any or
all TEMPORARY Tables and Views, if any.

Have fun designing and deploying R:BASE 9.5 (64) applications!

http://www.rbase.com/rbg95/rbaseforeveryone.jpg

Very Best R:egards,

Razzak.

www.rbase.com
www.facebook.com/rbase
--
31 years of continuous innovation!
16 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, place any text to search for.
================================================


Reply via email to