469,287 Members | 2,746 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

SQL/PL - Difference between OS/390 and UDB?

Hi - I would be grateful for any advice on the following as I have
exhausted all variants within UDB for LUW.

The following concerns an SQL/PL Stored Procedure that has been built
via SPB.
Initially, it was succesfully Registered on OS/390.
However, after exporting the SP across to UDB for LUW, the SQL
statements below will not compile.
The version of UDB / LUW is 7.1

1) SQL Statement: -
SELECT CNTRCT_NO_PRFX, CNTRCTNO_STRT_RNG, CNTRCT_NO_SFFX
INTO v_cntrct_no_prfx, v_cntrctn_strt_rng, v_cntrct_no_sffx
FROM CN_RNG_PD_SNAME
WHERE PROD_SNAME = p_prod_sname
AND SNAME_RNG_STRDT <= current date
AND SNAME_RNG_STPDT is Null
FETCH FIRST 1 ROW ONLY

2) Error message is: -
SQL0104N An unexpected token "FIRST 1 ROW ONLY" was found following
"E_RNG_STPDT is Null ". Expected tokens may include: "<space>". LINE
NUMBER=43. SQLSTATE=42601

Nov 12 '05 #1
2 2279
Shouldn't it be "FETCH FIRST 1 ROWS ONLY"?

Larry Edelstein

al**********@btinternet.com wrote:
Hi - I would be grateful for any advice on the following as I have
exhausted all variants within UDB for LUW.

The following concerns an SQL/PL Stored Procedure that has been built
via SPB.
Initially, it was succesfully Registered on OS/390.
However, after exporting the SP across to UDB for LUW, the SQL
statements below will not compile.
The version of UDB / LUW is 7.1

1) SQL Statement: -
SELECT CNTRCT_NO_PRFX, CNTRCTNO_STRT_RNG, CNTRCT_NO_SFFX
INTO v_cntrct_no_prfx, v_cntrctn_strt_rng, v_cntrct_no_sffx
FROM CN_RNG_PD_SNAME
WHERE PROD_SNAME = p_prod_sname
AND SNAME_RNG_STRDT <= current date
AND SNAME_RNG_STPDT is Null
FETCH FIRST 1 ROW ONLY

2) Error message is: -
SQL0104N An unexpected token "FIRST 1 ROW ONLY" was found following
"E_RNG_STPDT is Null ". Expected tokens may include: "<space>". LINE
NUMBER=43. SQLSTATE=42601

Nov 12 '05 #2
Larry wrote:
Shouldn't it be "FETCH FIRST 1 ROWS ONLY"?
The syntax allows the "ROW" too.
al**********@btinternet.com wrote:
Hi - I would be grateful for any advice on the following as I have
exhausted all variants within UDB for LUW.

The following concerns an SQL/PL Stored Procedure that has been built
via SPB.
Initially, it was succesfully Registered on OS/390.
However, after exporting the SP across to UDB for LUW, the SQL
statements below will not compile.
The version of UDB / LUW is 7.1


I guess that might be the problem. I don't remember if V7 did support the
FETCH FIRST x ROWS clause, but I wouldn't be surprised if it doesn't. So
you might want to consider moving to V8.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by b83503104 | last post: by
26 posts views Thread by Frank | last post: by
3 posts views Thread by bbawa1 | last post: by
12 posts views Thread by Petronius | last post: by
5 posts views Thread by Julius | last post: by
11 posts views Thread by cmb3587 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.