Kbase P40446: How to pass SQL statements to foreign database through 4GL?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/15/2008 |
|
Status: Verified
GOAL:
How to pass SQL statements to foreign database through 4GL?
GOAL:
How to pass SQL statements to foreign database through the DataServer within the procedure editor?
GOAL:
How to use RUN STORED-PROC send-sql-statement?
FACT(s) (Environment):
DataServers
FIX:
Progress uses stored-procedure syntax to allow you to send extended SQL statements directly to a data source. The DataServer uses the RUN STORED-PROCEDURE statement with the send-sql-statement option to pass SQL statements to the data source. Although Progress SQL allows you to use SQL statements, this option gives you access to your data source vendor's SQL syntax and its extensions to SQL, such as Transact-SQL for Sybase or PL/SQL for Oracle
For example, you can issue DDL statements from within Progress procedures. You can send multiple SQL statements by concatenating them and passing the string as a single parameter to the send-sql-statement option.
You use the RUN STORED-PROC statement with the send-sql-statement option and pass the SQL statements as a parameter. The syntax of the statement must be valid SQL syntax and must follow SQL naming and case conventions.
RUN STORED-PROC send-sql-statement NO-ERROR
("select count (*) from xxx.customer where name between 'A' and 'Z' ").