Oracle NUMBER column retreived as System.Double instead of System.Decimal

We've been using the OleDb Managed Provider for some time now, and all oracle NUMBER datatypes have always come back from the db as System.Decimal.
we recently installed a new database, and now NUMBER comes back as System.Double. The table create scripts are the same for the new db. The client is not the issue as I can point the same web server at the old db and it works fine.
I've been unable to find any documentation on the subject.

I have the same problem also. I'm using VC++6.0 and ADO 2.71 to perform queries with an Oracle Client 9.2.0.1. The same query on same table but on different Server version returns different results. With the production server, which is an 8.1.7.4 server, a NUMBER column returns a LONG value, while on the Test server, which is a 9.2.0.5.0 server, the same column returns a DOUBLE value. The problem is that using ADO I don't check data type/size when getting values, but I aspect a LONG value because a created the column with NUMBER specification. Could this be a different default from previous server version when creating the NUMBER column without any SCALE and PRECISION attributes?

Similar Messages

  • Oracle Number and Java Format Mask Issue

    I have a oracle number column, in my view object it is of type BigDecimal and the query column type is NUMBER
    I put the following format mask in the hints section
    #####.00
    with a format type of Number,
    Yet when I run the application, I always get the following error
    java.lang.NumberFormatException: For input string: "-3750.00"
    Anyone any ideas why this does not work?
    Regards
    Orlando

    Hi,
    try with <af:convertNumber>
    See:
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_convertNumber.html
    ADF 11.1.1.4.0 af:convertNumber not working with #,##,##,##,##,##,##0.00

  • ExecuteScalar returns System.Decimal or System.Double on diff Oracle srvrs

    Hi,
    Oracle Data Provider for .NET Developer's Guide states that Oracle type NUMBER maps to .NET type System.Decimal.
    In my application I would like to retrieve value from database using simple query and OracleCommand.ExecuteScalar method. The problem is that on one database ExecuteScalar returns a value of type System.Decimal and on the other a value of type System.Double. Table creation script and C# code are shown below.
    Since I declared column as NUMBER without any precision or scale, I wonder if there is a setting that specifies default values on Oracle server? If I declare column as NUMBER(38) I get the same result (System.Decimal) on both databases. But I would not like to change table creation scripts.
    Oracle.DataAccess.dll (9.2.0.2102)
    Database 1 (returns System.Decimal)
    Oracle9i Enterprise Edition Release 9.2.0.2.0 - Production
    PL/SQL Release 9.2.0.2.0 - Production
    CORE     9.2.0.2.0     Production
    TNS for Compaq Tru64 UNIX: Version 9.2.0.2.0 - Production
    NLSRTL Version 9.2.0.2.0 � Production
    Database 2 (returns System.Double)
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE     9.2.0.3.0     Production
    TNS for Compaq Tru64 UNIX: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production
    Database scripts:
    CREATE TABLE TEST_TABLE (ID NUMBER NOT NULL) LOGGING NOCACHE NOPARALLEL;
    ALTER TABLE TEST_TABLE ADD (CONSTRAINT PK_TEST_TABLE PRIMARY KEY (ID));
    INSERT INTO TEST_TABLE ( ID ) VALUES (1);
    COMMIT;
    C# code:
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    namespace TestOracle
         class MainRun
              [STAThread]
              static void Main(string[] args)
                   if (args.Length != 1)
                        Console.WriteLine("usage: TestOracle.exe DSN");
                        return;
                   string dsn = args[0];
                   OracleConnection connection = null;
                   OracleCommand cmd = null;
                   try
                        connection = new OracleConnection(dsn);
                        connection.Open();
                        cmd = new OracleCommand();
                        cmd.CommandText = "SELECT ID FROM TEST_TABLE";
                        cmd.CommandType = CommandType.Text;
                        cmd.Connection = connection;
                        object retVal = cmd.ExecuteScalar();
                        Console.WriteLine(retVal.GetType().FullName);
                        connection.Close();
                   finally
                        if (cmd != null)
                             cmd.Dispose();
                        if (connection != null)
                             connection.Dispose();

    There was a fix on the database side that caused this behavior change but this was by design and intended. An event was also introduced as part of this fix so that this fix could be enabled or disabled on the database side. Please refer to the doc for more information.
    ODP.NET has worked around this behavior change in ODP.NET itself so that the behavior is consistent between different database versions. Next release of ODP.NET would have this work around.

  • Oracle Text, ctxsys.context problem with number column

    Hi,
    DB 11.2.0.3
    Is there any solution to create ctxsys.context index on number column ? Or I have to create other index type ?
    When I try do that (create ctxsys.context index), I get
    09:01:18  ORA-29855: wystąpił błąd przy wykonywaniu podprogramu ODCIINDEXCREATE  (An error has occurred in the performance of the subprogram)
    09:01:18  ORA-20000: Oracle Text - błąd: (- error:)
    09:01:18  DRG-10509: niepoprawna kolumna tekstowa: ITEM_TYPE (invalid text column:)
    09:01:18  ORA-06512: przy "CTXSYS.DRUE", linia 160
    09:01:18  ORA-06512: przy "CTXSYS.TEXTINDEXMETHODS", linia 366Btw, is there possible to search like "*LIKE %123%*" clause any of index (in contains) ?
    Edited by: Ndejo on 2012-11-21 00:53

    The multi_column_datastore says that the text to be indexed should be fetched from the supplied COLUMNS list rather than from the actual column the index is created on.
    So in this case we're fetching the contents of "theNumber" column, converting it to text, and indexing it.
    You don't necessarily need a dummy column, if "a_title" is a varchar column you could create the index on that instead.
    For example:
    SQL> create table mytab( a_id number, a_code number, a_title varchar2(80), a_subtitle varchar2(80), a_info clob );
    Table created.
    SQL> insert into mytab values ( 12, 9812376, 'foo is the title',
      2  'foobar is the subtitle', 'the info column will not be indexed' );
    1 row created.
    SQL> exec ctx_ddl.drop_preference( 'myds' )
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.create_preference( 'myds', 'MULTI_COLUMN_DATASTORE' )
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute( 'myds', 'COLUMNS', 'a_code, a_title, a_subtitle' )
    PL/SQL procedure successfully completed.
    SQL> create index myindex on mytab (a_title) indextype is ctxsys.context
      2  parameters ('datastore myds');
    Index created.
    SQL> select a_id from mytab where contains (a_title, '%123%') > 0;
          A_ID
            12
    SQL> select a_id from mytab where contains (a_title, 'foo') > 0;
          A_ID
            12If you want to be able to search within a particular column, then add "section group CTXSYS.AUTO_SECTION_GROUP" to the parameters clause, and you can then do:
    SQL> select a_id from mytab where contains (a_title, 'foobar WITHIN a_subtitle') > 0;
          A_ID
            12

  • Reg: Generating  custom number instead of system generated no in ME21n

    Hi Experts,
                      I need to know user exits or Badi to generate custom number instead of system generated number while saving p.o ME21n transaction.
    Regards,
    Vikram.S

    Vikram,
    Instead of doing it programatically , ypu can satisfy your requirement in configuration settings.
    check SPRO with the help of functional consultant.

  • How to disable Oracle table NUMBER column type auto round-up

    Below is an example,
    SQL> create table a
    a_col1 NUMBER(8, 2)
    SQL> update a set a_col1=1.999 where ...
    I found column 'a_col1' of table 'a' value will be 2.00, but the application is for some financial calculation and doesn't allow any difference of the amount value (like, 1.999 <> 2.00), what I want to achieve is to disable the Oracle NUMBER type auto round-up and make above 'update' SQL fail with error, so I can trap the error and handle it in the program.
    Could anyone advise me how to achieve above or any good suggestion ? Thanks.

    user12317666 wrote:
    Below is an example,
    SQL> create table a
    a_col1 NUMBER(8, 2)
    SQL> update a set a_col1=1.999 where ...
    I found column 'a_col1' of table 'a' value will be 2.00, but the application is for some financial calculation and doesn't allow any difference of the amount value (like, 1.999 <> 2.00), what I want to achieve is to disable the Oracle NUMBER type auto round-up and make above 'update' SQL fail with error, so I can trap the error and handle it in the program.
    Could anyone advise me how to achieve above or any good suggestion ? Thanks.Oracle does not auto-round.
    you have data presentation problem; not data storage problem.

  • In XML Output the values of Number column tags are not displayed properly

    Hi,
    Our Client have been using AR Invoice Print Program for a long time and it is heavily customized. Also they are using an old version of the RDF. So we have taken the latest version of the RDF (RAXINV.rdf) for Oracle Apps 11.5.10.2 by raising a SR and implement Client's old RAXINV.rdf into it.
    All was ok, but when we are running the program, the XML Output did not generate properly. For the Q_INVOICE query (G_ORDER_BY, G_INVOICE and G_INV_TERM group), the value of some of the scaler number columns are not appeared properly. The tags are coming correctly, but the value is appearing as '*', instead of the correct value. We have checked in the RDF Level (By putting srw.message and check in the log file) that those columns are having proper value. So there is no issue with the RDF.
    But because of the above mentioned problem, the some of the PDF output field values also is not generated correctly.
    I think that because of the lexical parameters which was implementing the Q_INVOICE query (&COMMON_QUERY) this issue is coming. Because the issue is only in the Q_INVOICE query group (G_ORDER_BY, G_INVOICE and in G_INV_TERM group) not in any other query group.
    There is no problem with the scaler character columns. The issue is only with the number columns.
    Also we have checked that if we hardcode the value of the number columns in the above mentioned lexical parameter, this problem doesn't appear.
    If we put TO_CHAR function to those number columns in the lexical parameter (COMMON_QUERY), then this issue get solved. But we can't do it because of performance issue and also Client won't approve it.
    Please help.
    With Thanks and Regards

    I don't know how to read the code you pasted or I would have checked this myself.
    Do your fields in the internal table reference dictionary objects or elementary types? If not using dictionary types, the column names will be blank by default. If you can't change your fields to be dictionary types, you can try this to change the column names:
    I made a method inside my local class to add the names:
            call method set_colname
              EXPORTING iv_tab = alv_tab
                        iv_colid = 'xxxx'  "fieldname from the table
                        iv_stxt = text-t54
                        iv_mtxt = text-t55
                        iv_ltxt = text-t55.
    METHOD set_colname .
      data:
              alv_cols type REF TO cl_salv_columns_table,
              alv_col type REF TO cl_salv_column.
      TRY .
    *... Change fieldnames
            call METHOD iv_tab->get_columns RECEIVING value = alv_cols.
            call method alv_cols->get_column EXPORTING columnname = iv_colid RECEIVING value = alv_col.
            IF iv_stxt <> ''.
              CALL METHOD alv_col->set_short_text EXPORTING value = iv_stxt.
            ENDIF.
            IF iv_mtxt <> ''.
              CALL METHOD alv_col->set_medium_text EXPORTING value = iv_mtxt.
            ENDIF.
            IF iv_ltxt <> ''.
              CALL METHOD alv_col->set_long_text EXPORTING value = iv_ltxt.
            ENDIF.
       CATCH cx_salv_not_found.
      ENDTRY.
    ENDMETHOD. "set_colname

  • Strip Oracle Number from error message!

    Hi All,
    I am raising error messages in my application but I want to be able to strip off the Oracle number form the error message.
    The system may pass back an error message like:
    ORA-00900: invalid SQL statement
    I would like to pass back "invalid SQL statement" instead of "ORA-00900: invalid SQL statement"
    It is possible to do this?
    Can it be striped off from the source where it is raised like in the procedure
    From here:
    Err_Handler.RAISE(l_ErrorNum);
    Or it it better to strip it off in the asp.net code when I call:
    ex.Message
    Thanks in advance, your help will be much appreciated.

    Careful consideration should be given to removing the error number from the message.
    If you have an application that throws up just an error message when the user does something then they are going to report this error to the system administrator. Users being users will no doubt get the wording wrong when they report it, and that possibility also exists when the system admin reports it back to the developers. By the time it gets to the developer to look at, they have some sketchy message about what went wrong and then they're expected to know what that error is. Without the exact description of the message and without the error number, tracking down the exact error that occurred becomes more difficult. With the error number, the original user only has to report that number, which is less likely to get corrupted on the way to the developer, and is far easier to look up what the error was and how to go about fixing it. It may not appear user friendly, but it's sure as hell developer friendly.
    ;)

  • Concurrency exception because of number columns

    Hi,
    When fill a DataSet with Number columns that are not expressable by a double (whithin .NET), because of to much decimals behind the '.'
    DataAdapter can't update this row when implementing optimistic concurrency:
    UPDATE ... WHERE IDcol=idval AND ora_number_col=dotnet_double_val
    Is there a way to arrange the different resolution without rounding functions in the where clause?
    Thanks,
    Michael

    Michael,
    Are you asking about this?
    The ODP.NET OracleDataAdapter provides the Safe Type Mapping feature because the following Oracle datatypes can potentially lose data when converted to their closely related .NET type:
    NUMBER
    DATE
    TimeStamp (refers to all TimeStamp objects)
    INTERVAL DAY TO SECOND
    Sinclair

  • Is there any deifference between a normalindex on number column and varcahr

    is there any deifference between a normalindex on number column and varcahar column?Also can somebosy provide a link tome which gives gud description as to how indexes are stored,their structure and how they enable faster retreival?

    Hi
    There is not difference between an index created on a number of varchar2 column.
    http://download.oracle.com/docs/cd/E14072_01/server.112/e10713/indexiot.htm#i5671
    HTH
    Chris Antognini
    Troubleshooting Oracle Performance, Apress 2008
    http://top.antognini.ch

  • Composite Studio - return row number column

    Hi, I’m trying to include a row number column in my result set in Composite Studio (SQL Scratchpad), however I’m getting various error messages such as the below.  Is there any way to add a row number?
    An internal error has occurred.
    Cause: analytical function ROW_NUMBER is not supported natively.
    com.compositesw.cdms.webapi.WebapiException: An internal error has occurred.
    Cause: analytical function ROW_NUMBER is not supported natively.
     analytical function ROW_NUMBER is not supported natively.
     at com.compositesw.cdms.webapi.PrefetchCursor$LoadPipeThread.run(PrefetchCursor.java:273)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:662)
    Caused by: analytical function ROW_NUMBER is not supported natively.
     at com.compositesw.server.qe.QueryResult.next(SourceFile:311)
     at com.compositesw.cdms.webapi.PrefetchCursor$LoadPipeThread.run(PrefetchCursor.java:253)
     ... 3 more
    Caused by: java.lang.IllegalArgumentException: analytical function ROW_NUMBER is not supported natively.
     at com.compositesw.server.qe.physical.util.FunctionExecutor.initialize(SourceFile:232)
     at com.compositesw.server.qe.physical.util.FunctionExecutor.next(SourceFile:379)
     at com.compositesw.server.qe.physical.operator.FunctionNode.next(SourceFile:197)
     at com.compositesw.server.qe.topology.SelectPTree.nextInternal(SourceFile:399)
     at com.compositesw.server.qe.topology.SelectPTree.next(SourceFile:378)
     at com.compositesw.server.qe.QueryResult.next(SourceFile:295)
     ... 4 more
     at com.compositesw.cdms.webapi.WebapiException_SOAPSerializer.doDeserialize(WebapiException_SOAPSerializer.java:58)
     at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:209)
     at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:172)
     at com.compositesw.cdms.webapi.service.WMetaDataSvc_dataset_fetch_Fault_SOAPSerializer.deserializeDetail(WMetaDataSvc_dataset_fetch_Fault_SOAPSerializer.java:54)
     at com.sun.xml.rpc.encoding.SOAPFaultInfoSerializer.doDeserialize(SOAPFaultInfoSerializer.java:151)
     at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:209)
     at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:172)
     at com.compositesw.cdms.webapi.service.WMetaDataSvc_Stub._readBodyFaultElement(WMetaDataSvc_Stub.java:23530)
     at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:238)
     at com.compositesw.cdms.webapi.service.WMetaDataSvc_Stub.dataset_fetch(WMetaDataSvc_Stub.java:14247)
     at com.compositesw.cdms.webapi.WDataset$FetcherThread.run(WDataset.java:273)
    Version Information: Studio 6.2.5.00.32 (hotfix), Build ID 131217-101258-0800-72550, Server 6.2.5.00.32 (hotfix)

    Hi Tom,
    I think you intended your question for the other DV community here:  https://supportforums.cisco.com/community/12298251/cisco-data-virtualization
    Although our parser allows the syntax of these analytic functions such as ROW_NUMBER to be submitted to us from a client, our query engine is not capable of processing it locally.
    It is up to the user to ensure the resulting query plan will push the sql containing that function down to the external db (ie; oracle) to be processed there instead.  Creating the query from inside a view will provide the ability to see the resulting query plan.
    Which customer (company) are you with?  If you need further assistance, I recommend you log a support case with Cisco.
    Thank you,
    Brad

  • How to edit the "Oracle Three Column Layout" page template?

    Hello all,
    My question is very simple: how can one edit the Oracle Three Column Layout page template? I tried searching the file system for a file called "threeColumnTemplate.jspx" but I cannot seem to find it. Is it hidden into a jar file of some kind? Or at least can anyone tell me the name of the nice component located in the upper right corner that displays the loading activity?
    Thanks.

    Extract oracle-page-templates.jar with winzip & browse to location oracle/templates
    open the file threeColumnTemplate.jspx using jdeveloper.
    after you open it , you can edit the logo , save the changes & create this jar again or save it to the zip which will automatically update the jar.

  • System build-in or system variable to get number of records from a query

    Hi,
    Is there a system build-in or system variable to get number of records from a Oracle Forms query?
    Thank you

    Namely, when GO_BLOCK(BLOCK_NAME) EXECUTE QUERY finishes, is there a way directly get the number of the records?
    SYSTEM.COURSOR_RECORD = 1 tells this is the first record
    SYSTEM.LAST_RECORD = 'TRUE' tells this is the last record
    Thanks

  • QBE Error when query by String for Number column

    Hi,
    I have a table with Number column.
    The column structure is like below:
    <af:column>
    <af:inputText>
    <f:validator .../>
    <af:converNumber ..../>
    </af:inputtext>
    </af:column>
    QBE is enabled for this column.
    It works fine when query by Number value, such as '123'. But when I query by string like 'asd', it will return an error.
    Anyone met this problem?

    Hi Arun,
    I am using Jdev 11.1.1.7.0.
    In my case,
    I have a application table, from where user can create new row inline. Some fields in the row have type Long or Number. We are also using <af:converNumber ..../> inside <af:inputText> to do format.
    I do have a query panel above the table. But we want the user can also filter the records using QBE. Other columns are working fine, except the columns with type 'Number' or 'Long'.
    I checked the incident log, below are some useful information:
    Caused by: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
    Caused by: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT ... FROM ... WHERE ... AND ( ( (MeaRulesEO.DEFAULT_MEA_PERIOD = :vc_temp_1 ) ) )
    It seems 'MeaRulesEO.DEFAULT_MEA_PERIOD = :vc_temp_1' causes the error. Jdev assumes every input from QBE header as number. If String is entered, Jdev will return error.
    I also checked that if the table is read-only, this problem does not exist.
    Please help on this. Thank you.

  • ODI 10g: NUMBER column becomes NUMBER(22,0) on reverse

    ODI Version: 10.1.3.6.3
    Database Version: Oracle 10g (also seen in XE)
    In the database, one of the columns in the table is defined as "num_val NUMBER". It has been defined this way to accomodate for decimals also. However, when I reverse this to my ODI model using the "Selective Reverse" the column gets created as "num_val NUMBER(22, 0)" due to which the decimals have got truncated.
    I would like to know if this is an ODI bug (if yes, please point me to the patch) or the developer is expected to manually look and correct this in the ODI model ?
    In Oracle database, defining a number column without precision & scale would designate maximum precision & scale to the column. I would expect that ODI should be aware of this during model reverse and create the column with maximum range as it exists in the Oracle database.
    Edited by: museshad on Feb 7, 2011 12:28 PM

    Hi,
    Good to know ur problem is solved.
    Yes as i said, RDBMS reversing can be carried out by Standard method but in some cases ODI and JDBC drivers compatibility doesn't pull certain tables/views/data types etc and MOS declare it as a BUG.
    So in those cases its suggested/advised to use RKM mode of reversing as a "work around" option.
    But in general real time scenario RKM, is dedicated to reverse the meta data of adapters applications say Hyperion, essbase,planning, HFM etc and standard for any ANSI SQL/RDBMS applications.
    Makes sense?
    Thanks,
    Guru

