Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Help Oracle varchar2 - visual basic incompatibility.

Help Oracle varchar2 - visual basic incompatibility.

From: Thomas Koshy <tkoshy_at_ix.netcom.com>
Date: 1997/01/12
Message-ID: <01bc00cf$53ee7ce0$9a775ecf@#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 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US