Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Declare cursor fails with database option

8 views
Skip to first unread message

Kdawg

unread,
Jan 22, 2012, 10:28:15 PM1/22/12
to

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".

Peter H. Coffin

unread,
Jan 22, 2012, 11:15:08 PM1/22/12
to
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/data/library/techarticle/dm-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

Kdawg

unread,
Jan 24, 2012, 11:37:24 AM1/24/12
to

Yes, version 9.1.0.9

On Jan 22, 11:15 pm, "Peter H. Coffin" <hell...@ninehells.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/data/library/techarticle/dm-0901fec...

Frederik Engelen

unread,
Jan 25, 2012, 11:17:26 AM1/25/12
to
> >         --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
0 new messages