Re: help !!! - Mailing list pgsql-interfaces

From apellido jr., wilfredo p.
Subject Re: help !!!
Date
Msg-id 003301c45f71$8187cb80$8616b1cb@cache
Whole thread Raw
In response to help !!!  ("apellido jr., wilfredo p." <apellido@mactan.ph>)
List pgsql-interfaces
Hello Sir, thanks for reply.  Im just testing what you said and i got thiserror:

Enter Username:  apellidoUsername :  apellidoGrade : (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 isdeclare 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 integerand i saw another question which confused me:
hereit is
 



Is there a command that can be used to temporarily convert a string value ina field to integer?

I.E.

SELECT name, employeeidFROM usersWHERE employeeid = bob

In this case employeeid is an integer, and bob is a number but stored as astring.  how do you temporarily convert bob
toan integer for the sake ofthe comparison?
 





pgsql-interfaces by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: help !!!
Next
From: Matt Palmer
Date:
Subject: unsubscribe