Universal procedure for SQL queries processing

Just starting out? Need help? Post your questions and find answers here.
Yuri_D
User
User
Posts: 68
Joined: Wed Apr 13, 2016 7:39 am

Universal procedure for SQL queries processing

Post by Yuri_D »

Hello to everyone!

Can you please advice how to create subj which will receive a string with SQL query and will return a... here the problem because the query result may contain different amount/types of data
I'm novice in pointers but I think it is possible :oops:

Thank you in advance!
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Universal procedure for SQL queries processing

Post by infratec »

:?: :?: :?:

Not 100% clear what you mean, but...

You can always use GetDatabaseString() doesn't matter if the real field is an integer or float or ...

Bernd
Yuri_D
User
User
Posts: 68
Joined: Wed Apr 13, 2016 7:39 am

Re: Universal procedure for SQL queries processing

Post by Yuri_D »

Hi infratec,

Of course I can treat all data as a string, concatenate them in a structure with one .s variable and use StringField() to parce it later but it is not... nice solution)
I'd like to learn how to return different amount/types of data from the same procedure.
I can allocate memory, put data there and return a pointer to this memory but how to return a structure description of the data I've put into this memory?
It could be Int or Quad or String or BLOB... or (Int-O-Quad-O-String-O-BLOB)*n :lol: (structured list)
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Universal procedure for SQL queries processing

Post by infratec »

Hi,

use a pointer to a structure as parameter.
The structure contains a StructureUnion ...

But you need many ore stuff for this.

Bernd
Yuri_D
User
User
Posts: 68
Joined: Wed Apr 13, 2016 7:39 am

Re: Universal procedure for SQL queries processing

Post by Yuri_D »

It is a higher magic for me :oops:
Could you post some simple example code please?
Post Reply