From: dmp <danap@ttc-cmc.net>
To: venkata siva prasad <vsp_29@rediffmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Insert null in int column
Date: Mon, 22 Nov 2010 13:04:25 -0700
Message-ID: <4CEACCC9.7000201@ttc-cmc.net> (raw)
In-Reply-To: <4CEACAF8.5040907@ttc-cmc.net>
References: <20101122175055.39596.qmail@f5mail-236-221.rediffmail.com>
<4CEACAF8.5040907@ttc-cmc.net>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: danap@ttc-cmc.net, vsp_29@rediffmail.com
Subject: Re: Insert null in int column
In-Reply-To: <4CEACCC9.7000201@ttc-cmc.net>
References: <20101122175055.39596.qmail@f5mail-236-221.rediffmail.com> <4CEACAF8.5040907@ttc-cmc.net> <4CEACCC9.7000201@ttc-cmc.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox