HP (Hewlett-Packard) c-tree-SQL ISQL and Tool reference Guide Printer User Manual


 
ISQL Statements
FairCom Corporation 3-27
3.7.10 GET
Syntax
G[ET] filename;
Description
The GET statement reads the first SQL statement stored in the specified script file.
Arguments
filename
The name of the script file. ISQL reads the file until it encounters a semicolon ( ; ) statement
terminator. It appends the statement to the history buffer as the most-recent statement.
Notes
Execute the statement read by GET using the RUN statement.
The GET, START, and @ (execute) statements are similar in that they all read SQL script
files. Both GET and START read an SQL script file and append the first statement in it to
the history buffer. However, the START statement also executes the script statement and
accepts arguments that it substitutes for parameter references in the script statement. The @
(execute) statement, on the other hand, executes all the statements in an SQL script file but
does not add any of the statements to the history buffer. The @ statement does not support
argument substitution.
Example
Once you refine a query to return the results you need, you can store it in an SQL script file.
For example, the file query.sql contains a complex query that joins several tables in a sample
database.
Use the GET and RUN statements to read and execute the first statement in query.sql:
ISQL> GET query.sql
SELECT customers.customer_name,
orders.order_info,
orders.order_state,
lot_staging.lot_location,
lot_staging.start_date
FROM customers,
orders,
lots,
lot_staging
WHERE ( customers.customer_id = orders.customer_id ) and
( lots.lot_id = lot_staging.lot_id ) and