ReportViewer using SQL Query error states: Incorrect syntax near ','.

Hello Community
    Using Visual Studio 2008 and SQL Server 2008 I created a Windows Application
that uses SQL Server Reporting Services.  The application uses ReportViewer and
calls a method written using SQL query.
            1-First I created the form.
            2-Next I dragged the ReportViewer (Toolbox) and Table (from DataSource) onto the form.
The problem is that when it reaches the last line of the SQL query (ie, da.Fill(ds, "TableOne");)
the code fails stating the error message:
            "Incorrect syntax near ','."
     The following is the code behind the form containing the query:
        private void ReportPgm1_Load(object sender, EventArgs e)
            // TODO: This line of code loads data into the 'ReportDBDataSet.TableOne' table. You can move, or remove it, as needed.
            this.TableOneTableAdapter.Fill(this.ReportDBDataSet.TableOne);  
            reportViewer1.ProcessingMode = ProcessingMode.Local;
            LocalReport ReportOneLocalReport = reportViewer1.LocalReport;
            DataSet ds = new DataSet("ReportDBDataSet.TableOne");
            pgmReportOne(FromDate, ToDate,   ds);
            ReportDataSource ds = new ReportDataSource("ReportDBDataSet.TableOne");
            ds.Value = dataset.Tables["TableOne"];
            ReportOneLocalReport.DataSources.Clear();
            ReportOneLocalReport.DataSources.Add(ds);
            this.reportViewer1.RefreshReport();
        private void pgmReportOne(DateTime FromDate, DateTime ToDate, DataSet ds)
            SqlConnection connection = new SqlConnection("Data Source=ReportDBServer;Initial Catalog=ReportDB;Uid=sa;pwd=Password");
            string sqlReportOne = "Select ([InDate], [FirstName], [LastName], [AGe]" +
                               "from TableOne";
            SqlCommand command = new SqlCommand(sqlReportONe, connection);
            command.Parameters.Add(new SqlParameter("paramFDate", FromDate));
            command.Parameters.Add(new SqlParameter("paramTDate", ToDate));
            SqlDataAdapter da = new SqlDataAdapter(command);
            da.Fill(ds, "TableOne");
    Why does the last line throw an error?
    Thank you
    Shabeaut

--NOTE: The statement below cannot be run on SQL Server 2012
--If you have an earlier version and can set the compatibility
--level to 80, it can be run.
SELECT sso.SpecialOfferID, Description, DiscountPct, ProductID
FROM Sales.SpecialOffer sso,
Sales.SpecialOfferProduct ssop
WHERE sso.SpecialOfferID *= ssop.SpecialOfferID
AND sso.SpecialOfferID != 1
Hi Scott
The *= is old syntax and not compatible with SQL Server 2012 (as stated in the comments). 
You could do something like this instead
SELECT sso.SpecialOfferID
,Description
,DiscountPct
,ProductID
FROM Sales.SpecialOffer sso
left outer join Sales.SpecialOfferProduct ssop on sso.SpecialOfferID = ssop.SpecialOfferID
WHERE sso.SpecialOfferID != 1

