Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: insert data into any row in table


Message #1 by "Thang Nguyen" <nguyenhuuthang_2000@y...> on Thu, 14 Nov 2002 04:30:38
I don't understand, sorry.

If you want to replace row ID=24 if it exists or create it if it doesn't,
then you first need to check whether it exists, and if it does do an 'UPDATE
(the rest of the columns) ... WHERE ID = 24' or if it doesn't do an INSERT.
If ID is an auto-incrementing index column I think you're in trouble because
the DBMS controls the numbering.

Greg



-----Original Message-----
From: Thang Nguyen [mailto:nguyenhuuthang_2000@y...]
Sent: Friday, November 15, 2002 4:18 AM
To: Pro_JavaServer_Pages
Subject: [pro_jsp] RE: insert data into any row in table


> If the row is already in the table then use an SQL UPDATE statement, not
INSERT:

UPDATE myTable
SET myColumn1 = 'x', myColumn2 = 'y'
WHERE myColumn3 = 'z'

Greg


-----Original Message-----
From: Thang Nguyen [mailto:nguyenhuuthang_2000@y...]
Sent: Thursday, November 14, 2002 4:31 AM
To: Pro_JavaServer_Pages
Subject: [pro_jsp] insert data into any row in table


I can insert data into any row in table?
I try it with JDBC 2.0 but no result.
Please give me example source code.
Thank you

For example,
If I have 1 row with ID=25 ,and I want to insert 1 row into ID=24
(although ID 24 had or no)
With condition is ID permited same.
I try JDBC 2.0 with method absolute(id) to insert but no result.

Thank you
<A href="tnhdesign.freewebspace.com">Thang Huu Nguyen</A>




  Return to Index