"[Oracle][ODBC]Restricted data type attribute violation

Hi,
I have a program that use the database object,TQuery in Borland C++ Builder 5 to access information on an Oracle8i table. The program was working fine until I updated the Oracle8i ODBC driver from 8.1.5 to 8.1.6.
I am getting the error :
"[Oracle][ODBC]Restricted data type attribute violation."
I can't see what I have done wrong with the SQL statement in the query as it is only a select * from table statement. Can anyone help me with this ? Thank in advance.
C.M.

I think I had found what is causing the problem. It looks like the latest Oracle ODBC driver doesn't like any table that
consists of any 2 fields of type NUMBER but with 1 of them having
NOT NULL. >example : >Name Null? Type>-------- --------
----------------- NO1 NUMBER>NO2 NOT NULL NUMBER>I think this is
a bug. >null
I am not sure what you mean by the statement
"the latest Oracle ODBC driver doesn't like any table that
consists of any 2 fields of type NUMBER but with 1 of them having
NOT NULL"
Do you mean there cannot be two not null number columns in a
table witht he latest Oracle ODBC driver.
I am running into the same problem as you did. I am getting a
restricted type violation, and have isolated the column and it is
a number(x,y). I have the the Oracle Client 8.01.06.00 driver
and I have PowerBuilder8.0 as the GUI.
Any help would be much appreciated,
Thanks in advance,
Khanh