Similar Messages

  • SQL Server 2005 Problem: Incorrect syntax near '{'

    hi,<br>
    <br>
    I am using SQL Server 2005 JDBC driver from Microsoft (sqljdbc_1.0.809.102_enu.exe), there are some problem when calling stored procedure from Database Control:<br>
    <br>
    The following exception flow when parameters of the stored procedure were wrapped to newline :<br>
    <br>
    <i>weblogic.jws.control.ControlException: ControlException on control test2005DBCtrl[Incorrect syntax near '{'.]</i><br>
    <br>
    Here is the method that generate the above exception:<br>
    <br>
    /**<br>
    * @jc:sql statement::<br>
    * {call P_dummyProcedure<br>
         *           <b>(<br>
         *           {intValue}, {value}<br>
    *           )</b> <br>
    * }::<br>
    */<br>
    void callStoreProcedure(int intValue, String value);<br>
    <br>
    But if the parameters were not wrap, the method work fine:<br>
    <br>
    /**<br>
    * @jc:sql statement::<br>
    * {call P_dummyProcedure<br>
         *           <b>( {intValue}, {value} ) </b><br>
    * }::<br>
    */<br>
    void callStoreProcedure(int intValue, String value);<br>
    <br>
    The above problem exist when I change from SQL Sever 2000 to 2005. Both methods is ok for SQL Server 2000 (both the driver from BEA and Microsoft)<br>
    Do any one got the above problem or know why?<br>
    <br>
    cheer ~
    <br>

    Wiz Cheng wrote:
    hi Joe,<br>
    <br>
    following is a snippet of the config.xml, please see if that cover what you want ~ <br>
    <br>
    config.xml<br>
    ----<br>
              <JDBCConnectionPool CapacityIncrement="5"<br>
    ?? ?? ?? DriverName="com.microsoft.sqlserver.jdbc.SQLServerXADataSource"<br>
    ?? ?? ?? InitialCapacity="10" MaxCapacity="100" Name="sql2005Pool"<br>
    ?? ?? ?? PasswordEncrypted="{3DES}lF9SivpaSCc=" Properties="user=sa"<br>
    ?? ?? ?? SupportsLocalTransaction="true" Targets="cgServer"<br>
    ?? ?? ?? TestConnectionsOnReserve="true" TestTableName="SQL Select 1"<br>
    ?? ?? ?? URL="jdbc:sqlserver://svr08006\\SQL2005:1533;databaseName=SBI"<br>
    ?? ?? ?? XASetTransactionTimeout="true" XATransactionTimeout="300"/><br>
    <br>
    <JDBCTxDataSource JNDIName="JNDI_SQL_2005" Name="JNDI_SQL_2005"<br>
    ?? ?? ?? PoolName="sql2005Pool" Targets="cgServer"/><br>
    <br>
    <br>
    Thanks ~ <br>
    WizOk, please recreate the pool, telling the console to use the BEA driver for MS.
    when it shows you the pool properties, it should show you a URL, something like:
    "jdbc:bea:sqlserver://......". Please then edit the URL to add this to the end:
    ;spyAttributes=(log=(file)spy.log, so the URL looks like
    jdbc:bea:sqlserver://......;spyAttributes=(log=(file)spy.log)
    Or just make the pool, and then edit the config file.
    You should then see the config entry look something like this:
    <JDBCConnectionPool CapacityIncrement="5"
    DriverName="weblogic.jdbcx.sqlserver.SQLServerDataSource"
    InitialCapacity="10" MaxCapacity="100" Name="sql2005Pool"
    PasswordEncrypted="{3DES}lF9SivpaSCc=" Properties="user=sa"
    SupportsLocalTransaction="true" Targets="cgServer"
    TestConnectionsOnReserve="true" TestTableName="SQL Select 1"
    URL="jdbc:bea:sqlserver://......"
    XASetTransactionTimeout="true" XATransactionTimeout="300"/>
    Then please alter the URL line so it's like:
    URL="jdbc:bea:sqlserver://......;spyAttributes=(log=(file)spy.log)"
    This will generate a file in the server directory called spy.log.
    Then when the server boots, please then run the code that would
    have caused the problem, as simply as possible, and then send
    me the spy.log file.
    thanks,
    Joe

  • Timestamp to datetime throws "Incorrect syntax near '00'"

    SQLServer 6.5 and Weblogic 6.0 SP2 on NT4.0:
    Hi All
    Can someone point me the utility which would tell me which version of
    the JDBC Driver I am using. I know I am using Type 4 JDriver for
    MSSQLServer 6.5 but I want to know the exact version to report the below
    problem.
    I am trying to insert java.sql.Timestamp values in datetime columns in a
    table via a BMP (1.1) and I get this error
    From java object
    String value =07/11/2001
    timestamp = 2001-07-11 00:00:00.0
    java.rmi.RemoteException: EJB Exception:; nested exception is:
    javax.ejb.EJBException
    - with nested exception:
    [java.sql.SQLException: Line 1: Incorrect syntax near '00'. Severity 15,
    State 1, Procedure 'QCID_SRP_DEV null', Line 1]
    Any help would be much appreciated.
    Thanks
    Madhu

    Madhusudan R Chaganthi wrote:
    >
    SQLServer 6.5 and Weblogic 6.0 SP2 on NT4.0:
    Hi All
    Can someone point me the utility which would tell me which version of
    the JDBC Driver I am using. I know I am using Type 4 JDriver for
    MSSQLServer 6.5 but I want to know the exact version to report the below
    problem.
    I am trying to insert java.sql.Timestamp values in datetime columns in a
    table via a BMP (1.1) and I get this error
    From java object
    String value =07/11/2001
    timestamp = 2001-07-11 00:00:00.0
    java.rmi.RemoteException: EJB Exception:; nested exception is:
    javax.ejb.EJBException
    - with nested exception:
    [java.sql.SQLException: Line 1: Incorrect syntax near '00'. Severity 15,
    State 1, Procedure 'QCID_SRP_DEV null', Line 1]The first answer is to run the command:
    % java weblogic.jdbc.mssqlserver4.Driver
    This will print out the exact version.
    Then, show me. I assume you're dealing with a
    java.sql.Timestamp object. If so, would you
    show me what it's .toString() method prints out?
    I just saw a difference in our 7.0 driver and our
    6.5 driver with setTimestamp(). Apparently a bug
    was fixed in one but maybe not in the other because
    of how infrequently we get 6.5 users nowadays.
    Once I see your string, I can make you a new driver.
    Joe
    Any help would be much appreciated.
    Thanks
    Madhu--
    PS: Folks: BEA WebLogic is expanding rapidly, with both entry and advanced positions
    for people who want to work with Java, XML, SOAP and E-Commerce infrastructure products.
    We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and San Jose CA.
    Send resumes to [email protected]

  • ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near

    Hi,
    I am currently receiving the following error in BI Answers when I run a query against a Microsoft SQL 2005 Server.
    View Display Error
    Odbc driver returned an error (SQLExecDirectW).
      Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: 60 code: 8180 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
    SQL Issued: SELECT 0 s_0, "SD&A_Dashboard_Test"."BORIS_ALIAS_ETMS_Users"."Id" s_1, "SD&A_Dashboard_Test"."BORIS_ALIAS_ETMS_Users"."UserName" s_2 FROM "SD&A_Dashboard_Test" WHERE ("BORIS_ALIAS_ETMS_Users"."UserName" = 'trowe') FETCH FIRST 65001 ROWS ONLY 
    I am able to connect successfully to the Data Source and run a query against the database using the NQCMD command line tool so believe I have configured the DataDirect 7.0.1 drivers correctly, also I am able to view the Table Data in the RPD Physical Layer in the BI Administration Tool. So don't understand why I am getting this error.
    I have also activated the nquery.log but that doesn't really give me any further information.
    [2015-04-28T16:37:22.000+00:00] [OracleBIServerComponent] [TRACE:4] [USER-34] [] [ecid: 4a9e440f990ba0a4:-1995d2c5:14d00d3ef04:-8000-00000000000001c6,0:1:1:5] [tid: 5f] [requestid: 6f11000b] [sessionid: 6f110000] [username: borisdev] -------------------- Query Status: [nQSError: 16002] Cannot obtain number of columns for the query result. [[
    [nQSError: 16001] ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'..
    [nQSError: 16001] ODBC error state: 60 code: 8180 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Statement(s) could not be prepared..
    [nQSError: 43119] Query Failed:
    I was wondering if anyone could shed any light on what could possibly be causing the [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'.. error ? And also provide any suggestions on how I can troubleshoot this issue further as I am now completely out of ideas of what to do next having tried numerous things i.e. setting  IDENTIFIER_QUOTE_CHAR = '' in DBFeatures.INI which I found in similar posts on the subject all to no avail
    Regards,
    Tom Rowe

    Hi Rajagopal,
    Thanks for your reply after doing some further investigations this morning I found and corrected the problem...
    The DataDirect Driver does not like double quotes in the query for some reason, testing  using the BI Answers generated SQL with the nqcmd tool below...
    With double quotes “” it fails immediately
    Give SQL Statement: select T18706."Id" as c1, T18706."UserName" as c2 from "ETMS_Users" T18706 where ( T18706."UserName" = 'trowe' )
    select T18706."Id" as c1, T18706."UserName" as c2 from "ETMS_Users" T18706 where ( T18706."UserName" = 'trowe' )
    [102][State: S1000] [DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near 'Id'.
    Statement execute failed
    With double quotes removed for just the columns I now get the Error near ‘ETMS_Users’ which still had the double quotes
    Give SQL Statement: select T18706.Id as c1, T18706.UserName as c2 from "ETMS_Users" T18706 where ( T18706.UserName = 'trowe' )
    select T18706.Id as c1, T18706.UserName as c2 from "ETMS_Users" T18706 where ( T18706.UserName = 'trowe' )
    [102][State: S1000] [DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near 'ETMS_Users'.
    Statement execute failed
    With all double quotes removed it works !
    Give SQL Statement: select T18706.Id as c1, T18706.UserName as c2 from ETMS_Users T18706 where ( T18706.UserName = 'trowe' )
    select T18706.Id as c1, T18706.UserName as c2 from ETMS_Users T18706 where ( T18706.UserName = 'trowe' )
    c1           c2
    42499        trowe
    Row count: 1
    Give SQL Statement:
    The solution to fix the problem is...
    In the BI Admin Tool Physical Layer Database, Properties Features tab is to delete the double quote in the Value column for IDENTIFIER_QUOTE_CHAR, setting this in the DBFeatures.INI file does not resolve the problem possibly it did in earlier versions of the product.
    Regards,
    Tom Rowe

  • [Execute SQL Task] Error: Executing the query "DECLARE_@XMLA nvarchar(3000) ,__@DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,

    Hi
    DECLARE @XMLA nvarchar(3000)
    , @DateSerial nvarchar(35);
    -- Change date to format YYYYMMDDHHMMSS
    SET @DateSerial = CAST(GETDATE() AS DATE);
    --SELECT @DateSerial
    Set @XMLA = 
    N' <Batch xmlns="http://schemas.microsoft.com/analysis services/2003/engine">
     <ErrorConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
    xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"
    xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200">
    <KeyErrorLimit>-1</KeyErrorLimit>
    <KeyNotFound>IgnoreError</KeyNotFound>
    <NullKeyNotAllowed>IgnoreError</NullKeyNotAllowed>
     </ErrorConfiguration>
     <Parallel>
    <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
    xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
    xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
     <Object>
     <DatabaseID>MultidimensionalProject5</DatabaseID>
     <CubeID>giri</CubeID>
     <MeasureGroupID>Fact Internet Sales</MeasureGroupID>
     </Object>
     <Type>ProcessFull</Type>
     <WriteBackTableCreation>UseExisting</WriteBackTableCreation>
     </Process>
      </Parallel>
    </Batch>';
    EXEC (@XMLA) At SHALL-PCAdventureWorksDw ;
     iam executive the    query when iam getting below error.
      [Execute SQL Task] Error: Executing the query "DECLARE
    @XMLA nvarchar(3000)
    , @DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set
    correctly, or connection not established correctly. 
     how to solve this error;
     please help me

    What are you trying to do? What sort of data source is  SHALL-PCAdventureWorksDw?
    When you use EXEC() AT, I would execpt to see an SQL string to be passed to EXEC(), but you are passing an XML string????
    If you explain why you think this would work in the first place, maybe we can help you.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SSMS 2012:XML File Query: Importing XML data using a CTE-Incorrect syntax near 'BLOB'?

    Hi all,
    From https://www.simple-talk.com/content/print.aspx?article=1756, I mimicked to create the following sql code to do Importing XML data using a CTE:
    ---Importing XML data using a CTE -----Ad-Hoc XML File Query--simple-talk---1020AM 27 Feb 2015
    ---query the XML Blob using a CTE (pulling from the XML file each time
    USE OPENXMLtesting1
    GO
    With XmlFile (Contents) AS (
    SELECT CONVERT (XML, BulkColumn)
    FROM OPENROWSET (BULK 'C:\XML FilesMicrosoft-Samples\books.xml', SINGLE BLOB) AS XmlData
    SELECT
    FROM XmlFile
    GO
    I got the following message:
    Msg 102, Level 15, State 1, Line 4
    Incorrect syntax near 'BLOB'.
    I have no ideas why it is incorrect in that code statment. Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang
    P. S. The books.xml file was copied from the Microsoft samples:
    <?xml version="1.0"?>
    <catalog>
    <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <genre>Computer</genre>
    <price>44.95</price>
    <publish_date>2000-10-01</publish_date>
    <description>An in-depth look at creating applications
    with XML.</description>
    </book>
    <book id="bk102">
    <author>Ralls, Kim</author>
    <title>Midnight Rain</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-12-16</publish_date>
    <description>A former architect battles corporate zombies,
    an evil sorceress, and her own childhood to become queen
    of the world.</description>
    </book>
    <book id="bk103">
    <author>Corets, Eva</author>
    <title>Maeve Ascendant</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-11-17</publish_date>
    <description>After the collapse of a nanotechnology
    society in England, the young survivors lay the
    foundation for a new society.</description>
    </book>
    <book id="bk104">
    <author>Corets, Eva</author>
    <title>Oberon's Legacy</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2001-03-10</publish_date>
    <description>In post-apocalypse England, the mysterious
    agent known only as Oberon helps to create a new life
    for the inhabitants of London. Sequel to Maeve
    Ascendant.</description>
    </book>
    <book id="bk105">
    <author>Corets, Eva</author>
    <title>The Sundered Grail</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2001-09-10</publish_date>
    <description>The two daughters of Maeve, half-sisters,
    battle one another for control of England. Sequel to
    Oberon's Legacy.</description>
    </book>
    <book id="bk106">
    <author>Randall, Cynthia</author>
    <title>Lover Birds</title>
    <genre>Romance</genre>
    <price>4.95</price>
    <publish_date>2000-09-02</publish_date>
    <description>When Carla meets Paul at an ornithology
    conference, tempers fly as feathers get ruffled.</description>
    </book>
    <book id="bk107">
    <author>Thurman, Paula</author>
    <title>Splish Splash</title>
    <genre>Romance</genre>
    <price>4.95</price>
    <publish_date>2000-11-02</publish_date>
    <description>A deep sea diver finds true love twenty
    thousand leagues beneath the sea.</description>
    </book>
    <book id="bk108">
    <author>Knorr, Stefan</author>
    <title>Creepy Crawlies</title>
    <genre>Horror</genre>
    <price>4.95</price>
    <publish_date>2000-12-06</publish_date>
    <description>An anthology of horror stories about roaches,
    centipedes, scorpions and other insects.</description>
    </book>
    <book id="bk109">
    <author>Kress, Peter</author>
    <title>Paradox Lost</title>
    <genre>Science Fiction</genre>
    <price>6.95</price>
    <publish_date>2000-11-02</publish_date>
    <description>After an inadvertant trip through a Heisenberg
    Uncertainty Device, James Salway discovers the problems
    of being quantum.</description>
    </book>
    <book id="bk110">
    <author>O'Brien, Tim</author>
    <title>Microsoft .NET: The Programming Bible</title>
    <genre>Computer</genre>
    <price>36.95</price>
    <publish_date>2000-12-09</publish_date>
    <description>Microsoft's .NET initiative is explored in
    detail in this deep programmer's reference.</description>
    </book>
    <book id="bk111">
    <author>O'Brien, Tim</author>
    <title>MSXML3: A Comprehensive Guide</title>
    <genre>Computer</genre>
    <price>36.95</price>
    <publish_date>2000-12-01</publish_date>
    <description>The Microsoft MSXML3 parser is covered in
    detail, with attention to XML DOM interfaces, XSLT processing,
    SAX and more.</description>
    </book>
    <book id="bk112">
    <author>Galos, Mike</author>
    <title>Visual Studio 7: A Comprehensive Guide</title>
    <genre>Computer</genre>
    <price>49.95</price>
    <publish_date>2001-04-16</publish_date>
    <description>Microsoft Visual Studio 7 is explored in depth,
    looking at how Visual Basic, Visual C++, C#, and ASP+ are
    integrated into a comprehensive development
    environment.</description>
    </book>
    </catalog>

    I found the mistakes I made and I corrected them. The newly revised/corrected code is:
    USE OPENXMLtesting1
    GO
    With XmlFile (Contents) AS (
    SELECT CONVERT (XML, BulkColumn)
    FROM OPENROWSET (BULK 'C:\Temp\books.xml', SINGLE_BLOB) AS XmlData
    SELECT *
    FROM XmlFile
    GO
    It worked: Results
         Contents
    1  <catalog><book.id="bk101"><author>Gambardella.M...
    If I clicked on this, I got a listing of the whole book.xml!!  I don't know what it means.  Please comment and respond.
    Thanks,
    Scott Chang

  • Strange error while executing a stored procedure: Incorrect syntax near '@p0'

    All, I am getting a strange error while executing a stored procedure: Incorrect syntax near '@p0'  using JDBC CallableStatment.
    Here is my code...
    CallableStatement cStmt = con.prepareCall("{call SET CHAINED ON EXEC <dbName>.<schemaName>.<SPName> (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
    cStmt.setString(1, "2012005881");
    cStmt.setString(2, "07");
    cStmt.setString(3, "10");
    cStmt.setString(4, "Case title");
    cStmt.setString(5, "Open");
    java.sql.Date dt1 = new java.sql.Date(2014,10,20);
    cStmt.setDate(6, dt1);
    cStmt.setString(7, "01");
    cStmt.setString(8, "N");
    cStmt.setString(9, "ADA Test");
    cStmt.setString(10, "N");
    cStmt.setString(11, "English");
    cStmt.setString(12, "N");
    cStmt.setString(13, "N");
    cStmt.setString(14, "N");
    cStmt.setString(15, "N");
    cStmt.setString(16, "N");
    cStmt.setString(17, "N");
    cStmt.setString(18, "07");
    cStmt.setString(19, "10");
    cStmt.setString(20, "juache0");
    java.sql.Date dt2 = new java.sql.Date(2014,10,20);
    java.sql.Date dt3 = new java.sql.Date(2014,10,20);
    cStmt.setDate(21, dt2);
    cStmt.setDate(22, dt3);
    cStmt.setString(23, "userid0");
    cStmt.setString(24, "");
    cStmt.setString(25, "");  
    cStmt.setString(26, "");
    java.math.BigDecimal bg1 = new java.math.BigDecimal(10);
    cStmt.setBigDecimal(27, bg1);
    cStmt.setString(28, "userid");
    cStmt.setString(29, "userid");
    int hadResults = cStmt.executeUpdate();
    Your help is greatly appreciated.
    I am executing the above using Jconnect3.0 driver, inside WebSphere Application Server V8.0
    Thanks
    Nags

    NOTE: I don't work with JDBC/jConnect so (at this point) just some questions ...
    1 - are you sending this to ASE, ASA, IQ, or some other RDBMS?
    2 - what is the value of <schemaname>?
    3 - do you have other prepareCall() instances that successfully call a stored proc? [would be interesting to see if there's a difference in the format of the calls]
    A quick google search shows a couple ways to submit a stored proc execution to the RDBMS, with the format depending on the format expected by the target RDBMS.
    I'm wondering if you really need/want the parentheses around the argument list, ie, what happens if you change
    from
    -- parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ( ?,?,?,?,?,...,? )
    to
    -- no parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ?,?,?,?,?,...,?
    In ASE if I wrap the parameters in parentheses I get the same error you're getting:
    ================== w/ parentheses => error
    1> sp_who (sa)
    2> go
    Msg 102, Level 15, State 1:
    Server 'CC1_V1', Line 1:
    Incorrect syntax near 'sa'.   <<=== sa == @p0 ??
    ================== w/out parentheses => works
    1> sp_who sa
    2> go
    fid spid status  loginame origname ...
       0   17 running sa       sa       ...
    ==================

  • Multi-value parameter report - error : Incorrect syntax near ',' with multi-valued parameter in SSRS

    Hey,
    I created a report in Reporting Services  where I added multi-value parameter
    ( Filter).  When I run my report, and try to select more than one parameter, I get an error:  Incorrect syntax near ','
    then i put in parameter expression :  join(Parameters!Filter.Value,",")  
    and add : dbo.ufnSplit  before calling parameter in query :
    >>>  set @valwhere = 'table.field IN (select * from dbo.ufnSplit(' + @Filter + ' , '',''))'
    but i still have errors : incorrect syntax near 'text'  which is the second value of the picklist of the parameter,
    Please Any idea ?
    Thanks !!

    I have sometimes had to collate as default with the SQL query
    currently I've just using
    CompanyName in
    (selectitemfromdbo.fnSplit(@function,','))
    In the SSRS report text box I have Join(Parameters!Company.Value,",")

  • Odbc sql server driver sql server incorrect syntax near 'è'

    Hello.
    An online game I host uses ODBC and SQL.
    I'm using SQL Server Management Studio 2012.
    I had two errors suddenly appear.
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'è'
    and
    [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark after the string ".
    Can anyone explain what these are and how I can fix them please.
    Kind regards
    Zath

    Hello Zath,
    "Unclosed quotation mark after the string" means there is a Quotation mark missing, like in this query at the end:
    SELECT *
    FROM sys.objects
    WHERE Name like 'sys%
    But without knowing your queries it's difficult to say, where & why this occurs.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Receiver JDBC Channel Error : Incorrect syntax near 'OR'

    hi,
    we are facing the below error at the receiver communication channel:
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'OR'.
    When we again reprocess the message,it shows the exact error at the channel.
    Any ideas why the first error shows up?

    Hi, Anu
    The most probable it's that your target XML it's not correct because it haven't a correct format.
    Please, check your target XML and see
    http://help.sap.com/saphelp_nwpi711/helpdata/en/48/465581929734d9e10000000a42189d/frameset.htm
    Regards,
    Carme

  • Incorrect Syntax near $38.82.0 in Query

    Hi all,
    I have created a query for FMS in an UDF at AR Invoice to display total tax amount for certain tax group but it keeps saying "1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '$38.18.0'. 2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'User-Defined Values' (CSHS) (s) could not be prepared."
    $38.18.0 - VAT Code
    Please check what is the problem with the query below:
    SELECT Sum(T0.[VatSumSy]) FROM INV1 T0 WHERE $[$38.18.0] in ('SR','DS','AJS')
    Thanks,
    Leng

    Hi,
    Your query works fine.
    I got another issue here. If I changed T0.VatSumSy to T0.TotalSumSy to capture the total to be charged on tax rate. The FMS query only reads the tax code in the first row. If the invoice got 2 different tax codes with different rate, it will only capture the first row tax rate.
    E.g.
    ItemCode
    UnitPrice
    Qty
    Total
    TaxCode
    TaxRate
    TaxAmt
    A001
    10
    100
    1,000
    SR
    6
    60
    B002
    20
    200
    4,000
    ZRE
    0
    0
    I got 2 UDFs with FMS query.
    Tax6%
    SELECT sum(T0.[VatSumSy]) FROM INV1 T0 inner join OINV t1 on t1.docentry = t0.docentry WHERE RTRIM($[$-38.18.0]) in ('SR','DS','AJS') and t1.docentry = $[OINV.docentry]
    Tax0%
    SELECT sum(T0.[VatSumSy]) FROM INV1 T0 inner join OINV t1 on t1.docentry = t0.docentry WHERE RTRIM($[$-38.18.0]) in ('ZRE','RS','GS') and t1.docentry = $[OINV.docentry]
    UDF with Tax6% comes out 5000 while UDF with Tax0% also comes out 0.
    Kindly guide me how to do on the totalSumSy.
    Thanks & BR,
    Leng

  • Error importing result file from Visual Studio Online load test - Incorrect Syntax near ')'

    We are seeing the exact same issue as reported in:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/4a338992-1a46-47ae-9f13-10a53a6264b5/error-downloading-load-test-report-from-visual-studio-service-load-test-incorrect-syntax-near?forum=TFService#cb43383b-c60d-4dcc-a353-352ac6908b35
    When clicking on the "Download report" after running a load test using Visual Studio Online an error occurs.  The download completes, but the import fails at 15% with the following:
    This is happening for 2 different users on 2 different systems.  
    Any assistance in resolving this would be greatly appreciated!
    Let me know if additional information is needed.
    Thanks!

    Hi,
    We are researching your issue. Please clarify my question with detailed information:
    1. Do you get the error in your first post when you click ‘Download report’ after you run load test from
    Visual Studio 2013 on
    team foundation service?
    2 You said that ‘I am trying to import the test results into a Visual Studio 2012 (Update 3) on-prem instance’, what and where is
    your load test result repository? A SQL Server database or the default database:LoadTest2010 in SQL Express on the same machine with Visual Studio 2013?
    3 Whether you specify the load test result repository under Load Test->Manage Test Controller?
    4. What error do you get? Please provide us more detailed information about the error message or share us with a screenshot.
    5 Whether you can run the load test successfully locally and get the load test result with the same load test result database?
    6 You said that your co-worker can work fine. Please check whether your account has enough permissions for load test result database and download load test result from TFS to load test result database based on the account
    permission of your co-work.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get tax break up of TDS using SQL query ?

    Hi all,
    We are developing a TDS report using SQL query
    Report will contain VendorCode,Date(ap inv date),Vendor name,
    Bill value,TDS Amount,
    Bill Value – 100.000,
    TDS (2%) - 2.000,
    TDS Surcharge(10% on TDS) - 0.2,
    TDS Cess(2%(TDS+TDS Surcharge)) - 0.044,
    TDS HeCess(1%(TDS+TDS Surcharge)) - 0.022.
    We have developed this report which displays upto
    VendorCode,Date(ap inv date),Vendor name,
    Bill value,TDS Amount.
    How to show tax break up of TDS in SQL query ?
    Thanks,
    With regards,
    Jeyakanthan.

    Hi gauraw,
    Thank for your reply.
    I modified the query , pasted the query
    as below in query generator,
    Select T0.DocNum,T0.DocDate,T0.CardCode as 'Ledger',T1.TaxbleAmnt As 'Bill value',T1.WTAmnt as 'TDSAmt',(TDSAmt * 0.1) as 'TDS_Surch',
    (((TDSAmt0.1) + TDSAmt)0.02)  as 'TDSCess',
    (((TDSAmt0.1) + TDSAmt)0.01)  as 'TDSHCess'
    FROM OPCH T0  INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry
    WHERE (T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]')
    on clicking execute its showing error message invalid column
    name 'TDSAmt'.
    With regards,
    Jeyakanthan

  • How to Use SQL Query having IN Clause With DB Adapter

    Hi,
    I am using 11.1.1.5 want to find out how to Use SQL Query having IN Clause With DB Adapter. I want to pass the IN values dynamically. Any ideas.
    Thanks

    invoke a stored procedure, it's safer than trying to put together an arbitrary SQL statement in the JCA adapter

  • List of Project Permission in PS 2010 Using SQL query

    Hi
    Is there any way to get a list of Project permissions associated with user using sql query. If i go manually Project center --> select project plan --> project permission it would take lot of time to find out for each user
    Regards
    Santosh

    Before you continue (which you probably will overlook) - please understand that you should only be querying the REPORTING database and not the published database.  A recommendation is to use a select statement statement to insert the tables into a table
    int the reporting database, then query that table for your results/report.  
    The following page I believe has what you're looking for (Users with direct permissions- query below)
    and more
    http://pmpspecialists.com/Blog/2013/10/
    SELECT MSP_RESOURCES.RES_NAME AS Resourcename, CONV.CONV_STRING AS Permission, MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_DENY AS Denied,
    MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_ALLOW AS Allowed
    FROM MSP_WEB_SECURITY_SP_CAT_PERMISSIONS INNER JOIN
    MSP_WEB_SECURITY_SP_CAT_RELATIONS ON
    MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_REL_UID = MSP_WEB_SECURITY_SP_CAT_RELATIONS.WSEC_REL_UID INNER JOIN
    MSP_WEB_SECURITY_FEATURES_ACTIONS ON
    MSP_WEB_SECURITY_FEATURES_ACTIONS.WSEC_FEA_ACT_UID = MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_FEA_ACT_UID INNER JOIN
    MSP_WEB_CONVERSIONS AS CONV ON CONV.CONV_VALUE = MSP_WEB_SECURITY_FEATURES_ACTIONS.WSEC_FEA_ACT_NAME_ID INNER JOIN
    MSP_RESOURCES ON MSP_WEB_SECURITY_SP_CAT_RELATIONS.WSEC_SP_GUID = MSP_RESOURCES.RES_SECURITY_GUID
    WHERE (CONV.LANG_ID = 1033)
    ORDER BY Resourcename, Permission

Maybe you are looking for

  • Error: columns are not equal when writeback data from Essbase to Oracle

    I got an error when writeback Budget data from Essbase to Oracle that: The number of columns returned by script [14] is less than the source data columns exposed [15] while my returned columns from script is 15 My report script: <Sym {MISSINGTEXT ""}

  • My MacBook air computer screen is blank

      When I turn my MacBook air on it makes a sound but the screen doesn't come on

  • Decent monitor for MDD

    Hello i have a powermac G4 MDD. I had the original clear case 23" monitor hooked up to it. The monitor just died. The computer is still running fine. I hate to have to buy a whole new imac just cause of a monitor. the quality of the monitor was quite

  • Problem in TMS config after switch over to DR site

    Hi All, We resently switch over our primary to DR. I am not able to do the transportations. I have made changes to all neccessary RFC connections and tested, working fine. If i click on Distribute and activate button it is not getting activate. Can s

  • [SOLVED] Control PWM frequency of LED-backlight in Thinkpad laptops

    Hi. I'm seeking for a person who is eager to make a contribution to opensource Recently I've got Lenovo X220 laptop and noticed that it makes me sick. Eventually I discovered a screen flickering that is caused by low PWM frequency (backlight brightne