You are browsing MYSQL Forum.

error message incorrect syntax

i keep on getting this error message incorrect syntax in line1... funny thing is when i run eso thing from SQL Query Analyzer it works just fine but when i am executing the stored procedure from .net i keep on getting the errro message which i have mentioned above..
my sql stored procedure code snippet is as follows:
Create PROCEDURE databaseo.OracleStudentTbl
@tblName as varchar(255)
DECLARE @SQL as varchar(8000)
DECLARE @tbl as varchar(255)
SET @tbl =@tblName
'INSERT INTO [databaseo].['+@tbl+']'
SELECT * FROM OPENQUERY(XXXX 'SELECT * FROM vw_student_details_forsurvey')
basically what my stored procedure is doing is fetching a table name from my windows form then passing it to the stored procedure, then my SELECT * FROM OPENQUERY is populating the the table with its info... but as i mentioned i get the syntax error code snippet in my command button on is as follows:
Private Sub butSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butSave.Click
Dim varDetails As String = txtDetails.Text + "_" + txtDetailsTblName.Text
Dim sqlCommandDetailsInsert As New SqlCommand("OracleStudentTbl", connStr)
sqlCommandDetailsInsert.CommandType = CommandType.StoredProcedure
'this command is sending to the stored procedure the table name for the Students Details Table so that
'student details table will be populated with the data from the Oracle View
sqlCommandDetailsInsert.Parameters$PHX$93$PHX$"@tblName", varDetails)
sqlCommandDetailsInsert.ExecuteNonQuery() ' get error message here when i am deberroring my windows forms
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "ErrorIn Code")
End Try
Dim frmMain As New frmMain
frmMain.mySQLname = var
End Sub
would applicationlaud assist pls..
Posted On: Monday, November 12, 2012 Total Views: 31
View Complete with Replies


This webpage contains content related to MYSQL. If question related to " error message incorrect syntax" is not helpful or you didn't find the question or answer you were looking for then you can ask a new question through contact form. Our development Team will be happy to help you. This article was posted on Monday, November 12, 2012 and having 31 views till Thursday, May 28, 2015.

Thank You

Related Messages:

