--- Zahroof Mohamed <zahroofm@stripped> wrote:
> I'd like to access a row in a table. The primary key column is named
> "id". I'd like to use a query which passes the specific id as a
> variable. It appears that I can do this:
>
> int iID = 1000;
> query << "SELECT * FROM table WHERE id = " << iID;
>
> By executing this query could I get the row corresponding to id = 1000?
You answered your own question! By executing this query, you will get the row(s) where id
= 1000.
Check example complic1.cpp. It shows how to use the store method of the Query object (=
executing
the query) that puts the results in a Result object. It also shows how to use a Row object
to get
the info from the Result object.
> Can anyone point me to where I can find information about how I would
> pass other types of variables - such as a double, string or a date
> etc. Didn't find anything in the examples or in the manual.
Strings, doubles, floats, chars, and the like are straight forward. Just do it like the
int
example you brought up. However, for more complicated types such as dates I am not sure
how to go
about it. Maybe someone with greater experience in this than me can help you out.
HTH,
ib
__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.