Syntax error in field definition

Hello,
Does java sun default driver support data type BLOB? I need create a table name PERSONS, and then store it to Access Database. But, every time when I run the program, it shows the following message:
SQLException: [Microsoft] [ODBC Microsoft Access Driver]
Syntax error in field definition.
Below are the code, does any one have any idea about the problem?
import java.sql.*;
public class CreatePersons {
     public static void main(String args[]) {
          String url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=Database\\DB1.mdb";
          Connection con;
          String createString;
          Statement stmt = null;
          createString = "create table PERSONS " +
                                   "(PersonName VARCHAR (20) NOT NULL, " +
                                   "PersonPicture BLOB (64K) NOT NULL," +
                                   "PRIMARY KEY( PersonName )" +
          try {
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          } catch(java.lang.ClassNotFoundException e) {
               System.err.print("ClassNotFoundException: ");
               System.err.println(e.getMessage());
          try {
     con = DriverManager.getConnection(url,
               stmt = con.createStatement();                                   
               stmt.executeUpdate(createString);
               stmt.close();
               con.close();
          } catch(SQLException ex) {
               System.err.println("SQLException: " + ex.getMessage());
Thanks,
Daniel

It doesn't have anything to do with the java driver.
You are passing DDL. That goes directly to the MS Access interface (the ODBC driver and the supporting dlls.)
There are two possibilities.
- The ODBC driver (and support) does not allow you to create blobs.
- The syntax you are using is wrong (this would be my guess.)
For the second case you might try creating the table in Acces, then use tools->analyze->documentor to produce the SQL description for that table. Whatever it produces is probably the output that it expects.

Similar Messages

  • "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition

    I am creating a program in Java which has a Database reference application.The Database I am using is MS Access.But whenever I am trying to run the program from DOS Prompt(ie executing the program:java <program name>) I am unable to connenct to the database.The compiling of the program doesn't show any error(ie javac <program name>) The following error is displayed at the DOS Prompt:
    "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition."
    Pls give me a detailed help report.If it is a Machine side problem do help me to solve it.Mine is a Compaq Presario Machine,OS:Windows 98,Database:MS Access(Office XP)
    I request you to help me in this matter.Pls email ur responses to:
    [email protected]
    [email protected]

    hi there
    did u configure ur ODBC setting if no then try these steps
    ================== ODBC Settings ========================
    step 1 : go to control panel
    step 2 : ODBC Data Sources
    step 3 : click UserDSN Tab
    step 4 : click ADD Button , Select Microsoft Access Driver , Finish
    step 5 : Give Datasource Name as "DATABASE_NAMEXXX" , no double quotes
    step 6 : use Select and select Database_NAME.mdb from <INSTALL DIRECTORY>\DATABASE_NAME.mdb
    click ok , ok finish
    <INSTALL DIRECTORY> is where yr database is
    =========================================================
    then in yr program
    URL for yr database
    "jdbc:odbc:DATABASE_NAMEXXX" // as name in step 5
    and Driver is
    "sun.jdbc.odbc.JdbcOdbcDriver"
    if u done all these steps then check yr spelling of table and tabel field in yr program
    hope this works for u
    regards
    Satinderjit

  • Creating table /  field definition

    HEllo,
    I am trying to create a table using Microsoft Access Driver with the following field definitions:
    createStatement =
    "CREATE TABLE Employee(SSN VARCHAR(9)PRIMARY KEY, "
    + "FirstName VARCHAR(15), LastName VARCHAR(15), "
    + "MiddleInitial CHAR, BirthDATE DATE, SALARY DECIMAL(10,2), "
    + "DNO int)";
    Unfortuately I am getting error when I compile. (CREATE TABLE Employee(SSN VARCHAR(9)PRIMARY KEY, FirstName VARCHAR(15), LastName VARCHAR(15), MiddleInitial CHAR, BirthDATE DATE, SALARY DECIMAL(10,2), DNO int)
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition.
    Cannot figure out what could be wrong in my code....
    If somebody could glance at it and have any suggestions, please

    thanks for the advise, but my ORACLE book is oriented
    to create tables with SQL....
    Anyway still looking for the solution of "mistery"
    of my "syntax error field definition"If you're suggesting that the SQL that Oracle recognizes and the SQL Access recognizes are the same, I think you're mistaken. I would follow DrClap's advice (this is just generally a good thing to do) and look for Access-specific documentation.

  • Syntax error in program "SAPLXRSA " -SENT

    Hi Guys,
    I have done user exit in R/3 datasource when I do the test extraction using RSA3 and geting the data without any error. I've transport the requet to Test Box and tried to do the extraction in TestBox and getting the below SYNTAX Error message. Kindly advise it's very URGET. Thanks in advance.
    ShrtText
    Syntax error in program "SAPLXRSA ".
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLRSAP" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    In program "SAPLXRSA ", the following syntax error occurred
    in the Include "ZXRSAU01 " in line 21:
    "Field "ZOXPRO0043" is unknown. It is neither in one of the specified t"
    "ables nor defined by a "DATA" statement. "DATA" statement."
    Author and last person to change the Include are:
    Author "SAPCHEOLENG "
    Last changed by "CCEV200 "
    What can you do?
    Please eliminate the error by performing a syntax check
    (or an extended program check) on the program "SAPLXRSA ".
    You can also perform the syntax check from the ABAP/4 Editor.
    If the problem persists, proceed as follows:
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    is especially useful if you want to keep a particular message.
    Error analysis
    In program "SAPLXRSA ", the following syntax error occurred:
    "Field "ZOXPRO0043" is unknown. It is neither in one of the specified t"
    "ables nor defined by a "DATA" statement. "DATA" statement."
    How to correct the error
    Probably the only way to eliminate the error is to correct the program.
    If you cannot solve the problem yourself and you wish to send
    an error message to SAP, include the following documents:
    1. A printout of the problem description (short dump)
    To obtain this, select in the current display "System->List->
    Save->Local File (unconverted)".
    2. A suitable printout of the system log
    To obtain this, call the system log through transaction SM21.
    Limit the time interval to 10 minutes before and 5 minutes
    after the short dump. In the display, then select the function
    "System->List->Save->Local File (unconverted)".
    3. If the programs are your own programs or modified SAP programs,
    supply the source code.
    To do this, select the Editor function "Further Utilities->
    Upload/Download->Download".
    4. Details regarding the conditions under which the error occurred
    or which actions and input led to the error.
    System environment
    SAP Release.............. "640"
    Application server....... "hawk"
    Network address.......... "137.132.12.22"
    Operating system......... "HP-UX"
    Release.................. "B.11.23"
    Hardware type............ "ia64"
    Character length......... 8 Bits
    Pointer length........... 64 Bits
    Work process number...... 0
    Short dump setting....... "full"
    Database server.......... "hawk"
    Database type............ "ORACLE"
    Database name............ "QAS"
    Database owner........... "SAPR3"
    Character set............ "en_US.iso88591"
    SAP kernel............... "640"
    Created on............... "Oct 16 2006 20:35:55"
    Created in............... "HP-UX B.11.23 U ia64"
    Database version......... "OCI_920 "
    Patch level.............. "153"
    Patch text............... " "
    Supported environment....
    Database................. "ORACLE 9.2.0.., ORACLE 10.1.0.., ORACLE
    10.2.0.."
    SAP database version..... "640"
    Operating system......... "HP-UX B.11"
    Memory usage.............
    Roll..................... 16128
    EM....................... 12569760
    Heap..................... 0
    Page..................... 65536
    MM Used.................. 1716768
    MM Free.................. 2470608
    SAP Release.............. "640"
    User and Transaction
    Client.............. 220
    User................ "CCEENGG"
    Language key........ "E"
    Transaction......... "RSA3 "
    Program............. "SAPLRSAP"
    Screen.............. "SAPMSSY0 1000"
    Screen line......... 6
    Information on where terminated
    The termination occurred in the ABAP program "SAPLRSAP" in
    "CALL_DATA_CUSTOMER_FUNCTION".
    The main program was "RSFHGEN2 ".
    The termination occurred in line 96 of the source code of the (Include)
    program "LRSAPF06"
    of the source code of program "LRSAPF06" (when calling the editor 960).
    Source Code Extract
    Line
    SourceCde
    66
    CALL FUNCTION BW_BTE_CALL_BW204010_E
    67
    EXPORTING
    68
    I_DATASOURCE = L_DATASOURCE
    69
    I_UPDMODE    = P_UPDMODE
    70
    TABLES
    71
    I_T_SELECT   = P_T_SELECT
    72
    I_T_FIELDS   = P_T_FIELDS
    73
    C_T_DATA     = P_T_DATA
    74
    C_T_MESSAGES = L_T_MESSAGES
    75
    EXCEPTIONS
    76
    OTHERS       = 1.
    77
    DESCRIBE TABLE P_T_DATA LINES L_LINES.
    78
    MESSAGE S408 WITH L_LINES.
    79
    Handle BTE-Exit error messages
    80
    IF SY-SUBRC <> 0.
    81
    P_SUBRC = SY-SUBRC.
    82
    IF 1 = 2. MESSAGE E021 WITH ''. ENDIF.
    83
    MESSAGE_WRITE 'E' 'R3' '021' 'BW_BTE_CALL_BW204010_E' '' '' ''.
    84
    ENDIF.
    85
    IF NOT L_T_MESSAGES IS INITIAL.
    86
    PERFORM WRITE_BTE_EXIT_MESSAGES TABLES   L_T_MESSAGES
    87
    CHANGING P_SUBRC.
    88
    ENDIF.
    89
    ENDIF.
    90
    ENDIF.
    91
    92
    Call Customer-Exit
    93
    DESCRIBE TABLE P_T_DATA LINES L_LINES.
    94
    MESSAGE S407 WITH 'EXIT_SAPLRSAP_001' 'CMOD' L_LINES.
    95
    CLEAR SY-SUBRC.
    >>>>>
    CALL CUSTOMER-FUNCTION '001'
    97
    EXPORTING
    98
    I_DATASOURCE             = L_DATASOURCE
    99
    I_ISOURCE                = L_12B_SOURCE
    100
    I_UPDMODE                = P_UPDMODE
    101
    TABLES
    102
    I_T_SELECT               = P_T_SELECT
    103
    I_T_FIELDS               = P_T_FIELDS
    104
    C_T_DATA                 = P_T_DATA
    105
    C_T_MESSAGES             = L_T_MESSAGES
    106
    EXCEPTIONS
    107
    RSAP_CUSTOMER_EXIT_ERROR = 1
    108
    OTHERS                   = 2.
    109
    DESCRIBE TABLE P_T_DATA LINES L_LINES.
    110
    MESSAGE S408 WITH L_LINES.
    111
    112
    Handle Customer-Exit error messages
    113
    IF SY-SUBRC <> 0.
    114
    P_SUBRC = SY-SUBRC.
    115
    IF 1 = 2. MESSAGE E020 WITH ''. ENDIF.
    Contents of system fields
    Name
    Val.
    SY-SUBRC
    0
    SY-INDEX
    1
    SY-TABIX
    1
    SY-DBCNT
    0
    SY-FDPOS
    0
    SY-LSIND
    0
    SY-PAGNO
    0
    SY-LINNO
    1
    SY-COLNO
    1
    SY-PFKEY
    SY-UCOMM
    SY-TITLE
    Report for the extractor call
    SY-MSGTY
    S
    SY-MSGID
    R3
    SY-MSGNO
    407
    SY-MSGV1
    EXIT_SAPLRSAP_001
    SY-MSGV2
    CMOD
    SY-MSGV3
    100
    SY-MSGV4
    Active Calls/Events
    No.   Ty.          Program                             Include                             Line
    Name
    5 FUNCTION     SAPLRSAP                            LRSAPF06                               96
    CALL_DATA_CUSTOMER_FUNCTION
    4 FORM         SAPLRSAP                            LRSAPF06                               96
    CALL_DATA_CUSTOMER_FUNCTION
    3 FORM         GP3PDR0GQDXJ0ZOA35DPGNCU80M         GP3PDR0GQDXJ0ZOA35DPGNCU80M           274
    PROCESS_DATA_PACKAGE
    2 FORM         GP3PDR0GQDXJ0ZOA35DPGNCU80M         GP3PDR0GQDXJ0ZOA35DPGNCU80M           170
    DATA_TRANSFER
    1 EVENT        RSFHGEN2                            RSFHGEN2                               59
    START-OF-SELECTION

    Hello Raja,
    I think some objects should still lying in the dev. server which are yet to be transported, also try to deactivate and reactivate the project for user exit for BW and transport it .
    Also manually request can be created for transporting object "ZOXPRO0043" into quality environment and transport it .
    Let us know the output for the same.
    Hope that helps.
    Regards
    Kapadia
    ***Assigning points is the way to say thanks in SDN.***

  • Syntax error in program "HINCALC0 ".

    Hi,
    After applying the Snote -1474958 along with the Prerequisties (Snote -1455387,1425161,1452218,1456076,1459813,1459875,1475735), when we exec the TC PC00_M40_CALC we are getting the abap dump.
    Runtime Errors         SYNTAX_ERROR
    Date and Time          23.08.2010 13:06:31
    ShrtText
    Syntax error in program "HINCALC0 ".
    What happened?
    Error in ABAP application program.
    The current ABAP program "????????????????????????????????????????" had to be
    terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    In program "HINCALC0 ", the following syntax error occurred
    in the Include "PCSECIN0 " in line 155:
    "Field "80CCF_DEDMT" is unknown. It is neither in one of the specified "
    "tables nor defined by a "DATA" statement. "DATA" statement."
    Author and last person to change the Include are:
    Author "SAP "
    Last changed by "BASIS_USER "
    Error analysis
    In program "HINCALC0 ", the following syntax error occurred:
    "Field "80CCF_DEDMT" is unknown. It is neither in one of the specified "
    "tables nor defined by a "DATA" statement. "DATA" statement."
    Trigger Location of Runtime Error
    Program                                 ????????????????????????????????????????

    Hi Ramana,
    While applying the snote we are getting error below
    Yellow light for the status Object PCFDCIN0- Corrections incompletly copied:see change display.
    Green Light for the Status Object PSDECIN0 - Changes Can be copied
    Green Light for the Status Object PSDECIN1 - Changes Can be copied
    Regards,
    KARAN.

  • Syntax error in GB06

    Hi guys,
    We are facing a dump error in GB06 tcode.Whenever a reverse posting is done its going for dump.It says -
    The following sytax error occured in the program SAPFGSTO and in include FGSTOI02 and in line 16.When i checked in line 16, a FM -
    case used_v1-tab.
    when 'GLPCA'.
    CALL FUNCTION 'G_PCA_0_POSTING' IN UPDATE TASK
    TABLES
    INT_GLPCA = IGLPCA
    INT_GLPCA_ADD = IGLPCA_ADD.
    WHEN 'GLPCP'.
    CALL FUNCTION 'G_PCA_1_POSTING' IN UPDATE TASK
    TABLES
    INT_GLPCP = IGLPCP
    INT_GLPCP_ADD = IGLPCP_ADD.
    This line is going for dump.Since its a standard program and checked for any syntax error -
    The field IGLPCA is unknown but there is a similar name with 'GLPCA'.We are into ECC6.0 and i compared the same include with 4.0 and the above code is not present there and its running fine.In include FGSTOI02(where iam facing dump) the above line is commented -
    Created by : DDIC
    Date : 05/16/09
    Time : 04:01:43
    Generator : RGGSTORN
    So do i need to check in program RGGSTORN or in the same includeor its a configuration related issue.How i need to come over with this issue?

    Hi,
    check SAPNET note 1143335 maybe its helpful.
    Best regards, Christian

  • Date/Time Field in Access 2000 - INSERT INTO ... syntax error

    I am using Labview 6.1 Professional with the Database Connectivity Toolkit. When I execute this SQL Command "INSERT INTO PRODUCTION (Part, Passed, Date) VALUES ('Part#1', 2, '10/10/2003 10:10:10 AM')" I get a Run-Time Syntax Error. If I remove the Date Label and Date Value it works. What is the proper Format of the Date/Time Type Field in ACCESS 2000 for Labview 6.1 SQL? I have seen and tried all of the solutions already posted like MSG 1ZNAJHJ6.

    Well, if it's any consolation handling dates is a pain regardless of which database you use. In any case, I created a table with the following definition:
    CREATE TABLE testing
    (item1 INTEGER,
    item2 DATE)
    I them did the following insert:
    INSERT INTO testing
    VALUES (1, '18/11/1953 04:20:00');
    And everything worked fine. Note that in the date (my Bday, BTW) the format is DD/MM/YYYY followed by the time.
    What exactly is the error you're getting? Can you post the exact text of the error message. Also, I ran my test using the examples that come with LabSQL--not the toolkit.
    Mike...
    Oops, just noticed something. You have a column name that is probibly a reserved word "Date". Try your insert as:
    INSERT INTO PRODUCTION
    VALUES
    ('Part#1', 2, '10/10/2003 10:10:10 AM')
    If there is only those three columns and they the order the data appears is the same as the column order, you don't need the column list. If this works (and it should--I just tried it) I would only view it as a temporary patch. The column name should be changed.
    This is also a good reason to not use the Access GUI to create tables. If you tried creating a table like that in SQL you would have gotten an error message. Learning to build tables in SQL code isn't hard and it adds an extra layer of error checking that the GUI apparently doesn't think is important.
    If you're interested let me know and I can send you the info on a really good book on SQL...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Syntax error - Field is defined differently in screen (ABAP Dictionary)

    Hi
    I get a syntax error after decoupling a dynpro field from its original DDIC type (Disabling checkbox "Frm Dict"). The error message is
    [DE]  Feld ... ist im Dynpro unterschiedlich definiert (ABAP-Feld, DDIC-Feld).
    [EN]  Field ... is defined differently in screen (ABAP/4 field, Dictionary field).
    The error occurs on PLM 600/700 but not on PLM 500.
    Thanks in advance for your help.
    Regards,
    Michael

    hi Praneeth,
    what is the program name,screen number you are trying to modify..,and after appending the field <b>ZZKVGR6 to KNVV</b> , now go to table and choose menu <b>Utilities->Data base Utility-></b> now click on  <b>Activate and Adjust the Data base</b>, then try to add the field.
    and are you adding the field from Dictionary (i.e you have option Get From Dictionary in that give KNVV table name it will list the fields, choose zzkvgr6 from it, and place it in your screen.)
    the exit which you are adding should be appropriate one
    or else you won't get the desired results. what is the exit..
    Regards
    vijay

  • [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error

    Hi , i am trying to execute siple SP using JDBC-ODBC Bridge Driver
    Here my code :
    String dsn="Tritek1";
    String user="sa";
    String password="imcindia";
    Connection con1 = null;
    CallableStatement cstmt = null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    con1=DriverManager.getConnection("jdbc:odbc:"+dsn,user,password);
    Statement st=con1.createStatement();
    st.execute("use dm0102d");
    st.execute("setuser 'dm01012'");
    cstmt = conObject.connection(" ?=Call dms_ex_get_folder_info(?,?,?)");
    cstmt.setString(1,folderType);
    cstmt.registerOutParameter(2,java.sql.Types.VARCHAR);
    cstmt.registerOutParameter(3,java.sql.Types.VARCHAR);     bFlag=cstmt.execute();
    Here my SP :
         Procedure Name          :     dms_ex_get_folder_info
         Input Parameter(s)          :     a. folder_type char(20)
         Return Parameter(s)     :     a. Recordset consist edit_mask and folder_type_code from folder_reference table / error
         Procedure Type          :     select
         Programmer          :     Prashanth Kumar M.
         Creation Date          :     12/20/2005 (20th Dec, 2005)
         Tables Accessed          :     folder_reference
         Revised               :
              Programmer:     Date:     Description:
              Prashanth Kumar M.      12/21/2005 Modified the script as per the approved program specifications.
         Test Query:
              Declare @edit_mask char(15)
              Declare @folder_type_code char(2)
              execute dms_ex_get_folder_info 'Policy Folder',@edit_mask output,@folder_type_code output
              Print 'Edit Mask : ' + @edit_mask
              Print 'Folder Type Code : ' + @folder_type_code
    CREATE PROCEDURE dms_ex_get_folder_info
         @folder_type char(20),
         @edit_mask char(15) output,
         @folder_type_code char(2) output
    AS
         BEGIN
              -- Check if the record for @folder_type exists or not.
              BEGIN
                   -- return the record from folder_reference
                   SELECT
                        @edit_mask= IsNull(edit_mask,''),
                        @folder_type_code = IsNull(folder_type_code,'')
                   FROM      folder_reference
                   WHERE
                        folder_decode = ltrim(rtrim(@folder_type))
                   -- return the error message
                   IF @@error <> 0
                        BEGIN
                             RAISERROR 100016 'Error in gettting the record from folder_reference table'
                             RETURN (@@error)
                        END
                   IF @edit_mask = '' AND @folder_type_code = ''
                        BEGIN
                             RAISERROR 100017 'No matching details in the folder_reference table'
                        RETURN (@@error)
                        END
              END
         END
    GO
    Here My Exception:
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
         at com.nyl.dms.bl.Folder.createFolder(Folder.java:121)
         at com.nyl.dms.bl.Folder.main(Folder.java:223)
    Any one can help me to overcome this problem . Thanks in advance.
    venkat

    Here's from one of those 10s of books.
    Quoted from JDBC 3.0 by Bernard Van Haecke:
    Stored procedures can return multiple result types because they can be composed of SQL statements that return diverse result types: resultsets and update counts (this includes special error codes).
    Now this doesn't sound very satisfactory. So I use Sybase since I don't have any other database at the moment, and write a simple stored procedure.
    CREATE proc testproc AS
    BEGIN
    -- My return code
    return 7
    END
    goThen a sample patchy buggy code to play around:
    import java.sql.*;
    public class ProcTesting {
        public static void main(String[] args) {
            String connUrl          = "jdbc:sybase:Tds:myserver:5150/dbinst";
            String userName         = "username";
            String password         = "password";
            Connection con          = null;
            CallableStatement stmt  = null;
            ResultSet rs            = null;
            String sql = "{? = call testproc}";
            try {
                Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
                con     = DriverManager.getConnection(connUrl, userName, password);
                stmt    = con.prepareCall(sql);
                stmt.registerOutParameter(1, Types.INTEGER);
                stmt.execute();
                System.out.println(stmt.getInt(1));
            } catch(Exception e) {
                e.printStackTrace();
            } finally {
                closeAll(con, stmt);
        public static void closeAll(Connection con, Statement stmt) {
            try {
                con.close();
            } catch(Exception e) {  }
            try {
                stmt.close();
            } catch(Exception e) {  }
    }Followed by:
    javac ProcTesting.java
    java -cp "%CLASSPATH%;C:\jarutils\jconn2.jar" ProcTesting
    Output:
    7
    Didn't you know this could be done?
    Happy new year, grandpa!

  • COUNT field incorrect or syntax error

    hi,
    PreparedStatement stmt = con.prepareStatement("Insert into uQuestions values(?,?)");
    stmt.setInt(1,2);
    //stmt.setString(2,s.trim());
    Reader rd=new StringReader(s.trim());
    stmt.setCharacterStream(2, rd );
    System.out.println( stmt.executeUpdate() );
    stmt.close();Result
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error
    In place of setCharacterStream If I use stmt.setString(2,s.trim()) then it works fine.
    Whats the problem there....

    I am using Java 6 already.That's what I said in my last post.
    setClob() and setCharacterStream() are used for
    NVARCHAR and NTEXT tyesLike I said, the API talks about using setCharacterStream for LONGVARCHAR types, are NVARCHAR and NTEXT LONGVARCHAR types?

  • COUNT field incorrect or syntax error while installing BO Xi3

    Hello
    I am trying to install Boxi3. The cms and audit dbs are all in sql database. The dbs and accounts are setup properly. However while installing, after I selected the CMS and Audit DBs, I am getting
    "Database access error. Reason [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error."
    At the details the error is as below.
    Wed Jul 30 03:46:53 2008]     5220     192     trace message: loading libary succeeded
    [Wed Jul 30 03:46:53 2008]     5220     192     trace message: AuditDatabaseSubsystem::Init()
    [Wed Jul 30 03:46:53 2008]     5220     192     trace message: initializing subsystem succeeded
    [Wed Jul 30 03:46:53 2008]     5220     192     trace message: AuditDatabaseSubsystem::Connect()
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\DBConnectionManager.cpp:802): trace message: DBConnectionManager - Setting total target number of connections for pool 0 to 1.
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:186): trace message: ExecDirect: SQL: SELECT * FROM APPLICATION_TYPE WHERE 0 = 1
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:186): trace message: ExecDirect: SQL: SELECT * FROM AUDIT_EVENT WHERE 0 = 1
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:186): trace message: ExecDirect: SQL: SELECT * FROM EVENT_TYPE WHERE 0 = 1
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:186): trace message: ExecDirect: SQL: SELECT * FROM SERVER_PROCESS WHERE 0 = 1
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:186): trace message: ExecDirect: SQL: SELECT * FROM AUDIT_DETAIL WHERE 0 = 1
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:186): trace message: ExecDirect: SQL: SELECT * FROM DETAIL_TYPE WHERE 0 = 1
    [Wed Jul 30 03:46:53 2008]     5220     192     trace message: AuditDatabaseSubsystem::CheckDBCredentials()
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\AuditDatabaseSubsystem_impl.cpp:1197): trace message: AuditDatabaseSubsystem::CheckDBCredentialsOnTable(AUDIT_EVENT)
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\SQLServerDatabase.cpp:515). (0 : Unexpected database column type for Duration type is decimal).
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\SQLServerDatabase.cpp:515). (0 : Unexpected database column type for Event_Type_ID type is decimal).
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\SQLServerDatabase.cpp:515). (0 : Unexpected database column type for Error_Code type is decimal).
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:162): trace message: Prepare: SQL: INSERT INTO AUDIT_EVENT (Duration, Error_Code, Event_ID, Event_Type_ID, Object_CUID, Server_CUID, Start_Timestamp, User_Name) VALUES(?, ?, ?, ?, ?, ?, ?, ?)
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\SQLServerStatement.cpp:699). (0 : Unsupported SQL Server data type for binding.).
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\SQLServerStatement.cpp:699). (0 : Unsupported SQL Server data type for binding.).
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\SQLServerStatement.cpp:699). (0 : Unsupported SQL Server data type for binding.).
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\AuditDatabaseSubsystem_impl.cpp:1344). (0 : no message).
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\AuditDatabaseSubsystem_impl.cpp:1344). (0 : no message).
    [Wed Jul 30 03:46:53 2008]     5220     192     assert failure: (.\AuditDatabaseSubsystem_impl.cpp:1344). (0 : no message).
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerStatement.cpp:171): trace message: Prepared statement Execute
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\SQLServerDatabase.cpp:119): trace message: SQLServer error found:  ErrorMessage([Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error), ErrorCode(0)
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\AuditDatabaseSubsystem_impl.cpp:92): trace message: DBConnectionHolder - (AuditDB) - Caught retryable error with Code 0, Msg: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error  Number of retryable errors on this connection is 1
    [Wed Jul 30 03:46:53 2008]     5220     192     (.\dbutils.cpp:922): trace message: Caught DatabaseSubystem Error: Database access error. Reason [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error.
    [Wed Jul 30 03:46:53 2008]     5220     192     trace message: AuditDatabaseSubsystem::Shutdown()
    This only happens for audit db and not for cms db. May I know what is the reason for this and how to resolve it?
    Thanks

    I am using Java 6 already.That's what I said in my last post.
    setClob() and setCharacterStream() are used for
    NVARCHAR and NTEXT tyesLike I said, the API talks about using setCharacterStream for LONGVARCHAR types, are NVARCHAR and NTEXT LONGVARCHAR types?

  • The expression in field u0093Company_Codeu0094 contains an error: Syntax error

    Hi all,
    I have added an extra variable to my query. Then in VC I refreshed my queries and added an extra field to the input form I used. I also updated the submit actions. Now when I deploy it says
    The expression in field “Company_Code” contains an error: Syntax error
    How to solve this?
    Thanks in advance,
    Ralph

    You can double click on the error and then you get more information and the issue is selected by the Visual Composer. Maybe there is an error in your formula or the value, which you have assinged has a wrong data type.
    Best Regards,
    marcel

  • Syntax error in Start Routine routine 9998 in transformation

    Hi Guyz,
    I am getting the below error while doinf the syntax check in start routine in one of the transformation in BW production after the failed TR movement
    E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter
    "SOURCE_PACKAGE" is incompatible with the formal parameter
    "DATA_PACKAGE".
    but for the same transformation in quality its showing  no syntax errors found.
    its an odd behaviour.
    please guide with ur expertise.
    cheerz,
    raps.

    Hi,
    Check the note 1052648. it says that:
    Start routine:
               In the start routine, all the fields from the source are always available.
    During the migration, a type '_ty_t_SC_1_full' is generated in '2nd part global'. Since Note 1325124, this type has been adjusted when the field list is changed. In the past, a change to the field list caused syntax errors of the type:
    For update rules:
                        E: For PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter "SOURCE_PACKAGE" is not compatible with the formal parameter "DATA_PACKAGE".
    For transfer rules:
                        E:For PERFORM or CALL FUNCTION "STARTROUTINE", the actual parameter "SOURCE_PACKAGE" is not compatible with the formal parameter "DATAPAK".
               If this error continues to occur, go to the solution section to correct it.
               Solution:
               This error should now be automatically corrected with Note 1325124. Access the incorrect start routine in change mode. The type '_ty_s_SC_1_full' is then automatically adjusted to the source structure. If this does not work, you should use the tool 'RSTRAN_MIGRATION_CHECK' (described in Note 1369395) to check and possibly repair the transformation in question.
               If this error still occurs, you can correct it manually as follows:
               Copy the field list of the type     '_ty_s_SC_1' from the 'private section' of the CLASS lcl_transform DEFINITION (you can find this when you scroll up in the routine editor of the start routine) to the type '_ty_s_SC_1_full' of '2nd part global'.
    Regards,
    Anil Kumar Sharma .P

  • Cannot transport from quality to production due to syntax error

    Hi all,
    I have modified the program in Development system in which i have added on field to the internal table structure. Internal table is declared in the top include of the program. Now the program is transported to the Quality server which ends with the error for top include as"Original object cannot be replaced". But when i check the top include in quality server, the field which i have added is available. Now for transporting to production server, it ends by syntax error saying "The data object ITAB does not have a component called <field>".
    Please guide me for the above error.
    Thanks & Regards
    Akshay Korade

    >
    Akshay Korade wrote:
    > The production system contains the version before the changes and the error comes while transporting to production system. So the changes are not reflected in the production system.
    I've been doing SAP for a while and I can tell you, definitively, that syntax errors do not prevent import.
    >All the includes are activated and free from syntax errors in quality system.
    >Now for transporting to production server, it ends by syntax error saying "The data object ITAB does not have a component called <field>".
    If there are no syntax errors in quality, then where is that syntax error showing?  It must be in production.  It will be an inactive version in production that has the syntax error.  Go into production, try to activate the program.  Activation will fail because of the syntax error.
    You get the syntax error because the defintion has not made it into P.  If you transport the whole program, as R3TR PROG zprog, and have the correct flags set on import to overcome the message "Original object cannot be replaced", then your problem will be solved.
    matt

  • Syntax error  while executing Key Figure routine

    Hello,
    I am posting my question again, as I have not got any solution. Please help it will be really appreciated. Here's the description
    I am loading data from flatfile to an Infocube with 3 keyfigures: Sales Price , Sales Quantity, Sales Revune. Getting values for Sales Price and Salea Quantity  from flatfile and calculating for Sales Revunue IO_VB_REV using routine
    - I created Transformations, and under Rule Group: Standard Group box I have not mapped IO_VB_REV  any datasource field and see 'X' sign against the field.
    - In rules detail screen, I add two source fields of Rule , IO_VB_QU and IO_VB_PRC. I see IO_VB_REV already added under 'Target fields of Rule' section
    - I then add the only following line to routine
    RESULT = SOURCE_FIELDS_RULE-/BIC/IO_VB_QU * SOURCE_FIELDS_RULE-/BIC/IO_VB_PRC .
    - Clicking on check button it gives no syntax error message. I save and exit back to Rule Details page.
    - For IO_VB_REV field If I select any of 2 options i.e. Fixed Unit or No conversion it gives me a dump. So I select 'from conversion' option. In that case I enter USD against 'Conversion Type' field. It gives me information box popup with 'Incorrect Input Message'
    - When check button hit on 'Rule Details' page, it gives me error message ' Syntax error in routine '
    Why is it giving me syntax error, inspite of the fact that I get 'no syntax error' message on routine page. Also why am I getting short dumps on changing Conversion Type

    Hi Olivier,
    I really thank you for ur efforts in helping me solving this problem. Below is complete description of KF defined,
    1. Created InfoObjects for Sales Quantity, Sales Price, Sales Revunue
    Definition of <b>Sales Quantity</b>
    Name: IO_VB_QU
    Type/Data Type : Quantity
    Data Type: QUAN - Quantity field, points to unit field with format UN
    Currency / unit of measure
    Unit / Currency: 0UNIT
    Definition of <b>Sales Price</b>
    Name: IO_VB_PRC
    Type/Data Type : Amount
    Data Type: CURR - Currency field, stored as DEC
    Currency / unit of measure
    Fixed Currency: USD
    Definition of <b>Sales Revunue</b>
    Name: IO_VB_REV
    Type/Data Type : Amount
    Data Type: CURR - Currency field, stored as DEC
    Currency / unit of measure
    Fixed Currency: USD
    2. As the data is being read from flatfile, created DataSource with fields for Sales ID, Sales Price, Sales Quantity. As I am reading unit for quantity from file (has values EA,BOX,CSE), I have a corresponding field UNIT in DataSource. No field for Sales Revunue.
    3. I use 'Create Transformation' functionality to automatically create transformations.
    4. Rule Details page of each of 3 KFs has following values
    <b>Rule Details page of Sales Quantity</b>
    Rule Type: Direct Assignment
    Aggregation : Summation
    Target Unit: 0UNIT
    Unit: from Source
    Source Unit: UNIT
    Source Fields of Rule: /BIC/IO_VB_QU, UNIT
    Target Fields of Rule: 0UNIT, IO_VB_QU
    <b>Rule Details page of Sales Price</b>
    Rule Type: Direct Assignment
    Aggregation : Maximum
    Fixed Target Currency : USD
    Currency: No Conversion
    Source Fields of Rule: /BIC/IO_VB_PRC
    Target Fields of Rule:  IO_VB_PRC
    <b>Rule Details page of Sales Revunue</b>
    Rule Type: Routine   
    Aggregation : Summation
    Fixed Target Currency : USD
    Currency: from Conversion
    Conversion Type: ??????.....(I entered USD it gives me Incorrect Input message)
    Source Fields of Rule: /BIC/IO_VB_PRC, /BIC/IO_VB_QU, UNIT
    Target Fields of Rule:  IO_VB_REV
    I have this line is the routine 
    RESULT = SOURCE_FIELDS_RULE-/BIC/IO_VB_QU *   SOURCE_FIELDS_RULE-/BIC/IO_VB_PRC.
    Let me know if u need any other info......
    I really appreciate u trying  to help me
    Vidya

Maybe you are looking for

  • First Generation Ipod Nano gives error message when using Windows Vista

    I have a dual boot PC running XP Home and Vista Home Premium. My three kids have Ipod Nanos. Each kid has their own user profile on the PC. The later generation Nanos (2) work with Vista perfectly. The first generation Nano causes an error message wh

  • ITunes sync disables EAS sync

    I have user that just updated iTunes to the latest version. Now whenever he syncs with his laptop, his EAS will stop syncing. He can go back in and setup the account again and it will work until he syncs. Then it stops.

  • ITunes 8 (OSX 10.4.11) how to convert files.

    In iTunes 8, how do I convert my AIFF files to another format? Following the iTunes help doesn't work. It says open Prefs, then Advanced and then importing. Seems no importing tab appears in my vs of the Prefs Advanced window.

  • Oracle reports Server Freezing

    Hi I'm sorry if this has been posted before but I have been looking for about 45 minutes and couldn't find exactl what I was looking for. I have three different reports servers(11.1.1.2.0) which all display the same symptoms if they are unused over t

  • HR - Changing temporary staff status to permanent.

    A permanent employee has not been getting the accrual leave hours. This is because her Employee group was still set as Temporary though she was confirmed permanent staff in October of 2006. I think this has affected her leave accruals(Annual Leave) b