Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Getting a SQLSTATE=21000 error when running SQL using the OLEDB database driver – PB Docs 2022 – PowerBuilder Library

Getting a SQLSTATE=21000 error when running SQL using the OLEDB database driver – PB Docs 2022

Getting a SQLSTATE=21000 error when running SQL using the OLEDB
database driver

Symptom

When connected to Microsoft SQL Server using the OLEDB database
driver , and running the following SQL:

PowerBuilder will return the following error:

Subquery returned more than 1 value. This is not permitted when
the subquery follows =, !=, < , , < =, > , > = or when the
subquery is used as an expression

When connected to Microsoft SQL Server using SNC, a resultset will
be returned. No error is returned.

Environment

PowerBuilder

Microsoft SQL Server

Reproducing the Issue

1. In PowerBuilder, create a new database profile for OLEDB
connecting to Microsoft SQL Server.

2. Run the following SQL:

3. Open an existing workspace and target.

4. Create a new tabular DataWindow using the following SQL:

5.  Retrieve the DataWindow and you will see the following error
when connected to OLEDB:

Subquery returned more than 1 value. This is not permitted when
the subquery follows =, !=, < , , < =, > , > = or when the
subquery is used as an expression

6.  Now connect using the SNC database profile and retrieve the
same DataWindow and you should see a result set.

Cause

The PowerBuilder OLEDB driver and SNC driver fetch a different
number of rows each time.

(The SNC database driver would return the same error if the dbparm
Block=1 is used.)

Solution

For OLEDB, change the SQL from:

to:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x