13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

578 Stored Procedures and the SQL Pass-Through Facility 4 Chapter 19If you use multiple connections, you must use an alias to identify the differentconnections. If you omit an alias, in<strong>for</strong>mix is automatically used.3 The CONNECT statement database-connection-arguments are identical to itsconnection-options.3 If you use quotation marks in your In<strong>for</strong>mix Pass-Through statements, yourDELIMIDENT= environment variable must be set to DELIMIDENT=YES, or yourstatements are rejected by In<strong>for</strong>mix.Stored Procedures and the SQL Pass-Through FacilityThe SQL pass-through facility recognizes two types of stored procedures in In<strong>for</strong>mixthat per<strong>for</strong>m only database functions. The methods <strong>for</strong> executing the two types ofstored procedures are different.3 Procedures that return no values to the calling application:Stored procedures that do not return values can be executed directly by usingthe In<strong>for</strong>mix SQL EXECUTE statement. Stored procedure execution is initiatedwith the In<strong>for</strong>mix EXECUTE PROCEDURE statement. The following exampleexecutes the stored procedure make_table. The stored procedure has no inputparameters and returns no values.execute (execute procedure make_table())by in<strong>for</strong>mix;3 Procedures that return values to the calling application:Stored procedures that return values must be executed by using the PROC SQLSELECT statement with a CONNECTION TO component. This example executesthe stored procedure read_address, which has one parameter, "Putnum".The values that read_address returns serve as the contents of a virtual table<strong>for</strong> the PROC SQL SELECT statement.select * from connection to in<strong>for</strong>mix(execute procedure read_address ("Putnum"));For example, when you try to execute a stored procedure that returns valuesfrom a PROC SQL EXECUTE statement, you get this error message:execute (execute procedure read_address("Putnum")) by in<strong>for</strong>mix;ERROR: In<strong>for</strong>mix EXECUTE Error: Procedure(read_address) returns too many values.Command Restrictions <strong>for</strong> the SQL Pass-Through FacilityIn<strong>for</strong>mix SQL contains extensions to the ANSI-89 standards. Some of theseextensions, such as LOAD FROM and UNLOAD TO, are restricted from use by anyapplications other than the In<strong>for</strong>mix DB-Access product. Specifying these extensions inthe PROC SQL EXECUTE statement generates this error:-201A syntax error has occurred

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!