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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBscript using lrim and rtrim - SQL

Status
Not open for further replies.

MavrickStl

Programmer
Feb 20, 2001
71
US
I am trying to use ltrim and rtrim in a SQL statement within my ASP code as follows:

sqlnew = "Select Goal_id,det_id, desc1 from brag_det where" sqlnew = sqlnew & "user_id= "&varuser&" and mon="&varStoremon&"""

I would like to use ltrim and rtrim on desc1 column as follows:

Ltrim(rtrim(desc1,'"'),'"')

as follows:

sqlnew = "Select Goal_id,det_id, Ltrim(rtrim(desc1,'"'),'"') from brag_det where" sqlnew = sqlnew & "user_id= "&varuser&" and mon="&varStoremon&"""

but i am getting this oracle error:

ORA-01756: quoted string not properly terminated.

can anybody help me out?










 
Hello, MavrickStl.

Simply put :

sqlnew="Select Goal_id,det_id,"&trim(desc1)&" from brag_det where "

sqlnew=sqlnew&"user_id="&varuser&" and mon=" &varStoremon

(Of course, care of leaving one blank space before FROM and after WHERE above. Also shoud MON be read as MON=?)

regards - tsuji

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top