PROBLEM with PB 7.0.3 AND SQL SERVER 7.0 USING SQL CURSOR

 I am having a problem running a sql command with a cursor with Native
drivers for MS sql Server 7.0.If i use ODBC or take out the order by clause
in the statement it works fine
By the way I am running powerbuilder 7.0.3 build 10009

The error code is :
(Error 10008 (DB-Library) DB-Library Severity Level 9 Message Text   ad
token from SQL Server: Datastream processing out of synchronization)
here a sample of the code
DECLARE cur_Sec1 CURSOR FOR
   SELECT DISTINCT COL1,COL2
     FROM TABLE1
    WHERE COL1 = ???
 ORDER BY COL1 ASC ;      <<<<<<<<<<<
 OPEN cur_Sec1;

THANKS DANIEL .....


0
Daniel
1/22/2001 1:26:00 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

3 Replies
812 Views

Similar Articles

[PageSpeed] 2

I assume that you have either a :FieldName or 'xxx' syntax replacing the ???
in your actual statement.
I use cursors and stored procedures from PB Script in 7.03.10009 without any
problems.  MSS is the most stable and fastest access method as it stands
today for SQL Server.
I have hopes for OLE_DB to be there in the future, but there are numerous
bugs to work around in PB 7 currently.

"Daniel Richard" <danielr@health.nb.ca> wrote in message
news:U4vXAkHhAHA.300@forums.sybase.com...
> I am having a problem running a sql command with a cursor with Native
> drivers for MS sql Server 7.0.If i use ODBC or take out the order by
clause
> in the statement it works fine
> By the way I am running powerbuilder 7.0.3 build 10009
>
> The error code is :
> (Error 10008 (DB-Library) DB-Library Severity Level 9 Message Text   ad
> token from SQL Server: Datastream processing out of synchronization)
> here a sample of the code
> DECLARE cur_Sec1 CURSOR FOR
>    SELECT DISTINCT COL1,COL2
>      FROM TABLE1
>     WHERE COL1 = ???
>  ORDER BY COL1 ASC ;      <<<<<<<<<<<
>  OPEN cur_Sec1;
>
> THANKS DANIEL .....
>
>


0
Tyler
1/22/2001 1:40:46 PM
That correct i have a :FieldName  syntax in the ??? pos  but the problems
comes from the order by clause .If I take this out  my statement work..




"Tyler Cruse" <tcruse@trlx.com> wrote in message
news:KsGkCtHhAHA.296@forums.sybase.com...
> I assume that you have either a :FieldName or 'xxx' syntax replacing the
???
> in your actual statement.
> I use cursors and stored procedures from PB Script in 7.03.10009 without
any
> problems.  MSS is the most stable and fastest access method as it stands
> today for SQL Server.
> I have hopes for OLE_DB to be there in the future, but there are numerous
> bugs to work around in PB 7 currently.
>
> "Daniel Richard" <danielr@health.nb.ca> wrote in message
> news:U4vXAkHhAHA.300@forums.sybase.com...
> > I am having a problem running a sql command with a cursor with Native
> > drivers for MS sql Server 7.0.If i use ODBC or take out the order by
> clause
> > in the statement it works fine
> > By the way I am running powerbuilder 7.0.3 build 10009
> >
> > The error code is :
> > (Error 10008 (DB-Library) DB-Library Severity Level 9 Message Text   ad
> > token from SQL Server: Datastream processing out of synchronization)
> > here a sample of the code
> > DECLARE cur_Sec1 CURSOR FOR
> >    SELECT DISTINCT COL1,COL2
> >      FROM TABLE1
> >     WHERE COL1 = ???
> >  ORDER BY COL1 ASC ;      <<<<<<<<<<<
> >  OPEN cur_Sec1;
> >
> > THANKS DANIEL .....
> >
> >
>
>


0
Daniel
1/22/2001 5:22:37 PM
Here is the sample that works for me:

string select_user_name = "tcruse"
string user_name
long acl


DECLARE cur_Sec1 CURSOR FOR
    SELECT DISTINCT user_name, ACL
      FROM user_list2
     WHERE user_name = :select_user_name
  ORDER BY user_name ASC ;

OPEN cur_Sec1;
f_check( SQLCA, "Open Cursor Failed" )

Fetch cur_Sec1 INTO :user_name, :acl ;
f_check( SQLCA, "First Fetch Failed" )
MessageBox( user_name, string( acl ))

Close Cur_Sec1 ;



"Daniel Richard" <danielr@health.nb.ca> wrote in message
news:r8nqOoJhAHA.296@forums.sybase.com...
> That correct i have a :FieldName  syntax in the ??? pos  but the problems
> comes from the order by clause .If I take this out  my statement work..
>
>
>
>
> "Tyler Cruse" <tcruse@trlx.com> wrote in message
> news:KsGkCtHhAHA.296@forums.sybase.com...
> > I assume that you have either a :FieldName or 'xxx' syntax replacing the
> ???
> > in your actual statement.
> > I use cursors and stored procedures from PB Script in 7.03.10009 without
> any
> > problems.  MSS is the most stable and fastest access method as it stands
> > today for SQL Server.
> > I have hopes for OLE_DB to be there in the future, but there are
numerous
> > bugs to work around in PB 7 currently.
> >
> > "Daniel Richard" <danielr@health.nb.ca> wrote in message
> > news:U4vXAkHhAHA.300@forums.sybase.com...
> > > I am having a problem running a sql command with a cursor with Native
> > > drivers for MS sql Server 7.0.If i use ODBC or take out the order by
> > clause
> > > in the statement it works fine
> > > By the way I am running powerbuilder 7.0.3 build 10009
> > >
> > > The error code is :
> > > (Error 10008 (DB-Library) DB-Library Severity Level 9 Message Text
ad
> > > token from SQL Server: Datastream processing out of synchronization)
> > > here a sample of the code
> > > DECLARE cur_Sec1 CURSOR FOR
> > >    SELECT DISTINCT COL1,COL2
> > >      FROM TABLE1
> > >     WHERE COL1 = ???
> > >  ORDER BY COL1 ASC ;      <<<<<<<<<<<
> > >  OPEN cur_Sec1;
> > >
> > > THANKS DANIEL .....
> > >
> > >
> >
> >
>
>


0
Tyler
1/22/2001 11:49:27 PM
Reply: