sunojsm Warnings : 1 New User
Joined: 21 Jun 2004 Posts: 33 Location: Andorra
|
|
|
|
Hi,
Consider the following example.
EXEC SQL
DECLARE CURSOR1 CURSOR FOR
SELECT
COL_ONE
COL_TWO,
COL_THREE,
COL_FOUR
COL_FIVE
FROM TABLE1
WHERE EMPSEC =:WS-EMPSEC
WITH UR
END-EXEC.
EXEC SQL
FETCH CURSOR1
INTO
:WS-COL-ONE
,:WS-COL-TWO
,:WS-COL-THREE
,:WS-COL-FOUR ---> DECIMAL(2,0)
,:WS-COL-FIVE ---> DECIMAL(3,0)
END-EXEC.
In above statements,you can see there is no comma between COL_FOUR and COL_FIVE in DECLARE.
I noted this while debugging the program which is there in production.
Is that declaration is valid ?
How it went fine with out showing any syntax error during precompilation process?
When i checked the value in WS-COL-FOUR it shows as 3 which was correct(value same as in table1),but in WS-COL-FIVE ,
it shows 000 instead of '2' which is the value in table1 for that column. Could anyone let me know what exactly happening here. |
|