OracleCommandBuilder create InsertComman with wrong parameters

I have a simple table:
CREATE TABLE test_b (a NUMBER);
Then I create command for inserting data to this:
DbProviderFactory factory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client");
using (DbConnection connection = factory.CreateConnection())
connection.ConnectionString = "User Id=apolyakov;Password=oracle;Data Source=OPE";
connection.Open();
using (DbDataAdapter adapter = factory.CreateDataAdapter())
adapter.SelectCommand = connection.CreateCommand();
adapter.SelectCommand.CommandText = "select * from test_b";
using (DbCommandBuilder builder = factory.CreateCommandBuilder())
builder.DataAdapter = adapter;
using (var command = builder.GetInsertCommand())
command.Parameters[0].Value = 1;
command.ExecuteNonQuery();
ExecuteNonQuery throw OracleTruncateException "truncated result".
System: ODAC 11.1, .NET 2.0, WinXP, Database 10g2

I've encountered the exact same problem. The issue seems to be with inserting into a column of type "NUMBER". Despite the fact that System.Decimal is actually a smaller type, and there's no danger of truncation, the Update command of OracleDataAdapter seems to be unable to handle this conversion.
What's worse, even if you convert the column in the datatable and all the data to Oracle.DataAccess.Types.OracleDecimal, the result is the same. Right now OracleDataAdapter.Update seems hopelessly broken for inserting into NUMBER columns.
.NET 4.0 Oracle 11g
Edited by: 903858 on Dec 21, 2011 1:16 PM
Edited by: 903858 on Dec 21, 2011 1:18 PM

