Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    Florida
    Posts
    2

    Unanswered: 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

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •