Last active
March 28, 2016 01:34
-
-
Save phpdave/e69c418344a73cd55e12 to your computer and use it in GitHub Desktop.
Examples of how to run Stored Procedures or Dynamic compound statements in Netbeans IDE Database Service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
BEGIN | |
CREATE TABLE QTEMP.TEST1 AS (SELECT * FROM MYLIB.MYTABLE) | |
WITH DATA; | |
CREATE TABLE QTEMP.TEST2 AS (SELECT * FROM MYLIB.MYTABLE) | |
WITH DATA; | |
END // | |
DELIMITER ; | |
SELECT * FROM QTEMP.TEST2; | |
SELECT * FROM QTEMP.TEST3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
CREATE PROCEDURE MYSTOREDPROC (IN MYPARAM VARCHAR(20)) | |
LANGUAGE SQL | |
DYNAMIC RESULT SETS 1 | |
BEGIN | |
DECLARE c1 CURSOR FOR | |
SELECT * | |
FROM MYATABLE | |
WHERE FIELD = MYPARAM; | |
OPEN c1; | |
END // | |
DELIMITER ; | |
Call MYSTOREDPROC('test'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment