If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > how to insert a jscript numeric variable into Sql statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-09-03, 08:01
ladyj ladyj is offline
Registered User
 
Join Date: Oct 2003
Location: Florida
Posts: 2
how to insert a jscript numeric variable into Sql statement

I'm using ASp and jscript as my programming language.

This is my Sql statement

oConn.Execute("insert into calls(callnumber,status,openedtime,opcaltime,opcal
cdate,analyst,analgroup,openedby,priority,wavexist
s,actual,actualsec) values ( newticket , 'OPEN', '" + thefulldate + "', '+ justime +' , '" + justdate + "', 'myname', 'D.RESOURCES', 'myname', 'NORMAL', 'N', '00:00:00', '0') ");


Usually when I am inserting a numeric number it goes like this
Select callnum from calls where callnum =" + callid + ";

Usually when I am inserting an string it goes like this
Select fname from calls where lastname =' " + lname + " ';

My dilema is that since I am using Insert you have to use single quotes to represent you are inserting a string but I can't use the double quotes and it don't like the plus sign either. So if how what would I put around newticket variable in the first sql statement so that it will be taken as a numeric and not a string?
Please help
Ladyj
Reply With Quote
  #2 (permalink)  
Old 10-11-03, 08:22
Deano Deano is offline
Registered User
 
Join Date: Oct 2003
Location: England
Posts: 8
Hi ladyj

I think you need to use the 'escape character' for double quotes as follows:-

If I wanted to use a double quote in an string x I would use:-

\"


so
alert("hello\"")

would produce [hello"]

Forgive me if I have'nt understood your quesion correctly.


Deano
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On