Solved

where is wrong

Posted on 2011-02-28
9
232 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Having a different time zone on your task bar 3 28
Problem to go to Web page 2 52
Jquery autocomplete 10 27
Problem to page 4 26
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…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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 discusses moving either the default database or any database to a new volume.

757 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

21 Experts available now in Live!

Get 1:1 Help Now