Maybe you are looking for

  • IWeb won't let me publish using MobileMe

    I am logged into the MobileMe account. I have 287 days left in my account. Two weeks ago when I made changes to my website, I clicked publish to update the website. All worked. Just made changes and when I pressed Publish, I get a MobileMe advertisem

  • Did not receive Dying Light Pre-order DLC for PS4

    I have read the terms of the DLC and the delays to receiving it, but I am worried as some people seemed to have gotten their codes already whether it was via email or receipt without a problem if they did an in store pre-order with the Dying Light pr

  • Inbound plug error in so_basket

    Hi         we are getting inbound plug error in so_basket. it is working in  one client, but it is not working in other testing  client.  do any body have idea about this inbound plug error. regards ram

  • Problema de licenciamiento Photoshop CC

    Hola, me he suscrito a Adobe Cloud y ya he instalado Lightroom. He instalado Photoshop CC pero, al ejecutarlos, salia sin dar error. Mirando los foros encontré una solución (Login y Loguot de Cloud) Despues de hacer esto me pide mi ID y me dice que y

  • Layout resizing confusion

    After having worked a bit with the various layout components in JavaFX, what confuses me most is how to consistently get a child node to resize itself to fill the entire width or height (or both) of the parent node. Sometimes it does, and sometimes i