Similar Messages

  • Create table with storage parameters in a locally managed tablespace

    Hi,
    Can we create object with storage parameters in a locally managed tablespace.
    CREATE TABLE my_hash_table_6 (
    name VARCHAR2(30),
    value VARCHAR2(4000) )
    STORAGE (
    INITIAL 1M
    NEXT 512K
    PCTINCREASE 0
    MINEXTENTS 2
    MAXEXTENTS UNLIMITED )
    users default tablespace is locallly managed.
    Then this table's extent management will be managed as per the tablespace or as the storage parameters which
    were specified at the time of table creation.

    Why don't you try it yourself ?
    TEST@db102 > select * from dba_tablespaces
      2  where TABLESPACE_NAME='USERS';
    TABLESPACE_NAME                BLOCK_SIZE INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS
    MAX_EXTENTS PCT_INCREASE MIN_EXTLEN STATUS    CONTENTS  LOGGING   FOR EXTENT_MAN
    ALLOCATIO PLU SEGMEN DEF_TAB_ RETENTION   BIG
    USERS                                8192          65536                       1
    2147483645                   65536 ONLINE    PERMANENT LOGGING   NO  LOCAL
    SYSTEM    NO  AUTO   DISABLED NOT APPLY   NO
    TEST@db102 > CREATE TABLE my_hash_table_6 (
      2  name VARCHAR2(30),
      3  value VARCHAR2(4000) )
      4  STORAGE (
      5  INITIAL 1M
      6  NEXT 512K
      7  PCTINCREASE 0
      8  MINEXTENTS 2
      9* MAXEXTENTS UNLIMITED )
    TEST@db102 > /
    Table created.
    TEST@db102 > select * from user_segments
      2  where segment_name='MY_HASH_TABLE_6';
    SEGMENT_NAME
    PARTITION_NAME                 SEGMENT_TYPE       TABLESPACE_NAME
         BYTES     BLOCKS    EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS
    MAX_EXTENTS PCT_INCREASE  FREELISTS FREELIST_GROUPS BUFFER_
    MY_HASH_TABLE_6
                                   TABLE              USERS
       2097152        256          2        1572864                       1
    2147483645                                         DEFAULT
    TEST@db102 >

  • When importing, creates folder with wrong date

    I found a curious bug in Lightroom 4.2.
    If I have pictures taken after 23:00, Lightroom creates an import folder in the next day, but the dates in the files are correct.
    Example:
    The file's date is: 29/11/2012 23:19.
    However if I hover my mouse over the image in the import dialog:
    The date that appears is 30/11/2012 00:19. Here's the detail:
    After you import, you get the image in the wrong import folder, but the meta on the image is correct:
    I've started to notice this before, but always thought of a wrong date on my camera. Just noticed that this happens with my camera, iPhone, and any other photo that has a time after 23:00.
    Do you know if there is a solution for this?
    Thank you in advance,
    Manuel Azevedo

    Does your computer time match with your camera time? Summer-/winter-time apart?
    The reason, why I am asking this: the map module auto-assumes that these times match (rather than asking you in which UTC-time zone your image time stamps should be interpreted when tagging from a gpx-track).
    Could be that something similar is happening in import module if you let LR auto-create destination folders based on date-time.
    I have no experience with this as I prefer to explicitely give the names of the new destination folders myself.
    Cornelia

  • Installation using a virtual host created .dbenv with wrong hostname

    Discovered that during the installation of a Solution Manager on Solaris that the .dbenv_<hostname>.sh and .dbenv_<hostname>.csh and were created with <hostname> = Virtual name. However the .profile uses the 'hostname' to determine which .dbenv to use. Since 'hostname' returns the actual server name and not the virtual name the db environment is not set.
    This is easily resolved by renaming the .dbenv to the actual host name. My concern and question is whether this will cause me issues down the road and also I cannot seem to find anyone else or SAP note that reflects this issue.
    Please advise...Thanks...
    David

    Hello David
    We always install using virtual hostnames here, using seperated ip addresses (physical host X with IP Y and virtual host S with IP T) using sapinst option SAPINST_USE_HOSTNAME=<shortname virtual hostname> and we have those profiles with the virtual hostname after installation.
    Kind regards
    Tom

  • User home directories create but with wrong permissions

    Create user in OD.
    User account shows up in the assigned Users directory, but with owner root and group admin. Users is on an Xsan volume. I get this in the log:
    Nov 13 20:49:18 fsserver2 DirectoryTools[341]: copyDirectory(en, /Network/Servers/fsserver2.xxxxxxxx.com/Volumes/uservol/Users/mondtruong) failed with 1
    Anyone?

    Seems that this is only set at the Root folder, sub folders have the following.
    This partly answers my question, but how can I see what those "custom" levels are.
    I will be wanting to move my Home folder to another drive and want to make sure the permissions are set so that only the authorized user has access, without causing any issues with system access. So need to make sure I have all the permissions set right.
    Thoughts?

  • PO created with wrong Company code

    Hi Gurus,
    I have Plant XXXX assigned to Company code 1111 and
             Plant YYYY assigned to Company code 2222
    One of the user has created PO with Plant XXXX and company code wrong as 2222.
    (we have warning message setup & not error message. So, it allowed user to create PO with wrong Company code and save)
    GR & IR both are already posted. I find the accounting document of these GR/IR show correct company code as XXXX-1111 (mostly would have taken correctly based on plant XXXX).
    These are service POs (non stock).
    Now user wants to change the company code in PO to 1111.
    I checked...and system simply allow to change to company code to correct one i.e 1111. It does not give any message.
    Could any one give me some additional info.. if it is right to do so? I am not too convinced at this moment.
    I was suggesting user to reverse GR, IR, delete PO and create new PO. Is that right?
    Thanks n advance for your input.
    Best Regards,
    Mohan

    Dear Mohan,
    U can change the company code in PO as it will not have any impact since the GR and IR is completed.
    Accounts are hit based on the valution area(valuation grouping code).
    Since the PO is already closed u can go ahead the change the same.
    Regards,
    AM Vahanan

  • "Source not found" Error creating URL Data control with query parameters

    Hi,
    I have a restful service for which i want to create a URL data control. I am able to create the URL data control successfully when i am not passing any parameters in the Source field. But if i am specifying the parameters in the source field like this Department=##ParamName##, something weird is happening. After giving the param string in the Source field, it asks for default param value to test the url. It tests the url successfully. After that i select XML as the data format in which i am mentioning the xsd like this . "file:///C:/..../something.xsd" . And this is when i am getting the error. "Invalid Connection. The source is not found". I am giving exactly same path for xsd which i gave while creating URL data control without query parameters. Infact i was able to create the URL data control with query parameters successfully till afternoon. after that it started giving me this error all of a sudden. Infact as soon as i was able to create a URL data contol with query parameter successfully, i took a backup of the application before moving further. But even that backup is not working now.
    As far as i understand, i dont think there will be any change in xsd if query params are passed to a web service. Please correct me if i am wrong.
    Just dont know what could be the issue. Please help
    Thanks

    Hi,
    xsd is used for the URL service to know what the returned data structure is so it can create the ADF DC metadata
    Frank

  • SRM PO created with wrong company code

    Hello,
            The users have created several PO in SRM with wrong company code. The user was found in the wrong organization structure during the creation of shopping and approval. The PO did not get transfer to the Back because of this. Is there a way to modify the PO and change the company code.
       In case we want to modify it in the tables given that BBP_PD gives you an indication of which table and entry to modify, is there a way to do this operation (like SE16N in ECC)? Have you ever done this and what risk is their in such an operation.
    Thank you.

    Hi,
    I doubt anyone here will (or will dare) suggesting to you how to do it as it is against SAP practise totally. if the document is created wrongly, it should be deleted and approved with all the tracking and changes in place for auditing purposes.
    Frankly that is what you should practise as well.. my 2cents opinion.
    Regards.
    YS

  • Balance carryforward is not correct due to incorrect GL created with wrong

    Hi team,
    We have created two gl accounts with wrong account group which is balance sheet and also made an postings to that gl account after year end process done so correcting this issue, now we have transferred that amount to new gl account which is p&l account and also we have executed FAGLGVTR (carry forward trasaction)but the amount is not reflecting in retained earning account so pls let me know solution for this issue.
    Thanks
    SAP

    Dear Seshu,
    You can Transfer the Retained earnings account balance to a new GL account for Retained earnings. And mark the previous account for mark for deletion / not to use and hence no postings will be allowed in the future to that GL account. And now you can carryforward normally in the future years use.
    Regards,
    Shankar K B.

  • Create custom document with wrong size

    Hi,
    I have a problem (on Sun Solaris 5.8) when I create custom document with more than 10MB size.
    I've created an agent which detects the events on a custom data type
    MYDOCUMENT (extension .mydoc).
    When I put a new document test1.mydoc (size of 10MB for example), my agent detects the new document, creates a copy, sets the class object to
    MYDOCUMENT , removes the original document and puts the copy into the same folder.
    But sometimes, the copy created has a wrong size (less then 10MB).
    How can I configure the nfs server to be sure that the agent waits for the complete size of the added document.
    I need HELP !!!!
    Thanks

    Hi Pavithra,
                    yeah you can create your custom table by entering fields in Standard.  for more details
    refer below screen shots
    Regards,
      Thangam.P

  • Is it possible to create views with parameters ?

    Hi,
    As MS-Access, is it possible to create views with parameters ?
    Ms-Access syntax : parameters [a] text; select * from table where code = [a]
    If yes, can you give samples ?
    Regards
    Pascal

    I suggest you you write a stored procedure that returns a recordset in oracle. Then execute the stored procedure and loop through the record set.
    Look in in MS Knowledgebase searching on ADO Stored Proceedures for the VB/C++/VBS .. code.
    Look in in Oracle PL/SQL guide for the Stored Proceedure code.

  • How I can create view with parameters?

    I have very big query (2000 rows) and 2 parameters.
    How I can create view with parameters?

    If I use this small part of my query than I have error :
    java.lang.NullPointerException
         at oracle.javatools.db.ora.OracleSQLQueryBuilder.buildQuery(OracleSQLQueryBuilder.java:199)
         at oracle.javatools.db.ora.OracleSQLQueryBuilder.buildQuery(OracleSQLQueryBuilder.java:147)
    What does it means?
    select
    ' Payroll ' as Revenue
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and ( nvl(a.scode, 0) between 60000 and 6009000 )
    union all ---------------------------------------------------------------------------------------------------------------------------------
    select
    ' Payroll Taxes '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    (nvl(a.scode, 0) between 60100 and 60690 )
    union all -------------------------------------------------------------------------------------------------------------------------------
    select
    ' Workers Comp/Disability '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    ( nvl(a.scode, 0) between 61200 and 61260)
    union all -------------------------------------------------------------------------------------------------------------------------------
    select
    ' Pension and Hospitalization '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    ( nvl(a.scode, 0) between 61000 and 61550 )
    union all -------------------------------------------------------------------------------------------------------------------------------
    select
    ' Other Labor Costs '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    ( nvl(a.scode, 0) between 616000 and 616400 )

  • I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    Welcome to the 'wonderful' world of HTML5 e-learning.
    In my view, from the issues I am seeing everywhere, HTML5 output from rapid e-learning tools such as Captivate is not ready for the kind of mobile device e-learning you want to develop.
    Sorry to be pessimistic, but you may need to consider going back to the drawing board and coding it from the ground up.

  • Invoice created with wrong net values at header & item

    Hi Guys
    Due to a wrong user exit, system created few invoices with wrong net values at header & item.
    Now system does not allow to cancel those billing documents, showing error message - inconsistency in data.
    Eg:  Billing Header net value is 10000
           Billing Item net value is 5000
    when I try to cancel this billing document, cancellation document created with header net value as 5000 & item net value also 5000.  So, it says original invoice & cancellation invoice having different values.  It is not possible to cancel.
    Please suggest me how to correct wrong values at original invoice, which are already released to Accounting.  Or else, how to cancel those kind of invoices.
    Thanks in Advance
    Regards
    Uma

    Hi,
    In the original invoice and cancellation invoie is created there is a difference in 5000. It will not allow further cancellation of the invoice because it is already cancelled. I don't know whether there is anyway to reverse the cancellation invoice document.
    If it is there then reverse the cancel invoice document and create an invoice correction request document (RK)
    Try to replicate the scenario in your test system.
    Prase

  • How to create messages with parameters In ADF model.

    In ADF model, How to create messages with parameters?

    To Create messages in message bundles with parameters, perform the steps as given below
    Scenario: To Create a message as "Department Name XXXXXXX is already existing "
    Step#1: For the given entity object “DepartmentEO”, Go to “overview” tab and click “Business Rules” finger tab.
    Step#2: Select “Entity Validators” in the list & click “+” to add a new entity level validation rule.
    Step#3: Now go to “Failure Handling” tab, and click the Magnifier Icon.
    Step#4: Now in the “Display Value” field, enter the message with flower-braces as below.
    Department Name {department_name} is already existing
    Step#5: Also modify the Key & Description fields as needed. And click “Save and Select” button.
    Step#6: Now go to “Token Message Expressions” section, double-click the Expression field corresponding to "department_name" & give the relevant Attribute names say "DepartmentName"
    Step#7: Now click “OK”.

Maybe you are looking for