Home » SQL & PL/SQL » SQL & PL/SQL » Insert query
Insert query [message #1149] Thu, 04 April 2002 22:53 Go to next message
Samir
Messages: 32
Registered: April 2002
Member
Hi,
Can any one tell me what is wrong with the following query ?

Insert into UniTable (EmpCode,Name,DOJ,Salary,Name_Sx) values ( " & Val(Txt_Sno.Text) & ",
'" & Str_Name & "',
'" & dt_doj & "',
" & Val(Txt_Salary.Text) & ",
'" & Str_Soundex_Name & "' )

It's working fine if the value in
Str_Name= "abc". But gives ORA-01756: quoted string not properly terminated error, if the value is
Str_Name="abc cd". There is a blank space in between abc and cd.

Thanx in advance,
Samir
Re: Insert query [message #1155 is a reply to message #1149] Fri, 05 April 2002 04:23 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
" & Str_Name & "',
'" & dt_doj & "',

remove the double quotes...
use only single quotes
Re: Insert query [message #1164 is a reply to message #1149] Sun, 07 April 2002 20:26 Go to previous message
Samir
Messages: 32
Registered: April 2002
Member
When I remove the double quotes then it gives the following error :

ORA-01858:a non-numeric character was found where a numeric was expected.

Regds,
Samir
Previous Topic: Using Variables/Parameters In FROM Clause
Next Topic: dynamic sql
Goto Forum:
  


Current Time: Thu Mar 28 21:12:10 CDT 2024