Friday, September 22, 2017

Tip of the Day: Underlying Retrieval With PASSTHROUGH
Product.......: R:BASE X and R:BASE X Enterprise (Version 10)
Build.........: 10.0.3.10907 or higher
Section.......: Commands
Keywords......: ODBC, PASSTHROUGH, Server Table, Foreign Data Source, SQL

When PASSTHROUGH is set to ON, SELECT statements are sent directly to a foreign
data source and are not processed by R:BASE.

In addition to SELECT, the underlying retrieval for the PROJECT command is a
query that can also be passed directly to the server and the results put in the
"returned rows" on the fly. If the original table had 30 columns and you only
need one, the PASSTHROUGH ON only asked the server for "one column", wheres when
PASSTHROUGH is OFF, the entire row is built by the SATTACHED table and then the
column asked for is sent to the calling program. Another command that can take
advantage of this includes INSERT when coming from a SELECT on a server table.

PASSTHROUGH can also allow special syntax, such as non-SQL syntax, or syntax
that is not supported by R:BASE. With PASSTHROUGH set to ON, you can use
functions that are only defined on the server system in a SELECT command,
because those functions get "passed through" to the server for processing.

If PASSTHROUGH is set to ON and a foreign database is connected with SCONNECT,
the following will happen with a SELECT command:

01.
If the table is a regular R:BASE table, the command works normally.

02.
If the table is a foreign data source table already attached with SATTACH, the
query is sent directly to the ODBC server and the returned values are shown.

03.
If the table is not known to R:BASE at all, as either an R:BASE table or a foreign
data source table, the query is sent directly to the ODBC server. If the server
cannot process the query, an error is returned. If the server can process the
query, the SELECT will work.

The "SELECT...INTO" command syntax can also be used to place values into variables.

  SELECT CustomerID,EmployeeID INTO vCustID INDI iv1, vEmpID INDI iv2 +
    FROM dbo.Orders WHERE OrderID = 10263

With PASSTHROUGH set to ON, you can actually use functions that are only defined
on the server system in a SELECT command, because those functions get "passed
through" to the server for processing.

  SELECT cInt, power(1.1,cInt) AS PW FROM dbo.Testing

This will use the SQL Server POWER function to raise 1.1 to the "cInt" power and
the results will come back to R:BASE. If PASSTHROUGH is OFF, this command
generates an error because the "power" function is not defined in the R:BASE program.

Covering all aspects of ODBC use with foreign SQL data sources is available within
the "Using SQL Data Sources in R:BASE" technical document:

From The Edge: http://www.razzak.com/fte/
Article Title: Using SQL Data Sources in R:BASE X and R:BASE X Enterprise (Version 10)

One of the most important aspects in business growth is your company's data, and no one else has more invested in your success than R:BASE Technologies. Invest forward
with R:BASE!

Very Best R:egards,

Razzak.

www.rbase.com
www.facebook.com/rbase


--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to