Re: Incorrect syntax near ':'
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Tue, 4 Jul 2006 18:57:45 +0000 (UTC)
Veeru (Veeru@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
I am reading the query and the value from Xml file. I need to execute the
query using OLEDB.
my xml mesage contains
<DataRequest reqName="Example1">
<osql:ExportRequest xmlns:osql="sql"
connectionString="Provider=SQLNCLI;Server=DAESRV003\SQL_SERVER_2005;PLSQLRSet=1;Database=MI;UID=XT;PWD=aeseixt_133"
rowsToFetch="100" skipNullValues="true" explicitNulls="true"
targetNamespace="IS/1.0.0" processingMode="skip" dateTimeFormat="dmy">
<DataObject name="Sales_Force" namespace="Sales_Force">
<SQL sql="select * from team where team_id =:eid">
<param name="eid" value="105"/>
</SQL>
</DataObject>
</osql:ExportRequest>
</DataRequest>
when I run my program it is showing the following error
<Error><Code>80040e14</Code><Description><OLEDBErrors hr="80040e14"><Error
row="0" source="Microsoft SQL Native Client" Description="Statement(s) could
not be prepared." helpContext="0"
guid="{0C733A63-2A1C-11CE-ADE5-00AA0044773D}"/><Error row="0"
source="Microsoft SQL Native Client" Description="Incorrect syntax near ':'."
helpContext="0"
guid="{0C733A63-2A1C-11CE-ADE5-00AA0044773D}"/><UserMessage></UserMessage></OLEDBErrors></Description><Module>Export</Module><Message></Message><RequestId></RequestId></Error>The program
If I run the same using Oracle it goes fine.
Don't know where you found that : syntax. Just because it works with
an Oracle provider does not mean it's portable.
This form of sending an SQL statement in an XML document is nothing
that I am faimiliar with, but I would try one of @eid or ?. In the
first case you should probably say param name="@eid" as well.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: Incorrect syntax near ':'
- From: Veeru
- Re: Incorrect syntax near ':'
- Prev by Date: Re: connectionstring to access database
- Next by Date: Re: Incorrect syntax near ':'
- Previous by thread: Re: connectionstring to access database
- Next by thread: Re: Incorrect syntax near ':'
- Index(es):
Relevant Pages
|
|