Solved

where is wrong

Posted on 2011-02-28
9
236 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
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
 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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