-
Is "SQL PL" similar to Oracle PL/SQL and MSSQL T-SQL?
I am trying to create a simple insert loop to do some testing. Ideally I would prefer just running one script page with the insert loops all running one after the other. But I am stuck on creating the first one.
Is "SQL PL" similar to Oracle PL/SQL and MSSQL T-SQL? I would rather just run anonymous code blocks instead of creating stored proc.
Here is my code and the error I am getting. Thanks
------------------------ Commands Entered ------------------------------
CONNECT TO LOADTEST;
SPECIFIC sum_mn
LANGUAGE SQL
smn: BEGIN
DECLARE v_Counter INTEGER;
SET v_Counter = 0;
WHILE v_Counter < 10 DO
INSERT INTO FaultSymbols(SYMBOL, DESCRIPTION)
VALUES('Symbol', 'Description');
SET v_Counter = v_Counter + 1;
END WHILE;
END smn;
CONNECT RESET;
------------------------------------------------------------------------------
CONNECT TO LOADTEST
Database Connection Information
Database server = DB2/NT 9.5.0
SQL authorization ID = ANTHONY....
Local database alias = LOADTEST
SPECIFIC sum_mn LANGUAGE SQL smn: BEGIN DECLARE v_Counter INTEGER
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "SPECIFIC sum_mn" was found following
"BEGIN-OF-STATEMENT". Expected tokens may include: "".
SQLSTATE=42601
SQL0104N An unexpected token "SPECIFIC sum_mn" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: " ".
Explanation:
A syntax error in the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure was detected at the specified token
following the text "". The "" field indicates the 20
characters of the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure that preceded the token that is not valid.
As an aid, a partial list of valid tokens is provided in the SQLERRM
field of the SQLCA as "". This list assumes the statement is
correct to that point.
The statement cannot be processed.
User response:
Examine and correct the statement in the area of the specified token.
sqlcode: -104
sqlstate: 42601