dbTalk Databases Forums  

How to use returned result sets from a client app?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss How to use returned result sets from a client app? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
minjie
 
Posts: n/a

Default How to use returned result sets from a client app? - 08-22-2003 , 09:39 AM






Hi there,
In the IBM sample file (see /opt/IBM/db2/V8.1/samples/cpp),
spserver.sqC, it implemented a routine called two_result_sets(...). In
spclient.sqC, callTwoResultSets(...) is supposed to show how to call
two_result_sets() and how to use the returned record sets, but it is
not implemented. In other words, in the spserver.sqC code, it
commented: '// Leave cursors open to return result sets', but there is
no further example on how to use these two cursors from the client
application. The same goes for one_result_set_to_client(...) (in
spserver.sqC) and callOneResultSet(...) (in spclient.sqC). Can anyone
tell me how to use the record sets that are returned from
spserver.sqC? To be more specific, how do I define these two cursors
in a client app?
Thanks.

Reply With Quote
  #2  
Old   
Sean McKeough
 
Posts: n/a

Default Re: How to use returned result sets from a client app? - 08-25-2003 , 07:16 AM






You cannot process the result set from an embedded app...look at:
cli/spclient.c
or
java/jdbc/SpClient.java

For how to use them from cli or jdbc apps.

minjie wrote:

Quote:
Hi there,
In the IBM sample file (see /opt/IBM/db2/V8.1/samples/cpp),
spserver.sqC, it implemented a routine called two_result_sets(...). In
spclient.sqC, callTwoResultSets(...) is supposed to show how to call
two_result_sets() and how to use the returned record sets, but it is
not implemented. In other words, in the spserver.sqC code, it
commented: '// Leave cursors open to return result sets', but there is
no further example on how to use these two cursors from the client
application. The same goes for one_result_set_to_client(...) (in
spserver.sqC) and callOneResultSet(...) (in spclient.sqC). Can anyone
tell me how to use the record sets that are returned from
spserver.sqC? To be more specific, how do I define these two cursors
in a client app?
Thanks.


Reply With Quote
  #3  
Old   
minjie
 
Posts: n/a

Default Re: How to use returned result sets from a client app? - 08-25-2003 , 03:40 PM



Sean McKeough <mckeough (AT) nospam (DOT) ca.ibm.com> wrote

Quote:
You cannot process the result set from an embedded app...look at:
cli/spclient.c
or
java/jdbc/SpClient.java

For how to use them from cli or jdbc apps.
Thanks a lot for your reply. I need some more info in this case, for
the following situation: I already developed the code (using embedded
SQL with C++) - on the client side - for getting two linked lists: the
column names and the column values from a table. I was thinking of
moving most of the embeded SQL code into the server side and make it
into a library, so other app can use it as well. If a routine could
return linked lists, then there would be no problem in moving the code
into the server side and make it a routine, but it seemed to me a
routine is not allowed to return linked lists. So I was thinking of
letting the routine return the record sets and having the client build
the two linked lists from the record sets, which was why I asked the
original question. Now if this is not possible, and if I do not use
CLI, does that mean I HAVE TO use a fat client (meaning I have to
leave the code in the client app)?
Thanks for any help.


Reply With Quote
  #4  
Old   
minjie
 
Posts: n/a

Default Re: How to use returned result sets from a client app? - 08-26-2003 , 02:14 PM



Sean McKeough <mckeough (AT) nospam (DOT) ca.ibm.com> wrote

Quote:
You could return a linked list of data packed into a blob etc, but then
you'd have to deal with issues like byte reversal/codepage conversion
etc that a cursor would handle for you...

There's nothing technical stopping us from supporting mrsps from
embedded clients in v8; just need to write some test buckets...we need
to see enough interest from customers for this to happen though. :-) If
you have any way of pushing this requirement through our normal channels
that'd be great; in the meantime I'll add 'forum users' to the list of
customers I have who want this function. ;-)
Thanks again. I'll try to push this requirement through your normal
channel. Is it possible for you to provide a link on how to get there?
Will I get informed if it's implemented eventually?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.