INSERT query (using insert from a Java application, concerning String input)

From: Atika <agoswa(at)essex(dot)ac(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: INSERT query (using insert from a Java application, concerning String input)
Date: 1999-02-17 21:10:46
Message-ID: Pine.OSF.4.03.9902172108360.6790-100000@seralph15.essex.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

HI!!
I am hoping someone can help me with a problem I have.

I am trying to insert values in my pgsql database through a Java
application.
The problem is that I need to insert a String into a table. But, as I am
not going to know the value of this String before hand I can't really put
a value within two single qoutes.
I am basically trying to do something like this:

String input = "This is a String";

myConn.updateQuery("insert into myDB values(input)");

but get an error when I run it saying:
ERROR: attribute input not found
java.sql.SQLException: ERROR: attribute input not found

I am also going to have to insert integer and other such values but am not
going to know their values when I use the insert statement.

many thanks for your time and help.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Brett W. McCoy 1999-02-18 00:22:59 Re: [SQL] INSERT query (using insert from a Java application, concerning String input)
Previous Message Atika 1999-02-17 21:02:26 INSERT query !!