Help ORacle varchar2 datatype-Visual basic incompatibility
From: Thomas Koshy <tkoshy_at_ix.netcom.com>
Date: 1997/01/12
Message-ID: <01bc00cf$4283dea0$9a775ecf_at_#tkoshy>#1/1
Date: 1997/01/12
Message-ID: <01bc00cf$4283dea0$9a775ecf_at_#tkoshy>#1/1
Hi Guys,
I am using Visual basic interacting with Oracle. Oracle data type varchar2 needs to be defined with single quotes around them when used in a sql, but in Visual basic single quote stands for comment.
Whenever there is an occurence of character ' (single quotes) in it and when I pass this string to Oracle using Visual Basic, I get an error message.
For e.g.
Custdesc = "Let's assume' this is the name."
sSql = "UPDATE customer" sSql = sSql & " SET custdesc='" & custdesc & "'" sSql = sSql & " WHERE custId=50" Oradatabase.Executesql sSql
The only workaround I could think of is to substitute every ' with a ''. Is there a better way to do that. Say a routine. Any help is greatly appreciated.
Please email me at tkoshy_at_ix.netcom.com
Thanks
Tom Received on Sun Jan 12 1997 - 00:00:00 CET