473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Missing comma

12
hi

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

'asp codes

[HTML]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)) & ", " &_
"'" & curdate & "', " &_
STR_Quote2(ReplaceQuote(textstatus)) & ", " &_
"'" & curdate & "', " &_
STR_Quote2(ReplaceQuote(session("username"))) & ", " &_
"'" & curdate & "', " &_
STR_Quote2(ReplaceQuote(session("username"))) & ")[/HTML]

and its values shows as

[HTML]INSERT INTO Tbl_RequestInfo (ReqJobdesc, ReqRemarks, ReqServicetypeid, ReqArea, ReqCraft, ReqGroup, ReqRschedDate, ReqScheduleddate, ReqStatus, ReqCalldate, ReqUpdatedLastby, 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
Apr 2 '08 #1
2 1698
DrBunchman
979 Expert 512MB
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
Apr 2 '08 #2
deric
92
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...
Expand|Select|Wrap|Line Numbers
  1. sqlinsert="INSERT INTO Tbl_RequestInfo (" &_
  2.     "ReqJobdesc, " &_
  3.     "ReqRemarks, " &_
  4.     "ReqServicetypeid, " &_
  5.     "ReqArea, " &_
  6.     "ReqCraft, " &_
  7.     "ReqGroup, " &_
  8.     "ReqRschedDate, " &_
  9.     "ReqScheduleddate, " &_
  10.     "ReqStatus, " &_
  11.     "ReqCalldate, " &_
  12.     "ReqUpdatedLastby, " &_
  13.     "ReqUpdatedLast, " &_
  14.     "ReqScheduledby) values (" &_
  15.     STR_Quote2(ReplaceQuote(textJobDesc)) & ", " &_
  16.     STR_Quote2(ReplaceQuote(textremarks)) & ", " &_
  17.     STR_Quote2(ReplaceQuote(textservicetype)) & ", " &_
  18.     STR_Quote2(ReplaceQuote(textservicearea)) & ", " &_
  19.     STR_Quote2(ReplaceQuote(textcraft)) & ", " &_
  20.     STR_Quote2(ReplaceQuote(textgroup)) & ", " &_
  21.     STR_Quote2(ReplaceQuote(textsched)) & ", " &_
  22.     curdate & ", " &_
  23.     STR_Quote2(ReplaceQuote(textstatus)) & ", " &_
  24.     curdate & ", " &_
  25.     STR_Quote2(ReplaceQuote(session("username"))) & ", " &_
  26.     curdate & ", " &_
  27.     STR_Quote2(ReplaceQuote(session("username"))) & ")
  28.  
Apr 4 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

27
by: Alberto Vera | last post by:
Hello: I have the next structure: How Can I make it using Python? How Can I update the value of 6?
4
by: Arne | last post by:
From: "Arne de Booij" <a_de_booij@hotmail.com> Subject: Comma delimited array into DB problems Date: 9. februar 2004 10:39 Hi, I have an asp page that takes input from a form on the previous...
0
by: Duncan Smith | last post by:
Hello, I'm not very experienced in SQL and I need some advice. I have a comma separarated values file containing around 20 million records and about 20 fields. There are many missing values...
5
by: Derek | last post by:
I came upon the idea of writting a logging class that uses a Python-ish syntax that's easy on the eyes (IMO): int x = 1; double y = 2.5; std::string z = "result"; debug = "Results:", x, y,...
5
by: Annette Massie | last post by:
I have a park permit tracking database where I was thinking of having the user enter all the park permits individually, however realized that in a day, a park could host many daily users. So if 100...
11
by: Shawn Odekirk | last post by:
Some code I have inherited contains a macro like the following: #define setState(state, newstate) \ (state >= newstate) ? \ (fprintf(stderr, "Illegal...
21
by: siliconwafer | last post by:
Hi, In case of following expression: c = a && --b; if a is 0,b is not evaluated and c directly becomes 0. Does this mean that && operator is given a higher precedence over '--'operator? as...
15
by: Lighter | last post by:
In 5.3.3.4 of the standard, the standard provides that "The lvalue-to- rvalue(4.1), array-to-pointer(4.2),and function-to-pointer(4.3) standard conversions are not applied to the operand of...
3
by: anupamadatta | last post by:
Hi there, I am trying to execute one Insert query using Pro C . the Insert query is as below: Prepared statement is : stmnt.len = sprintf((char*)stmnt.arr, "INSERT INTO %s ("...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.