Hi There,
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog
Hi. You have the wrong newsgroup, but one thing that would fix it
is to make the inner query with a different connection than the
outer query. An alternative would be to switch away from DbLib, so you
could do fetches in a cursor-based approach.
Joe Weinstein at BEA
Yog wrote:
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
> Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
> Thanks in advance.
> Regards,
> Yog
Showing posts with label typical. Show all posts
Showing posts with label typical. Show all posts
Tuesday, February 14, 2012
DB-Library error 10038
Labels:
application,
based,
calls,
communicate,
database,
db-library,
error,
microsoft,
mysql,
oracle,
scenario,
server,
server2000,
sql,
typical,
vc6
DB-Library error 10038
Hi There,
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog
Yog,
You will need to either fetch all the values first, close the result set,
and then do your inner loop query logic or use two separate connections to
the same database. Just like the error message says, the problem is that you
have initiated an operation that still has data to be retrieved from the
server and then attempted to execute another query.
Jim
"Yog" <y.bang@.zensar.com> wrote in message
news:C638CAD8-C4E2-49DE-955B-BE0B34977DD2@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
> Thanks in advance.
> Regards,
> Yog
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog
Yog,
You will need to either fetch all the values first, close the result set,
and then do your inner loop query logic or use two separate connections to
the same database. Just like the error message says, the problem is that you
have initiated an operation that still has data to be retrieved from the
server and then attempted to execute another query.
Jim
"Yog" <y.bang@.zensar.com> wrote in message
news:C638CAD8-C4E2-49DE-955B-BE0B34977DD2@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
> Thanks in advance.
> Regards,
> Yog
Labels:
application,
based,
calls,
communicate,
database,
db-library,
error,
microsoft,
mysql,
oracle,
scenario,
server,
server2000,
sql,
typical,
vc6
DB-Library error 10038
Hi There,
We have VC++6.0 based application which uses DB-Library calls to communicate
with the SQL Server2000 database.
There is typical scenario in the application where we want to process the re
sult of a multiple-row based query in WHILE loop and execute another query i
nside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with
results pending."
Because of the tightly coupled business logic, its impossible to change the
WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
YogYog,
Have you tried opening a second connection for the internal result set?
Russell Fields
"Yog" <y.bang@.zensar.com> wrote in message
news:0E65530E-C692-4850-8DF4-800912D22DBD@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
> Thanks in advance.
> Regards,
> Yog|||You need to fetch all the rows to completion before issueing another query.
Ex do while .not eof()
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
We have VC++6.0 based application which uses DB-Library calls to communicate
with the SQL Server2000 database.
There is typical scenario in the application where we want to process the re
sult of a multiple-row based query in WHILE loop and execute another query i
nside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with
results pending."
Because of the tightly coupled business logic, its impossible to change the
WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
YogYog,
Have you tried opening a second connection for the internal result set?
Russell Fields
"Yog" <y.bang@.zensar.com> wrote in message
news:0E65530E-C692-4850-8DF4-800912D22DBD@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
> Thanks in advance.
> Regards,
> Yog|||You need to fetch all the rows to completion before issueing another query.
Ex do while .not eof()
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
Labels:
application,
based,
calls,
communicate,
database,
db-library,
error,
microsoft,
mysql,
oracle,
scenario,
server,
server2000,
sql,
typical,
vc6
DB-Library error 10038
Hi There,
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog
This is a problem which typically arises when the results from an ongoing
command are still being processed.
In your scenario, you have probably sent a command to the server before all
results from a previous command have been processed.
To overcome this problem, the only way is to wait for the results to
process from the first query and then start the new query in the same
session.
Please also review this very helpful link:
http://msdn.microsoft.com/library/de...us/dblibc/dbc_
pdc02_4sxl.asp
Hope this helps.
sanchans@.online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights.
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog
This is a problem which typically arises when the results from an ongoing
command are still being processed.
In your scenario, you have probably sent a command to the server before all
results from a previous command have been processed.
To overcome this problem, the only way is to wait for the results to
process from the first query and then start the new query in the same
session.
Please also review this very helpful link:
http://msdn.microsoft.com/library/de...us/dblibc/dbc_
pdc02_4sxl.asp
Hope this helps.
sanchans@.online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights.
Labels:
application,
based,
calls,
communicate,
database,
db-library,
error,
microsoft,
mysql,
oracle,
scenario,
server,
server2000,
sql,
typical,
vc6
DB-Library error 10038
Hi There,
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog
1. Create another connection and execute your "subquery" in that connection
2. Wait for Yukon release - it is announced that Yukon will support
simultaneous queries on the same connection
3. Use T-SQL procedure for doing such a processing instead of client-side
cursor emulation
"Yog" <y.bang@.zensar.com> wrote in message
news:E50F797E-9F9D-4487-ADAF-AD251F1DC620@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog
1. Create another connection and execute your "subquery" in that connection
2. Wait for Yukon release - it is announced that Yukon will support
simultaneous queries on the same connection
3. Use T-SQL procedure for doing such a processing instead of client-side
cursor emulation
"Yog" <y.bang@.zensar.com> wrote in message
news:E50F797E-9F9D-4487-ADAF-AD251F1DC620@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
Labels:
application,
based,
calls,
communicate,
database,
db-library,
error,
microsoft,
mysql,
oracle,
scenario,
server,
server2000,
sql,
typical,
vc6
DB-Library error 10038
Hi There,
We have VC++6.0 based application which uses DB-Library calls to communicate
with the SQL Server2000 database.
There is typical scenario in the application where we want to process the re
sult of a multiple-row based query in WHILE loop and execute another query i
nside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with
results pending."
Because of the tightly coupled business logic, its impossible to change the
WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog1. Create another connection and execute your "subquery" in that connection
2. Wait for Yukon release - it is announced that Yukon will support
simultaneous queries on the same connection
3. Use T-SQL procedure for doing such a processing instead of client-side
cursor emulation
"Yog" <y.bang@.zensar.com> wrote in message
news:E50F797E-9F9D-4487-ADAF-AD251F1DC620@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
We have VC++6.0 based application which uses DB-Library calls to communicate
with the SQL Server2000 database.
There is typical scenario in the application where we want to process the re
sult of a multiple-row based query in WHILE loop and execute another query i
nside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with
results pending."
Because of the tightly coupled business logic, its impossible to change the
WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog1. Create another connection and execute your "subquery" in that connection
2. Wait for Yukon release - it is announced that Yukon will support
simultaneous queries on the same connection
3. Use T-SQL procedure for doing such a processing instead of client-side
cursor emulation
"Yog" <y.bang@.zensar.com> wrote in message
news:E50F797E-9F9D-4487-ADAF-AD251F1DC620@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
Labels:
application,
based,
calls,
communicate,
database,
db-library,
error,
microsoft,
mysql,
oracle,
scenario,
server,
server2000,
sql,
typical,
vc6
DB-Library error 10038
Hi There,
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog1. Create another connection and execute your "subquery" in that connection
2. Wait for Yukon release - it is announced that Yukon will support
simultaneous queries on the same connection
3. Use T-SQL procedure for doing such a processing instead of client-side
cursor emulation
"Yog" <y.bang@.zensar.com> wrote in message
news:E50F797E-9F9D-4487-ADAF-AD251F1DC620@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
We have VC++6.0 based application which uses DB-Library calls to communicate with the SQL Server2000 database.
There is typical scenario in the application where we want to process the result of a multiple-row based query in WHILE loop and execute another query inside WHILE loop based on the data in the result fetched.
The psuedo-code is as below
While (result.fetch())
{
//prepare where clause based on the data in the row fetched
char* strWhere= ...
//Execute the Query on the same connection using db-lib API
//Fetch the result
}
But DB-Library do not allow such scenario and throws below error
"DB-Library error 10038: Attempt to initiate a new SQL Server operation with results pending."
Because of the tightly coupled business logic, its impossible to change the WHILE LOOP and also the flow of the application.
Is there any solution for above said problem?
Thanks in advance.
Regards,
Yog1. Create another connection and execute your "subquery" in that connection
2. Wait for Yukon release - it is announced that Yukon will support
simultaneous queries on the same connection
3. Use T-SQL procedure for doing such a processing instead of client-side
cursor emulation
"Yog" <y.bang@.zensar.com> wrote in message
news:E50F797E-9F9D-4487-ADAF-AD251F1DC620@.microsoft.com...
> Hi There,
> We have VC++6.0 based application which uses DB-Library calls to
communicate with the SQL Server2000 database.
> There is typical scenario in the application where we want to process the
result of a multiple-row based query in WHILE loop and execute another query
inside WHILE loop based on the data in the result fetched.
> The psuedo-code is as below
> While (result.fetch())
> {
> //prepare where clause based on the data in the row fetched
> char* strWhere= ...
> //Execute the Query on the same connection using db-lib API
> //Fetch the result
> }
> But DB-Library do not allow such scenario and throws below error
> "DB-Library error 10038: Attempt to initiate a new SQL Server operation
with results pending."
> Because of the tightly coupled business logic, its impossible to change
the WHILE LOOP and also the flow of the application.
> Is there any solution for above said problem?
Labels:
application,
based,
calls,
communicate,
database,
db-library,
error,
microsoft,
mysql,
oracle,
scenario,
server,
server2000,
sql,
typical,
vc6
Subscribe to:
Posts (Atom)