Similar Messages

  • Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right trun

    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    Thanks in advance.
    -R

    Sorry for incomplete information. Basically there is a insertion and then there is retrieval of information from the same data table.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

  • Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right trunca

    Dear All,
    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

    Dear All,
    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

  • Issue with Oracle LONG RAW data type

    Hi All,
    I am facing some issues with Oracle LONG RAW DATA Type.
    We are using Oracle 9IR2 Database.
    I got a table having LONG RAW column and I need to transfer the same into another table having LONG RAW column.
    When I tried using INSERT INTO SELECT * command (or) CREATE TABLE as select * , it is throwing ORA-00997: illegal use of LONG datatype.
    I have gone through some docs and found we should not use LONG RAW using these operations.
    So I did some basic PLSQL block given below and I was able to insert most of the records. But records where the LONG RAW file is like 7O kb, the inserting is faliling.
    I tried to convert LONG RAW to BLOB and again for the record where the LONG RAW is big in size I am getting (ORA-06502: PL/SQL: numeric or value error) error.
    Appreciate if anyone can help me out here.
    DECLARE
    Y LONG RAW;
    BEGIN
    FOR REC IN (SELECT * FROM TRU_INT.TERRITORY WHERE TERRITORYSEQ=488480 ORDER BY TERRITORYSEQ ) LOOP
    INSERT INTO TRU_CMP.TERRITORY
    BUSINESSUNITSEQ, COMPELEMENTLIFETIMEID, COMPONENTIMAGE, DESCRIPTION, ENDPERIOD, GENERATION, NAME, STARTPERIOD, TERRITORYSEQ
    VALUES
    REC.BUSINESSUNITSEQ, REC.COMPELEMENTLIFETIMEID, REC.COMPONENTIMAGE, REC.DESCRIPTION, REC.ENDPERIOD, REC.GENERATION, REC.NAME,
    REC.STARTPERIOD, REC.TERRITORYSEQ
    END LOOP;
    END;
    /

    Maddy wrote:
    Hi All,
    I am facing some issues with Oracle LONG RAW DATA Type.
    We are using Oracle 9IR2 Database.
    I got a table having LONG RAW column and I need to transfer the same into another table having LONG RAW column.
    When I tried using INSERT INTO SELECT * command (or) CREATE TABLE as select * , it is throwing ORA-00997: illegal use of LONG datatype.
    I have gone through some docs and found we should not use LONG RAW using these operations.
    So I did some basic PLSQL block given below and I was able to insert most of the records. But records where the LONG RAW file is like 7O kb, the inserting is faliling.
    I tried to convert LONG RAW to BLOB and again for the record where the LONG RAW is big in size I am getting (ORA-06502: PL/SQL: numeric or value error) error.
    Appreciate if anyone can help me out here.
    DECLARE
    Y LONG RAW;
    BEGIN
    FOR REC IN (SELECT * FROM TRU_INT.TERRITORY WHERE TERRITORYSEQ=488480 ORDER BY TERRITORYSEQ ) LOOP
    INSERT INTO TRU_CMP.TERRITORY
    BUSINESSUNITSEQ, COMPELEMENTLIFETIMEID, COMPONENTIMAGE, DESCRIPTION, ENDPERIOD, GENERATION, NAME, STARTPERIOD, TERRITORYSEQ
    VALUES
    REC.BUSINESSUNITSEQ, REC.COMPELEMENTLIFETIMEID, REC.COMPONENTIMAGE, REC.DESCRIPTION, REC.ENDPERIOD, REC.GENERATION, REC.NAME,
    REC.STARTPERIOD, REC.TERRITORYSEQ
    END LOOP;
    END;
    /below might work
    12:06:23 SQL> help copy
    COPY
    Copies data from a query to a table in the same or another
    database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
    COPY {FROM database | TO database | FROM database TO database}
                {APPEND|CREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
    where database has the following syntax:
         username[/password]@connect_identifier

  • How to set default value to date type attribute.

    Hi,
    How to set default value to date type attribute.
    E.g I want to set u201C01/01/1999u201D to date attributes.
    First i want to set value and then i want to fetch the same & want to check equals.
    please suggest solution.
    Regards,
    Smita

    Hi,
    In wdinit() method u can set the date
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    Date today = Calendar.getInstance().getTime();
    String reportDate = df.format(today);
    wdContext.currentContextElement().setFromDate(reportDate);
    Another way you have set the this formate like that
    1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
    2. Select the type as "date"
    3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
    4.Bind the context attribute to the type created now.
    Hope this helps u.
    Best Regards
    Vijay K

  • Date type attribute in web dynpro callable object

    Hi all,
    I am creating a callable object with date type attribute as input parameter in a web dynpro callable object.
    date type I have used is java.sql.date.
    But when I am exposing that callable object in GP its giving an error:
    Technical Exception:
    Web dynpro Component cannot be created.
    And when i am changing date type as java.util.date then I am not able to asssign that date attribute in my view layout.
    Can anyone plese help me.

    Hi Ritu ,
               u have to convert the util date to sql date in the execute method .
    do it as showm below in Execute method in the component Controller :
    let the Attribute be planEndDate in the Context:
    public void execute( com.sap.caf.eu.gp.co.api.IGPExecutionContext executionContext )  {
    java.util.Date planEndDate = null;
    planEndDate = (java.util.Date) inputStructure.getAttributeAsDate(IContextElement.PLAN_ENDDATE);
    java.sql.Date sqlDate = new java.sql.Date(planEndDate.getTime());
                        wdContext.currentContextElement().setPlanEnddate(sqlDate);
    Thanks and Regards

  • How can i validate(compare) two date type attribute in EO.

    Hi All,
    jdev version 11.1.2.1.0
    i have created one EO where two date type attribute ToDate and FromDate now i want to add validation rule.
    which validate that difference b/w ToDate and FromDate not more than 3 month.
    How can i validate this?

    You can create script expression
    Something like
    if((toDate.getTime()-fromDate.getTime())/(1000 * 60 * 60 * 24)>30)
      return true;
    else
      return false;-Arun
    P.S : Above example calculates based on number of Days (30). If you want 3 months, you need to put a logic - Simply 90 days? What about the months with 31 days and 28/29 days? etc.

  • Entity DATE type attribute : Derieved From SQL Expression for date format

    Hi,
    I want to set one of the Entity's Date Attribute with specific format , for e.g DD-MM-YYYY
    I see a Derieved From SQL Expression checkbox, how can I define the SQL Expression
    can I use TO_DATE(EMP_START_DATE,'DD-MM-YYYY'), I want to insert a date in that format, when I am creating a row using viewObject.createRow()
    Java Type is oracle.jbo.domain.Date which take YYYY-MM-DD as a string, I do not want to use this format
    Thanks,

    Here is a solution, but I am sure it is not the best one. It will work in a hurry. Maybe you can create a helper method to generalize this conversion until something more succinct comes along for US:
    This code assumes an import of jbo.oracle.domain.Date.
        public void updateDateTest () {
            AddressesViewImpl lVO = (AddressesViewImpl)this.getAddressesView1();
            AddressesViewRowImpl lRow = (AddressesViewRowImpl)lVO.first();
            System.out.println("create date for current record is currently: " +
                               lRow.getCreationDate());
            java.util.Date today = new java.util.Date();
            SimpleDateFormat dateFormat =
                new SimpleDateFormat("dd-MM-yyyy");
            SimpleDateFormat jboDateFormat =
                new SimpleDateFormat("yyyy-MM-dd");
            String lSampleDateString = "15-04-2010";
            java.util.Date lSampleDate = null;
            try {
                lSampleDate = dateFormat.parse(lSampleDateString);
            } catch (ParseException e) {
                System.out.println("Parsing exception thrown:  " + e.getMessage() +
                                   "\n ==> caused by \n==>"+ e.getCause().getMessage());
                lRow.setCreationDate(new Date(jboDateFormat.format(lSampleDate)));
            System.out.println("about to commit; create date for current record is currently: " +
                               lRow.getCreationDate());
            this.getDBTransaction().commit();
            System.out.println("resetting to some other date; create date for current record is currently: " +
                               lRow.getCreationDate());
                lRow.setCreationDate(new Date(jboDateFormat.format(today)));
            this.getDBTransaction().commit();
        }I defined this code in my Application Module Impl file and ran it with the BC tester. Here was its output:
    Mar 18, 2010 8:27:54 AM oracle.jbo.jbotester.MainFrame main
    INFO: BC4J Tester started.
    Source breakpoint occurred at line 66 of FusionExperimentsAMImpl.java.
    create date for current record is currently: 2009-02-02 12:09:54.0
    about to commit; create date for current record is currently: 2010-04-15
    resetting to some other date; create date for current record is currently: 2010-04-15I spent a little time looking around the forum for additional solutions. I think several years ago I even wrote a blog entry on this subject. If I remember how to do this right I will amend with more information.

  • Validation on Integer data type attribute

    Hi,
    Working on jdev 11.1.1.3.0
    I have to do validation on integer data type like, it should not allow 13.20(only single digit numbers.).
    I am doing validation on AMImpl and converting the int into string
    String per=Row.getPer().toString();// here if user enter 13.20, then per containing only 13 so its not going to inside if.
    if(StringUtils.contains(per,"."))
    return false;
    Even i have written regular expression on my field but its working
    can any one help me.

    Hi,
    Why don't you use the af:convertNumber in your tag?
    Something like that:
    <af:inputText>
    <af:convertNumber>
    </af:inputText>
    Doc: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_convertNumber.html
    Regards,

  • How to migrate SQL Server image data type to Oracle 8 BLOB data type?

    Hi,
    I have to migrate data from sql server to Oracle 10 g.
    I am unable to migrate image data type from sql server to blob data type in oracle.
    Iam using Oracle Heterogenous Services to migrate the data,Using Merge statement and database link.
    I am getting the following error-
    ERROR at line 7:
    ORA-00932: inconsistent datatypes: expected BLOB got LONG BINARY
    Can any one suggest me how to migrate Image datatype to BLOB???

    Hi you might want to post your question in General Forum.
    General Database Discussions
    There's very few users visit this forum.

  • BC4j-- unable to set date type attribute in a row

    when i m set a attribute which is of date type in row of a view.
    it is giving me error " cannot create object of date type"
    i'll apreciate the answer to this problem
    thanx

    <%
    SimpleDateFormat databaseFormat = new SimpleDateFormat();
    SimpleDateFormat viewFormat = new SimpleDateFormat();
    databaseFormat.applyPattern("yyyy-MM-dd");
    viewFormat.applyPattern("MM/dd/yyyy");
    // to convert &#8220;MM/dd/yyyy&#8221; to &#8220;yyyy-MM-dd&#8221; for updating database
    String date_view=&#8221;12/31/2001&#8221;;
    String date_db=new String(databaseFormat.format(viewFormat.parse
    (date_view)));
    ...setAttribute(column_name,date_db);
    %>

  • Oracle/java timestamp data type error.. please help

    Im having trouble with a SQL query of mine. Im trying to get a timestamp using JDBC from an oracle database however i get the following error:
    java.sql.SQLException: ORA-00932: inconsistent datatypes: expected %s got %s
    Now when i put the java.util.timestamp into the DB it appears to change.
    When I printout the value of the timestamp in my console it prints the following:
    07-06-26 17:28:09.414
    When i check the value from SQL PLUS it gives me this value
    07-06-26 17:28:09,000000
    Does anyone have any idea why this happens? and more importantly how I can retrieve the timestamp again.
    Im using BEA workshop which means i dont have any means of manipulating the data before presenting to the frontend.
    The database is Oracle 9.2.0.1

    user582245,
    Please provide the following:
    1. Entire error message and stack trace you are getting.
    2. Part of your code where the error occurs.
    3. JDK version you are using.
    4. Oracle data-type of the problematic column.
    Good Luck,
    Avi.

  • Oracle Preference to Data Types

    Hi,
    Why Oracle give preference to number when stored as varchar2
    <For Example> I store a number in a Varchar2 type Column & then i do Order by that column ... than why & ho do it give preference to First -- Alphanumeric, then Second - Numeric & then .. Pure Alphabets... ..????

    AJ.M wrote:
    Example
    SELECT * FROM test_order
         ID     NAME
         1     dafdas
         2     sdf
         3     3421
         4     fdss232
         5     323gdfs
    This is in the sequence in which i have entered data.
    SELECT * FROM test_order ORDER BY 2
         ID     NAME
         5     323gdfs
         3     3421
         1     dafdas
         4     fdss232
         2     sdf
    This is in Sorted Order .... Now i want to know why & how did oracle gave preference to alphanumeric, then numeric & than complete alphabets32 is less than 34
    3 is less the d
    d is less than f
    f is less than s
    order has nothing to do with remaining characters in the strings
    Dec Hex    Dec Hex    Dec Hex  Dec Hex  Dec Hex  Dec Hex   Dec Hex   Dec Hex 
      0 00 NUL  16 10 DLE  32 20    48 30 0  64 40 @  80 50 P   96 60 `  112 70 p
      1 01 SOH  17 11 DC1  33 21 !  49 31 1  65 41 A  81 51 Q   97 61 a  113 71 q
      2 02 STX  18 12 DC2  34 22 "  50 32 2  66 42 B  82 52 R   98 62 b  114 72 r
      3 03 ETX  19 13 DC3  35 23 #  51 33 3  67 43 C  83 53 S   99 63 c  115 73 s
      4 04 EOT  20 14 DC4  36 24 $  52 34 4  68 44 D  84 54 T  100 64 d  116 74 t
      5 05 ENQ  21 15 NAK  37 25 %  53 35 5  69 45 E  85 55 U  101 65 e  117 75 u
      6 06 ACK  22 16 SYN  38 26 &  54 36 6  70 46 F  86 56 V  102 66 f  118 76 v
      7 07 BEL  23 17 ETB  39 27 '  55 37 7  71 47 G  87 57 W  103 67 g  119 77 w
      8 08 BS   24 18 CAN  40 28 (  56 38 8  72 48 H  88 58 X  104 68 h  120 78 x
      9 09 HT   25 19 EM   41 29 )  57 39 9  73 49 I  89 59 Y  105 69 i  121 79 y
    10 0A LF   26 1A SUB  42 2A *  58 3A :  74 4A J  90 5A Z  106 6A j  122 7A z
    11 0B VT   27 1B ESC  43 2B +  59 3B ;  75 4B K  91 5B [  107 6B k  123 7B {
    12 0C FF   28 1C FS   44 2C ,  60 3C <  76 4C L  92 5C \  108 6C l  124 7C |
    13 0D CR   29 1D GS   45 2D -  61 3D =  77 4D M  93 5D ]  109 6D m  125 7D }
    14 0E SO   30 1E RS   46 2E .  62 3E >  78 4E N  94 5E ^  110 6E n  126 7E ~
    15 0F SI   31 1F US   47 2F /  63 3F ?  79 4F O  95 5F _  111 6F o  127 7F DEL

  • How to Create a Table in Oracle with XML data type.

    Dear ALL,
    What are the requirements for creating a table with xml datatype in Oracle: The steps would help very much to know the scripting of the table and how to query and either insert/update and remove data from that table.
    Any help, direction, advise would be highly appreciated.
    Thanks.

    Reffer to this Note.243554.1.
    In a nut shell you will need to run catqm.sql

  • Using oracle.sql.BLOB data type in Java Class to pass in a Blob

    All,
    I'm trying to pass in a BLOB from PL/SQL to a Java Class, but the BLOB isn't passed correctly.
    When I check the length of the BLOB in PL/SQL its different from the length of the BLOB in java.
    I'm using DB 11g and the ojdbc5.jar file in my java classes.
    The java function uses the oracle.sql.BLOB type to get the parameter.
    The java class is loaded into the DB and called via a PL/SQL function.
    Kind regards,
    Nathalie

    The question is indeed a little ambigious defined ;o)
    When I pass the BLOB to the java method and invoke BLOB.getBytes() and then get the length of the BLOB in java the length of the BLOB is bigger than in PL/SQL.
    When I use the method 'getBinaryStream' and write this to a buffer, the code works.
    I will log a tar regarding the getBytes()-method to ask for more detailed information regarding the methods provided using the JDBC Drivers.
    Kind regards,
    Nathalie

Maybe you are looking for