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

Re: Insert null in int column

From: dmp <danap(at)ttc-cmc(dot)net>
To: venkata siva prasad <vsp_29(at)rediffmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Insert null in int column
Date: 2010-11-22 20:04:25
Message-ID: 4CEACCC9.7000201@ttc-cmc.net (view raw or flat)
Thread:
Lists: pgsql-jdbc
Sorry,

In the code should have used:

sqlStatement.executeUpdate(sqlStatementString);

Don't need the ResultSet, rs.

danap

dmp wrote:
> Hello Prasad,
>
> Attached class that should demostrate the insert you desire. The
> insertion for Postgresql via SQL can be done through two different
> methods.
>
> Singular Example:
> INSERT/REPLACE INTO "bigInt_types" ("data_type_id", "bigint_type")
> VALUES (NULL, '5');
> INSERT/REPLACE INTO "bigInt_types" ("data_type_id", "bigint_type")
> VALUES (NULL, '-65');
>
> Plural Example:
> INSERT/REPLACE INTO "bigInt_types" ("data_type_id", "bigint_type")
> VALUES (NULL, '5'),(NULL, '-65');
>
> danap.
>
> venkata siva prasad wrote:
>> Hi,
>>
>> I have created the table as below.
>>
>> create table test(id numeric(4),name character varying(8));
>>
>> I need to insert null as below.
>>
>> insert into test values(null,'aaa');
>>
>> But I am getting error as "Integer expecting..."
>>
>>
>> Can you please help me on this.
>>
>> Regards,
>> Prasad


In response to

pgsql-jdbc by date

Next:From: Samuel GendlerDate: 2010-11-22 21:34:27
Subject: Re: getTables() doesn't handle umlauts correctly
Previous:From: dmpDate: 2010-11-22 19:56:40
Subject: Re: Insert null in int column

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