Code
To add the SQL code for the stored procedure, select the node in the navigation pane that corresponds to the database type used in your runtime environment:
- Code MSSQL - Microsoft SQL Server database
- Code Oracle - Oracle database
- Code DB2 - IBM DB2 database
Enter the SQL code in the details pane. To use parameter names in the code, prefix them with the "@" sign. Refer to your database management system documentation to learn about supported syntax.

Note:
- AMT Developer Studio does not perform syntax checks on this code. Therefore, you must test it manually. If stored procedures contain invalid code for the runtime database system, this will cause errors during database reorganization.
- AMT does not support multiple result sets in stored procedures. Therefore, if a stored procedure contains two SELECT queries, only the first can be used to read the result set. For the second one, you need to use Output parameters to get information, but you cannot return a result set cursor.
- Oracle and DB2 stored procedure code must include BEGIN and END keywords, with the executable code placed between them.
- Oracle does not support SELECT statements in stored procedures for returning result sets directly. When using SELECT in Oracle stored procedures, it will not return a result set. Therefore, you must use SELECT in combination with INTO to put the results into a second table.
