Thursday, June 15, 2023

Tip of the Day: WHERE Clause Support for the SATTACH Command
Product.......: R:BASE X.5 and R:BASE X.5 Enterprise (Version 10.5)
Build.........: 10.5.5.20615 or higher
Sections......: Commands
Keywords......: SATTACH, ODBC, WHERE Clause, Server, Table

Did you know that the SATTACH command was enhanced to allow a WHERE clause to be specified with the syntax?

You can now limit the rows of table data being attached from a SQL data source to a R:BASE database.

The following example attaches a SQL data source table, using an alias name for the table, and specifies a WHERE clause for limited results:

  SATTACH Artists AS tArtists WHERE ALastName = 'Ford'

It is also helpful to know how R:BASE and the foreign data source handle the data when a WHERE is specified with a SQL data source table.

When using the SATTACH command, the WHERE clause is sent to the SATTACHed database.

If an additional WHERE is used on that table, the processing of that additional WHERE is done in the R:BASE engine after the SATTACHed table has returned rows that only meet the original WHERE clause. The SATTACHed table does the original WHERE, and the R:BASE engine does the additional one.

Below, the SATTACH with "NY" in the WHERE clause is processed by the SATTACHed table. The SELECT with "Comp%" in the WHERE clause is processed by the R:BASE engine.

  SATTACH TEMPORARY Customer AS QBCustomer USING ONLY ListID, Name +
  ALIAS QBCustomerListID, QBCustomerName WHERE Name LIKE '% - NY'

  SELECT * FROM QBCustomer WHERE QBCustomerName LIKE 'Comp%'

Very Best R:egards,

Razzak.

R:BASE Technologies, Inc.
https://www.rbase.com

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/23f63930-70de-377f-bcdb-cbc3b4610b21%40rbase.com.

Reply via email to