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 > ANSI SQL > How to insert a numeric jscript variable into an embedded SQL statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-09-03, 07:56
ladyj ladyj is offline
Registered User
 
Join Date: Oct 2003
Location: Florida
Posts: 2
How to insert a numeric jscript variable into an embedded 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
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On