dbTalk Databases Forums  

Declare cursor fails with database option

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Declare cursor fails with database option in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kdawg
 
Posts: n/a

Default Declare cursor fails with database option - 01-22-2012 , 09:28 PM






In an sqx file, I am able to declare a standard cursor. But the
database option is failing.

Example:
DECLARE STDDEMO CURSOR DATABASE source USER userid USING <pwd>
FOR SELECT person_id FROM userid.person
WHERE name = :sName;

The compiler returns:
SQL0104N An unexpected token "DATABASE" was found
following "CURSOR". Expected tokens may include:
"FOR".

Reply With Quote
  #2  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: Declare cursor fails with database option - 01-22-2012 , 10:15 PM






On Sun, 22 Jan 2012 19:28:15 -0800 (PST), Kdawg wrote:
Quote:
In an sqx file, I am able to declare a standard cursor. But the
database option is failing.

Example:
DECLARE STDDEMO CURSOR DATABASE source USER userid USING <pwd
FOR SELECT person_id FROM userid.person
WHERE name = :sName;

The compiler returns:
SQL0104N An unexpected token "DATABASE" was found
following "CURSOR". Expected tokens may include:
"FOR".
And this is on a system with version of at least 9.1? The paragrph below
Listing 17 says this method exists since 9.1.

http://www.ibm.com/developerworks/da...m-0901fechner/

--
25. No matter how well it would perform, I will never construct any
sort of machinery which is completely indestructible except for one
small and virtually inaccessible vulnerable spot.
--Peter Anspach's list of things to do as an Evil Overlord

Reply With Quote
  #3  
Old   
Kdawg
 
Posts: n/a

Default Re: Declare cursor fails with database option - 01-24-2012 , 10:37 AM



Yes, version 9.1.0.9

On Jan 22, 11:15*pm, "Peter H. Coffin" <hell... (AT) ninehells (DOT) com> wrote:
Quote:
On Sun, 22 Jan 2012 19:28:15 -0800 (PST), Kdawg wrote:

In an sqx file, I am able to declare a standard cursor. *But the
database option is failing.

Example:
DECLARE STDDEMO CURSOR DATABASE source USER userid USING <pwd
* * * * FOR SELECT person_id FROM userid.person
* * * * WHERE name = :sName;

The compiler returns:
SQL0104N *An unexpected token "DATABASE" was found
* * * * * * * * * following "CURSOR". *Expected tokens may include:
"FOR".

And this is on a system with version of at least 9.1? The paragrph below
Listing 17 says this method exists since 9.1.

http://www.ibm.com/developerworks/da...cle/dm-0901fec...

--
25. No matter how well it would perform, I will never construct any
* *sort of machinery which is completely indestructible except for one
* *small and virtually inaccessible vulnerable spot.
* * * * --Peter Anspach's list of things to do as an Evil Overlord

Reply With Quote
  #4  
Old   
Frederik Engelen
 
Posts: n/a

Default Re: Declare cursor fails with database option - 01-25-2012 , 10:17 AM



On Jan 24, 5:37*pm, Kdawg <kevinwo... (AT) gmail (DOT) com> wrote:
Quote:
Yes, version 9.1.0.9

On Jan 22, 11:15*pm, "Peter H. Coffin" <hell... (AT) ninehells (DOT) com> wrote:



On Sun, 22 Jan 2012 19:28:15 -0800 (PST), Kdawg wrote:

In an sqx file, I am able to declare a standard cursor. *But the
database option is failing.

Example:
DECLARE STDDEMO CURSOR DATABASE source USER userid USING <pwd
* * * * FOR SELECT person_id FROM userid.person
* * * * WHERE name = :sName;

The compiler returns:
SQL0104N *An unexpected token "DATABASE" was found
* * * * * * * * * following "CURSOR". *Expected tokens may include:
"FOR".

And this is on a system with version of at least 9.1? The paragrph below
Listing 17 says this method exists since 9.1.

http://www.ibm.com/developerworks/da...cle/dm-0901fec...

--
25. No matter how well it would perform, I will never construct any
* *sort of machinery which is completely indestructible except for one
* *small and virtually inaccessible vulnerable spot.
* * * * --Peter Anspach's list of things to do as an Evil Overlord- Hide quoted text -

- Show quoted text -
That's no SQL, that only works from the CLP. Check the InfoCenter for
the DECLARE CURSOR statement, the database options doesn't show there.

--
Frederik

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.