pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Esteban Chiner Sanz <echiner@tissat.es>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] Problem with PreparedStatement
Date: Mon, 18 Oct 1999 19:22:56 +0100
Message-ID: <199910181822.TAA00590@linda.lfix.co.uk> (raw)
In-Reply-To: <echiner@tissat.es> <380B5347.106559E4@tissat.es>
References: <380B5347.106559E4@tissat.es>

"Esteban Chiner Sanz" wrote:
  >I'm trying to do this:
  >
  >if (counter != -1) /* No ha habido ningĂșn error */
  >            {
  >                PreparedStatement pstmt=null;
  >                sql="insert into tar_historico values (?,?,?)";
  >                razon="<br>Query: " + sql;
  >                try {
  >                    pstmt = con.prepareStatement(sql);
  >                    pstmt.setString(1,Integer.toString(counter));
  >                    pstmt.setString(2,"1");
  >                    pstmt.setTimestamp(3,new Timestamp(new
  >java.util.Date().getTime()));
  >                    pstmt.executeUpdate(sql);
  >                    pstmt.close();
  >                    con.close();
  >                }
  >
  >But I get this error message in the PostgreSQL log:
  >
  >   query: insert into tar_historico values (?,?,?)
  >   ERROR:  parser: parse error at or near ","
  >
  >What could be the problem? I've tried everything and I haven't found the
  >solution yet. Please, help.
  >Thanks in advance,
 
How about:
    sql="insert into tar_historico values ('?','?','?')";

-- 
      Vote against SPAM: http://www.politik-digital.de/spam/
                 ========================================
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Delight thyself also in the LORD; and he shall give 
      thee the desires of thine heart."          Psalms 37:4





view thread (4+ messages)  latest in thread

Message-ID: <199910181822.TAA00590@linda.lfix.co.uk>
Permalink:  ../199910181822.TAA00590@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/199910181822.TAA00590@linda.lfix.co.uk

 · 

reply

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-interfaces@postgresql.org
  Cc: olly@lfix.co.uk, echiner@tissat.es
  Subject: Re: [INTERFACES] Problem with PreparedStatement
  In-Reply-To: <199910181822.TAA00590@linda.lfix.co.uk>
  References: <380B5347.106559E4@tissat.es> <199910181822.TAA00590@linda.lfix.co.uk>

* 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