Solved

where is wrong

Posted on 2011-02-28
9
234 Views
Last Modified: 2012-05-11
Please let me know where is wrong in the below setence

INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values getdate() ,'"& request.ServerVariables ("AUTH_USER") &"','"& Request.ServerVariables("PATH_INFO") &"'"

I am getting the error  " Expected end of statement


0
Comment
Question by:petersti
  • 4
  • 4
9 Comments
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34999600
Mainly after 'values' you need to open ( and close at last )

INSERT INTO TABLE (COLUMN1, COLUMN2) VALUES (VALUE1, VALUE2)

Raj
0
 

Author Comment

by:petersti
ID: 34999773
"INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values (select getdate() ,'"& request.ServerVariables ("AUTH_USER") &"','"& Request.ServerVariables("PATH_INFO") &"')"

I updated still I am getting the same error
0
 
LVL 11

Expert Comment

by:LambertHeenan
ID: 34999792
Too many dots in the firstpart...

INSERT INTO ProcessLog..log_sqlwww_tbl

Try

INSERT INTO ProcessLog.log_sqlwww_tbl
0
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 500 total points
ID: 34999816
Try this one
"INSERT INTO ProcessLog..log_sqlwww_tbl (As_Of_Date,UserInfo,WebPageInfo) values (select getdate() ,'" & _
        Request.ServerVariables("AUTH_USER") & _
        "','" & Request.ServerVariables("PATH_INFO") & "')"

Open in new window


Raj
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:petersti
ID: 34999825
INSERT INTO ProcessLog..log_sqlwww_tbl

this is correct
It has 2 dots
0
 

Author Comment

by:petersti
ID: 34999884
Hi RajKUmar,
It worked for me .
I have One quick qtn
When I tried in SQL
INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values ('20110225' ,'test1','test3')  ----- it worked
Why it did not work in asp page "As_of_date","Userinfo","Webpageinfo"

Please let me know
Thanks a lot
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34999973
INSERT INTO TABLE ("COLUMN1") VALUES (1)
is same as
INSERT INTO TABLE (COLUMN1) VALUES (1)
in SQL

But if you try the double quotes in vb code, double quotes will break the string from there
Your code
"INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values (select getdate() ,'"& request.ServerVariables ("AUTH_USER") &"','"& Request.ServerVariables("PATH_INFO") &"')"

first double quotes will stop the string there.
"INSERT INTO ProcessLog..log_sqlwww_tbl ("
then cause concatenation issue

Raj

"test
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34999989
If you want double-quotes in vb code, here it is
"INSERT INTO ProcessLog..log_sqlwww_tbl (""As_Of_Date"",""UserInfo"",""WebPageInfo"") values (select getdate() ,'" & Request.ServerVariables("AUTH_USER") & "','" & Request.ServerVariables("PATH_INFO") & "')"

Open in new window


use two double-quotes

Raj
0
 

Author Closing Comment

by:petersti
ID: 35001162
This solution solved my problem
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adjust the position 3 49
error on the asp.net page 1 33
ADO.NET ENTITY DATA MODEL 3 32
Output Caching in IIS 2 9
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now