Missing comma

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jestin
    New Member
    • Mar 2008
    • 12

    #1

    Missing comma

    hi

    Plz find the below code and its shows the error message as Missing Comma

    'asp codes

    [HTML]sqlinsert="INSE RT INTO Tbl_RequestInfo (" &_
    "ReqJobdesc , " &_
    "ReqRemarks , " &_
    "ReqServicetype id, " &_
    "ReqArea, " &_
    "ReqCraft, " &_
    "ReqGroup, " &_
    "ReqRschedD ate, " &_
    "ReqScheduledda te, " &_
    "ReqStatus, " &_
    "ReqCalldat e, " &_
    "ReqUpdatedLast by, " &_
    "ReqUpdatedLast , " &_
    "ReqScheduledby ) values (" &_
    STR_Quote2(Repl aceQuote(textJo bDesc)) & ", " &_
    STR_Quote2(Repl aceQuote(textre marks)) & ", " &_
    STR_Quote2(Repl aceQuote(textse rvicetype)) & ", " &_
    STR_Quote2(Repl aceQuote(textse rvicearea)) & ", " &_
    STR_Quote2(Repl aceQuote(textcr aft)) & ", " &_
    STR_Quote2(Repl aceQuote(textgr oup)) & ", " &_
    STR_Quote2(Repl aceQuote(textsc hed)) & ", " &_
    "'" & curdate & "', " &_
    STR_Quote2(Repl aceQuote(textst atus)) & ", " &_
    "'" & curdate & "', " &_
    STR_Quote2(Repl aceQuote(sessio n("username") )) & ", " &_
    "'" & curdate & "', " &_
    STR_Quote2(Repl aceQuote(sessio n("username") )) & ")[/HTML]

    and its values shows as

    [HTML]INSERT INTO Tbl_RequestInfo (ReqJobdesc, ReqRemarks, ReqServicetypei d, ReqArea, ReqCraft, ReqGroup, ReqRschedDate, ReqScheduleddat e, ReqStatus, ReqCalldate, ReqUpdatedLastb y, ReqUpdatedLast, ReqScheduledby) values ('testing', 'this is for testing purpose', '1', '6RD-6RA-6RB', 'EL', '1', '4/2/2008', 'To_Date('4/2/2008 9:25:10 AM','mm/dd/yyyy hh:mi:ss')', 'Blocked', 'To_Date('4/2/2008 9:25:10 AM','mm/dd/yyyy hh:mi:ss')', 'USER','TO_Date ('4/2/2008 9:25:10 AM','mm/dd/yyyy hh:mi:ss')', 'USER'[/HTML]

    any solution plz
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi jestin,

    I can't see the error but you should be able to track it down. The first thing to do is to run the sql string that you've printed above in query analyzer (or similar) and see if it works. Does it error? If so can you see which line it errors on?

    Also, there isn't a closing bracket at the end of your sql string - is this just a typo?

    Dr B

    Comment

    • deric
      New Member
      • Dec 2007
      • 92

      #3
      I think its in the To_Date values. There's a possible confusion in 'To_Date('4/2/2008 9:25:10 AM','mm/dd/yyyy hh:mi:ss')'.

      What DB are you using? I'm not sure if To_Date is a function of your DB server, but if it's the case then you may try to NOT enclose the To_Date value with single quotes.

      like...
      Code:
      sqlinsert="INSERT INTO Tbl_RequestInfo (" &_
      	"ReqJobdesc, " &_
      	"ReqRemarks, " &_
      	"ReqServicetypeid, " &_
      	"ReqArea, " &_
      	"ReqCraft, " &_
      	"ReqGroup, " &_
      	"ReqRschedDate, " &_
      	"ReqScheduleddate, " &_
      	"ReqStatus, " &_
      	"ReqCalldate, " &_
      	"ReqUpdatedLastby, " &_
      	"ReqUpdatedLast, " &_
      	"ReqScheduledby) values (" &_
      	STR_Quote2(ReplaceQuote(textJobDesc)) & ", " &_
      	STR_Quote2(ReplaceQuote(textremarks)) & ", " &_
      	STR_Quote2(ReplaceQuote(textservicetype)) & ", " &_
      	STR_Quote2(ReplaceQuote(textservicearea)) & ", " &_
      	STR_Quote2(ReplaceQuote(textcraft)) & ", " &_
      	STR_Quote2(ReplaceQuote(textgroup)) & ", " &_
      	STR_Quote2(ReplaceQuote(textsched)) & ", " &_
      	[B]curdate & ", " &_[/B]
      	STR_Quote2(ReplaceQuote(textstatus)) & ", " &_
      	[B]curdate & ", " &_[/B]
      	STR_Quote2(ReplaceQuote(session("username"))) & ", " &_
      	[B]curdate & ", " &_[/B]
      	STR_Quote2(ReplaceQuote(session("username"))) & ")

      Comment

      Working...