#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Posts
    2
    Rep Power
    0

    Question


    Hi,

    I have one field uname in oracle db with varchar2 datatype.iam trying to insert a value like srividya's into that uname field from my asp form page.but iam getting the error..
    the insert statement that iam using in asp page is,
    -----------------------------
    set conn=server.createobject("adodb.connection")
    conn.open "dsn=sss;uid=ss;pwd=ss"
    set rs= conn.execute("insert into xxx values('"&username&"')")
    ---------------------------
    (where username is the variable name having srividya's has its value)
    so, please tell me how to insert a quoted string value into the database.
  2. #2
  3. No Profile Picture
    PerlGuy
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2001
    Posts
    720
    Rep Power
    42

    Talking


    Just use the other kind of quotes as your delimiters.

    So, if there are 1 or more single quotes in your string, use double quotes to enclose the value.

    If there are 1 or more double quotes, use single quotes to enclose the value.

    If there's both in your string...well then your going to have to ask someone else. But the above methods should work

    Hope that helps
    - dsb -
    Perl Guy
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Posts
    2
    Rep Power
    0

    Smile


    hi dsb,

    thanks and i'll try that.

    Originally posted by dsb
    Just use the other kind of quotes as your delimiters.

    So, if there are 1 or more single quotes in your string, use double quotes to enclose the value.

    If there are 1 or more double quotes, use single quotes to enclose the value.

    If there's both in your string...well then your going to have to ask someone else. But the above methods should work

    Hope that helps

IMN logo majestic logo threadwatch logo seochat tools logo