Can't use dynamic cursor with MS SQL 7.0 and PB 6.5.1

Hello,

we have an application (PB 6.5.1) which runs fine against MS SQL 6.5.

However we have a statement which is execute using dynamic SQL 
which gives the following error:

10077, One of the tables involved in the cursor statement does not have
a unique index.

The code is as follows:
===============
ls_SQL = "SELECT l.id FROM master..syslocks l WHERE l.spid = @@spid" 

DECLARE myCursor DYNAMIC CURSOR FOR sqlsa;
PREPARE sqlsa FROM :ls_SQL USING sqlca;

OPEN DYNAMIC myCursor;
IF sqlca.sqlcode <> 0 THEN 
  MessageBox("", "Error #" + String(sqlca.sqldbcode) + "=" +
sqlca.sqlerrtext);
end if;
===============

Actually the SQL statement above is a stripped down version of the
original 
SQL statement to find out, where the error is (we suspected some kind of 
magic joins being the reason, but now that there isn't any join...)

The original statement was:
SELECT DISTINCT o.name 
FROM sysobjects o, master.dbo.syslocks l, master.dbo.sysprocesses p 
WHERE l.spid = @@spid 
AND o.id = l.id 
AND p.spid = @@spid  
ORDER BY o.name

Where we would get an error 10080 saying that 'order by' may not be used
in a cursor statement.

The interesting fact is, that if the statement is used in a DW (using
SyntaxFromSql) everything works fine.

Any ideas, I'm quite lost.

Thanks in advance.
Thomas 

 
=======================================================
It's not the fall that kills you - it's the sudden stop
0
Thomas
2/1/2000 2:52:03 PM
sybase.powerbuilder.database 9855 articles. 1 followers. Follow

0 Replies
466 Views

Similar Articles

[PageSpeed] 1

Reply:

Similar Artilces:

Can't execute Stored Procedures with argument(s) using MS SQL 7.0 versus PB 7.0.3
I am using Power Builder 7 and I have installed the patch up to version 7.0.3 I connect to my SQL database (MSSQL 7) using regular ODBC for SQL Server. It works fine for retrieving any kind of sql syntax that I create using datawindow. However, it doesn't work for running a stored procedure with argument(s). The stored procedure itself runs just fine when I tested it from MSSQL's Query Analyzer. Examples: alter procedure dba.sp_people_long_name --> this one works just fine, because it has NO arguments as begin select peopleid,longname=lastname+', '...

Updates after 1.5.0.7 (1.5.0.9, 2.0.0.1)can't access the web.
Name: Jay Product: Firefox Summary: Updates after 1.5.0.7 (1.5.0.9, 2.0.0.1)can't access the web. Comments: see summary Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 ...

PB 6.5.1 Desktop
Through PB 6.5.1 desktop, when trying to connect directly to SQL Anywhere Adaptive Server v7.0, I get the error Invalid or unsupported datasource. If I try to use the compatibility library dbl50t.dll and connect to the ASA v7, it causes a GPF in dblib7.dll. An EXE compiled from 6.5.1 connects to the ASA v7.0 without a problem. I would just like to connect from within PB. Any suggestions or updates available. I believe the problem is PB is coded to only allow connect to specific ODBC drivers and ASA is not one of them but I need a work around or update. Thanks in advance, Jef...

Can't use Image datatype(MS SQL Server 6.5) in PB.
Hi:All, Does anyone know how to read and write an image type field of MS SQL Server6.5 using Powerbuilder? SELECT BLOB statement can't work, and SELECT statement return SQL Error: Overflow. Hi PowerC, SelectBlob & UpdateBlob are the functions to use. Be sure that you have Sqlca.AutoCommit=true before using these statements. HTH -- - Eric Aling [TeamPS], Cypres Informatisering bv, The Netherlands Eric's Home & PB Site @ http://utopia.knoware.nl/users/cypr115 PowerC <powerc@263.net> wrote in message 363836A9.F104EB2A@263.net... >Hi:All, > ...

Can't use Image datatype(MS SQL Server 6.5) in PB.
Hi:All, Does anyone know how to read and write an image type field of MS SQL Server6.5 using Powerbuilder6.0? ...

PB 6.5.1 app cant connect to MS SQL 7.0 using TCP/IP protocol
"A SQLServer request resulted in a bad return code or status but no error message was returned" I get this message trying to accessing a database in MS SQL 7.0. I use PB 6.5.1 native driver, "TCP/IP" network library and MS SQL 7.0 client dlls. If the default network library is "Named Pipes" then I can connect, but the SQL Server seems to me too slow. I am running out of time. If you any one help me to come out from this problem I'll be greateful to you. I have the same problem. However, when I dial into another machine using Dial up netw...

PB 6.5.1 app cant connect to MS SQL 7.0 using TCP/IP protocol
"A SQLServer request resulted in a bad return code or status but no error message was returned" I get this message trying to accessing a database in MS SQL 7.0. I use PB 6.5.1 native driver, "TCP/IP" network library and MS SQL 7.0 client dlls. If the default network library is "Named Pipes" then I can connect, but the SQL Server seems to me too slow. Is it possible to connect from PB 6.5.1 to MS SQL 7.0 using native driver ? I am running out of time. If you any one help me to come out from this problem I'll be greateful to you. ...

PB 5.0 cursor fetch error using MS SQL Server 6.5 (Service Pack 5)
We have PB5.0.02 and are upgrading to PB5.0.04 for Y2K compliance. Both are 16 bit. We have been using MS SQL Server 6.50.201 (the original release). Everything has been fine. We have just put MS SQL Server 6.50.415 (Service Pack 5) on a test server for Y2K compliance and are getting cursor fetch errors using either version of PB5.0. The error is 10037 "unexpected EOF from SQL Server." In looking at the SQL error log we see an EXCEPTION_ACCESS_VIOLATION error message involving sp_cursorfetch. Does this rings any bells with anyone? Is there an upgraded dll (or dlls) ...

PB 5.0 (16 bit) cursor fetch error using MS SQL Server 6.5 (Service Pack 5)
We have PB5.0.02 and are upgrading to PB5.0.04 for Y2K compliance. Both are 16 bit. We have been using MS SQL Server 6.50.201 (the original release). Everything has been fine. We have just put MS SQL Server 6.50.415 (Service Pack 5) on a test server for Y2K compliance and are getting cursor fetch errors using either version of PB5.0. The error is 10037 "unexpected EOF from SQL Server." In looking at the SQL error log we see an EXCEPTION_ACCESS_VIOLATION error message involving sp_cursorfetch. Does this rings any bells with anyone? Is there an upgraded dll (or dlls) ...

PB6.5->7.0
I have an app that works fine under PB6.5 which I migrated to 7.0. It used to run fine under 6.5 connecting to SQL Server 6.5. I've made no code changes at all but when I try to connect to the server under PB 7, it just stops and the hard disk goes like crazy. If I connect through PB to the database and then bring up a DW, I can see data. It just appears like my app can't connect. Any ideas? TIA. - Jeffrey There is a huge memory leak with the native driver. The workaround: Put a Space in dbparm. In development, set staticbind or something. -- Terry Dykstra (Team...

vmware 7.1.4 can't start on openSUSE11.4 2.6.37.6-0.5-desktop
I can't start Vmware 7.1.4 , royc-opensuse114:~/Desktop # vmware Logging to /tmp/vmware-root/setup-17117.log filename: /lib/modules/2.6.37.6-0.5-desktop/misc/vmmon.ko supported: external license: GPL v2 description: VMware Virtual Machine Monitor. author: VMware, Inc. srcversion: D3A4C3F0FF77748555B8D0A depends: vermagic: 2.6.37.6-0.5-desktop SMP preempt mod_unload modversions filename: /lib/modules/2.6.37.6-0.5-desktop/misc/vmnet.ko supported: external license: GPL v2 description: VMware Virtual Netw...

PB 5.0.4 Application can't migrate to PB 6.5
Hi, I try to migrate the application from PB5.0.4 to PB6.5. After migration, some errors occurs. Problem 1: A window ( say w_abc) which is inherited from another window (w_inherit). After migration, it has following errors Object: w_abc Instance Variables (0002) Error C0001: Illegal data type: istru_result istru_result - is a window structure in w_inherit window and it is used in w_abc instance variables In w_abc window, Instance variables: istru_result istru_result1 Problem 2: If a function which used string array ...

Porting Ms Sql Server 6.5 database to Ms Sql Server 7.0
Hi, We have developed a product using PowerBuilder7.0, Ms Sql Server 6.5 and connecting them using powerbuilder native driver. Now we are thinking of porting Ms Sql Server 6.5 database to Ms Sql Server 7.0.As we feel, we could achive new features of Sql server 7.0.e.g row level locking. Actually i want to know, what things i have to do.e.g what sort of connection i have to use? what new features i will able to use?.will Stored procedures work properly. Is there anyting i have to chang in my application(at front end)e.g datawindows or any embeded sql, external functions. Should i po...

Porting Ms Sql Server 6.5 Database to Ms Sql Server 7.0
Hi, We have developed a product using PowerBuilder7.0, Ms Sql Server 6.5 and connecting them using powerbuilder native driver. Now we are thinking of porting Ms Sql Server 6.5 database to Ms Sql Server 7.0.As we feel, we could achive new features of Sql server 7.0.e.g row level locking. Actually i want to know, what things i have to do.e.g what sort of connection i have to use? what new features i will able to use?.will Stored procedures work properly. Is there anyting i have to chang in my application(at front end)e.g datawindows or any embeded sql, external functions. Should i po...

Web resources about - Can't use dynamic cursor with MS SQL 7.0 and PB 6.5.1 - sybase.powerbuilder.database

Resources last updated: 12/16/2015 5:35:33 AM