X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 18D7AD1B38E for ; Thu, 1 Jul 2004 10:45:34 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42893-04 for ; Thu, 1 Jul 2004 13:45:36 +0000 (GMT) Received: from ns.mactan.ph (unknown [203.177.22.151]) by svr1.postgresql.org (Postfix) with ESMTP id 49ECFD1B381 for ; Thu, 1 Jul 2004 10:45:29 -0300 (ADT) Received: from cache (cache.mactan.ph [203.177.22.134]) by ns.mactan.ph (8.9.3/8.9.3) with SMTP id WAA02519; Thu, 1 Jul 2004 22:22:55 +0800 Message-ID: <003301c45f71$8187cb80$8616b1cb@cache> Reply-To: "apellido jr., wilfredo p." From: "apellido jr., wilfredo p." To: "Nigel J. Andrews" Cc: Subject: Re: help !!! Date: Thu, 1 Jul 2004 21:43:47 +0800 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.3 tagged_above=0.0 required=5.0 tests=PLING_PLING X-Spam-Level: * X-Archive-Number: 200407/2 X-Sequence-Number: 5008 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?