Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a Stored Procedure with Apostrophes 1

Status
Not open for further replies.

LeonelSanchezJr

Programmer
Jan 26, 2001
522
US
I am loading the following lines into a string to be executed as:
lnresult = sqlexec(lhconnect,insString)
where insString = "EXEC Ins_Hlpdsk_All
@cboStatCodeDisplay = 'IAH',
@cboStatCodeList = 'Houston, Texas',
@txtSpokeToValue = 'Pat',
@cboStaPhoneDisplay = 'COMPAQ -281/518-7695',
@cboTopicDisplay = 'ASCAR SOFTWARE',
@cboCategoryDisplay = 'Printing reports',
@edtNotesValue = '',
@edtResNotesValue = 'leo's test',
@cboLoginUserDisplay = 'Leo Sanchez',
@txtDateStampValue = '06/19/2001 10:59 AM',
@chkTransferredValue = 0,
@cboUsersValue = '',
@chkResolvedValue = 0,
@txtProbNumValue = 'IAH07523',
@cboPriorityValue = 2,
@opgRequestedViaValue = 1"

but the apostrope in @edtResNotesValue = 'leo's test'
causes the stored procedure not to work.

what do i need to do?
 
you need to change the single quote to 2 single quotes

was 'leo's test'
should be 'leo''s test'
 
That depends on what language you are using.

Try looking for "replace" or something simular.

______________________________
- David Lanouette
- Lanouette Consulting, LLC
- DLanouette@Computer.org
- 303-903-7689
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top