C/C++ api - simplest way of getting query's result ?

Discussion forum about all things SqlBase.
BarneS

C/C++ api - simplest way of getting query's result ?

Post by BarneS » 30 Apr 2015, 13:33

Using C/C++, after I'm running SqlPrepareAndExecute with my query, then SqlFetchNext,
what is the simplest way of getting the query's result back during runtime ?

For example:
Say I'm doing 'select * from TABLE', then SqlFetchNext, what would be my actions from here ?
I could not find a way to get the query's result in my program.

Tried SqlGetParameterAll and sqlssb with SqlGetCursor, but neither really worked,
Could not find a constant for GetParameterAll that gets :into variables,
and sqlssb returns 135 (cursor invalid) - SqlGetCursor always returns 0.

Any help would be appreciated, thank you!

Scott
Australia
Posts: 415
Joined: 13 Mar 2017, 23:31
Location: Sydney, Australia

Re: C/C++ api - simplest way of getting query's result ?

Post by Scott » 01 May 2015, 05:45

If you've installed the samples as part of installation, there are C examples in the APISamples folder. e.g. C:\Program Files\Gupta\SQLBase\Samples\APISamples

BarneS

Re: C/C++ api - simplest way of getting query's result ?

Post by BarneS » 01 May 2015, 10:22

Hi Scott,

I've looked at the samples but could not find a way to get the actual result from a query.
All I could find is query, execute, fetch, but no function that gets a buffer to which it writes the result ?

Any help would be appreciated!

BarneS

Re: C/C++ api - simplest way of getting query's result ?

Post by BarneS » 01 May 2015, 20:16

I've looked at the samples but could not find a clear answer,

I would really appreciate if you could provide me with a flow of retrieving a result back from a query
during C runtime using either sqlwntm or cdlli,
I've tried the variety of Sql* (from cdlli) and sql* from sqlwntm but could not really retrieve any data back.

Thanks!

Scott
Australia
Posts: 415
Joined: 13 Mar 2017, 23:31
Location: Sydney, Australia

Re: C/C++ api - simplest way of getting query's result ?

Post by Scott » 04 May 2015, 00:46

That would be chapter 3 of the SQLBase SQL Applications Programming Interface manual (e.g. C:/Program Files/Gupta/SQLBase/Docs/pdf/api.pdf) or example programs ex12.c and ex16.c.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests