Solved

where is wrong

Posted on 2011-02-28
9
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

718 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