Skip site navigation (1) Skip section navigation (2)

NAN-Values in ECPG-Code

From: René Grün <rgr(at)mbs-software(dot)de>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: NAN-Values in ECPG-Code
Date: 2007-06-15 13:38:03
Message-ID: 8897A07B0EAA3B45B7119D1937389FFE7C78F6@exchange.mbs.internal (view raw or flat)
Thread:
Lists: pgsql-interfaces
Greetings,

this is my first post in an newslist, so pleas be patient, if I made some formal mistakes.

I have a Question:

Im writing a program in c using the ecpg-library. How can I insert a float-value like 'NAN' or 'infinity' into a recordset?

( this is only an example ... )

EXEC SQL BEGIN DECLARE SECTION;
Int	paramid;
Float fval;
EXEC SQL END DECLARE SECTION;

paramid = 5;
fval = 'NAN';

EXEC SQL INSERT INTO test ( paramid, value ) VALUES ( :paramid, :fval );

This is only working for 'normal' values, but not for the special's - NAN and INFINITY...

Can You help me, and tell me how to do it? 
I would be very thankful.


Mit freundlichen Grüßen aus Krefeld,
With best regards from Krefeld,


MBS GmbH - Entwicklung
i.A. René Grün

E-Mail: Rene(dot)Gruen(at)mbs-software(dot)de

Visit us in the world wide web:
Besuchen Sie uns im Internet:          
http://www.mbs-software.de

--

MBS Gesellschaft für Entwicklung und
Handel von Software und Investitionsgütern mbH Römerstraße 15, D-47809 Krefeld
Geschäftsführer: Martin Brust-Theiß, Gerhard Memmen-Krüger Registergericht Krefeld HRB 3337 Ust.-ID:DE 120 148 529



Responses

pgsql-interfaces by date

Next:From: anoopmadavoor@gmail.comDate: 2007-06-27 07:24:21
Subject: How I can return a set of recordset from PL/Python
Previous:From: Michael MeskesDate: 2007-06-13 12:52:41
Subject: execute immediate

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group