Re: Returning an unknown number of types/values
From: André Pönitz (poenitz_at_gmx.net)
Date: 01/13/04
- Next message: pcrAKAJumbo: "Re: Returning an unknown number of types/values"
- Previous message: Jacques Labuschagne: "Re: working with addresses"
- In reply to: Tony Burrows: "Returning an unknown number of types/values"
- Next in thread: Jumbo: "Re: Returning an unknown number of types/values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 13 Jan 2004 09:09:57 +0000 (UTC)
Tony Burrows <tony@tonyburrows.com> wrote:
> Hi
> I'm trying to write a function which queries SQL tables. The function
> gets each row as an array of char*, whatever the actual types. I can also
> determine the actual types. What I need to do is convert each individual
> string into its proper type (easy) and then get the function to return
> each row, with the proper types rather than char*, also to return all the
> rows at once.
>
> I really don't know where to start. I thought of using a vector or list,
> which would work for the collection of rows, but how to handle each row?
> I don't know until runtime what the actual types will be, or how many
> values there will be. Almost certainly a row will have several data types.
>
> I did think of just a collection of pointers, but I don't see how to pick
> the right types out on return.
>
> Any suggestions would be very helpful.
Have a look at boost::any
Andre'
- Next message: pcrAKAJumbo: "Re: Returning an unknown number of types/values"
- Previous message: Jacques Labuschagne: "Re: working with addresses"
- In reply to: Tony Burrows: "Returning an unknown number of types/values"
- Next in thread: Jumbo: "Re: Returning an unknown number of types/values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|