2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-17 09:25:32 +00:00
cheat.sheets/sheets/_db2/sqlpl
Andres Gomez Casanova 5026a1a373
Create sqlpl
2019-08-05 22:56:57 -05:00

9 lines
383 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--Create a compound statement Anonymous block
BEGIN DECLARE val SMALLINT; SET val = 1; WHILE (val <= 5) DO INSERT INTO tbl5 VALUES (val, val); SET val = val + 1; END WHILE; END @
--Perform a reorg via ADMIN_CMD (Sometimes required after “alter table”)
CALL SYSPROC.ADMIN_CMD('REORG TABLE tbl1')
---Call a stored procedure with an IN and an OUTPUT parameter
CALL prc1(5, ?)