Insert into syntax error message?  (17 Views)
It' mercattor again bringing a brand-new error message;
Just for a conscience cleanse: Do you see any wrong statements in this scrap of code snippet:
, if rs=Server.CreateObject("ADODB.Recordset"), conn is explaind by a .inc file, as follows::
and art_(num,author and n
View Replies !
Stored procedure error message -scalar variable  (30 Views)

I've Created a SP as given below, how can I pass the output of SP to a varaible x
dim x
dim sql
dim oRS
set sql = "exec [usp_totalusers] '" & dt1 & "','" & dt2 & "'"
oRS = databasename.Execute sql
x = oRS("total_user")
I do not see any value passed to x. What could
View Replies !
sql query error message  (18 Views)
i have a table which hold students info name STUDENTDATA I've another table named SURVEYANSWERS which holds answer from a survey the student fills out.. basically the STUDENTDATA table has a PK (which is studentid) whilst the survey SURVEYANSWERS table has a FK (which is survey table).
i have
View Replies !
Page Audit error message attaching database  (18 Views)
I've a client whose HW dealer formatted their drive to clean off a virus. Tdid not have any valid backkups of their SQL data. We have managed to excerpt the mdf and ldf files from the drive but get the error message on intends to attach the database to a reinstalled copy of MSDE: "Msg 5172 Level 16,
View Replies !
Where's my error message in this statement?  (19 Views)
SELECT table1.* table2.Name, table3.MaintenanceID FROM table1INNER JOIN table2 ON table1.MachineID = table2.ID
LEFT JOIN table3 ON table1.SheetID = table3.ID
ORDER BY table2.Name

It works just fine with out the LEFT JOIN, but as soon as I add that clause in I get the following error m
View Replies !
must use an editable query error message  (21 Views)
Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an editable query.
okl common timeedit.asp line 15

Hours = Request.form("Hours")
Mins = Request.form("Mins")
Secs = request.form("Secs")

View Replies !
Multiple-step error message  (24 Views)
basically posted by : Robert Ramos (Robert.Ramos@DRMCI.ORG)I am just discovering ASP and I've come across an SQL server error message that I can't find to determine how can i resolve my Program. The error message is 'Microsoft OLE DB Provider for SQL Server error message 80040e21. Multiple-step OL
View Replies !
Help w SQL statement syntax error message  (13 Views)
Here's my SQL statement:
rs_totals.Source = "SELECT SUM (missed_sla_calls) as "total_calls" FROM missed_sla WHERE date_submit BETWEEN #" & request.form("from_date") & "# AND #" & request.form("to_date") & "#"
And just in case its way off here is what I am TRYING to get the sum of my missed_sla
View Replies !
Help wanted with error message '80040e57'  (25 Views)
I've the following edit. I know the error message is pertaining to fields shiftbegin and shiftend- I tested edit and it worked with out these 2 fields. Tare updating an access database with field type medium time. I've tried delimiting # and many other intends and nothing is working. Can anybody
View Replies !
Database login error message  (22 Views)
basically posted by : nick ( am a newcomer to databases but I've setup an Access database executing under IIS on my PC, and eso thing works OK. My web hosting company uses MYSQL, so I downloaded and installed MyODBC 3.51, set up my connection and more to talk to my MYSQL databas
View Replies !
error message  (13 Views)
basically posted by : dimi ( OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'DIEDERIKIUSR_DIEDERIK'.I always get this error message when i try to connect to my msql server i use the local server with sa as uid.Conn.Ac
View Replies !
Preventing error messages being presented  (16 Views)
basically posted by : Karsten ('m using the connection run property. If a run statement fails (i.E. stored procedure name is wrong) the error message is presented. How can I prevent this for generateing my own error message handler.
View Replies !
error message in sql  (14 Views)
basically posted by : stephen ( coding:SQL1 = "SELECT m_id m_E-mail, m_subject, m_numReplies, m_entrydate FROM messages "SQL2 = SQL1 & "WHERE m_reply=-1 ORDER BY m_id DESC;"set rs = Server.CreateObject("ADODB.Recordset")connectme="DSN=feedatabaseackDSN"rs.Open SQL2,connectme --
View Replies !
Database error message trapplicationing.  (17 Views)
basically posted by : John ( anybody have any solution how can i capture sql error message & then replace it wif the error message Created by asp so that user will know what it mean by the easy language instead of sql error message.Thanx.Your assist is applicationlaudd.
View Replies !
Distributed transaction error message  (26 Views)
basically posted by : sabu ( I encountered this hardy when tried to perform a spread transaction using link server. My goal was to connect 2 data base servers using TCP IP and transfer data. I was able to run single queries using "linkserver.catelog. owner.table". But this message was
View Replies !
error messages and stored procedures  (27 Views)
basically posted by : Gulliver ( am working with stored procedures a set. Some of the storedprocedures are usingother stored procedures. When an error message occure I wana the name of the procedure that caused the error messageto be returned with the line number where the error mess
View Replies !
Query error message  (13 Views)

I've this query and its gives me an error message saying expected end of statementwhere F Name and L Name are the names of the fields
the error message is at " "Code:
SELECT [F Name] & " " & [L Name] & [S Name] AS FullName from Students
View Replies !
Syntax error message  (8 Views)
I am trying to run a databasecc check on a database 'SHEDAT'. I've not ever done some thing like this but trying to get the syntax down.
View Replies !
Stored procedure error message -scalar variable  (15 Views)

I get this error message "Must declare the scalar variable @LoginName ".. when I try to save this stored procedure.
I do not understand what is wrong. Thank you.
Create PROCEDURE databaseo.StoredProcedure1
@LoginName nvarchar(25)
@LoginPass nvarchar(08)
View Replies !
Been awhile but HELP Microsoft VBScript runtime error message '800a01a8'  (31 Views)
I am getting a
Microsoft VBScript runtime error message '800a01a8'
Object required: "
This is the sql statement Maybe you can see what I can't
INSERT INTO Seminar ([thedate][city_state],[one],[2_or_more],[start],[end],[ce_info],[seatsavailble],[location],[seminarname],[AssociatedAppro
View Replies !