selecT Query |
![]() ![]() ![]() |
RelDBUpdateProcess and RelDBQueryProcess support a very special way of using the select query to retrieve information from database. If you define the select word in your query statement exactly as selecT (all letters are in lowercase except the 'T' at the end) then it gets a special treatment from the processes. When a selecT query is encountered, it is executed and the columns of the first result set record are transferred to the MScript symbols. Warning! Example 1: The selecT statement below creates the "ROWID" field in the current Process Record that stores the last inserted row id. INSERT INTO TABLE abc (F1, F2) VALUES(V1, V2); selecT @@IDENTITY AS f:ROWID;
Example 2: The selecT statement below creates pool variables called MAXPRICE and MINPRICE that stores the maximum and minimum price values available in the products table. selecT max(PRICE) as v:MAXPRICE, min(PRICE) as v:MINPRICE FROM products;
Warning! In contrary to Oracle, If selecT max(PRICE) as v:MAXPRICE definition is used with PostgreSQL, the variable pool symbol name becomes "maxprice". |