From: | "apellido jr(dot), wilfredo p(dot)" <apellido(at)mactan(dot)ph> |
---|---|
To: | "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk> |
Cc: | <pgsql-interfaces(at)postgresql(dot)org> |
Subject: | Re: help !!! |
Date: | 2004-07-01 13:43:47 |
Message-ID: | 003301c45f71$8187cb80$8616b1cb@cache |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Hello Sir, thanks for reply. Im just testing what you said and i got this
error:
Enter Username: apellido
Username : apellido
Grade : (null)
-----------------------------
my code:
double i;
char *reply_string;
reply_string = PQgetvalue(res, 0, 1);
i = strtod(reply_string,NULL)/2.0;
Sir, i know that PQgetvalue(res, 0, 1); will return number although it is
declare in the field varchar. Im already test
int i; (also tried unsigned short int)
reply_string = PQgetvalue(res, 0, 1);
i = strtoul(reply_string,NULL, 3)/2.0;
Still i got the same error... Im googling how to convert ascii to integer
and i saw another question which confused me: here it is
Is there a command that can be used to temporarily convert a string value in
a field to integer?
I.E.
SELECT name, employeeid
FROM users
WHERE employeeid = bob
In this case employeeid is an integer, and bob is a number but stored as a
string. how do you temporarily convert bob to an integer for the sake of
the comparison?
From | Date | Subject | |
---|---|---|---|
Next Message | Matt Palmer | 2004-07-01 13:58:50 | unsubscribe |
Previous Message | Nigel J. Andrews | 2004-07-01 06:31:27 | Re: help !!! |