Incorrect data value when insert into oracle table

Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that,  the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.

user11432758 wrote:
Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that,  the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.
implicit datatype conversion to NUMBER can result in leading zero to be eliminated.
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002

Similar Messages

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • Loading data from .csv file into Oracle Table

    Hi,
    I have a requirement where I need to populate data from .csv file into oracle table.
    Is there any mechanism so that i can follow the same?
    Any help will be fruitful.
    Thanks and regards

    You can use Sql Loader or External tables for your requirement
    Missed Karthick's post ...alredy there :)
    Edited by: Rajneesh Kumar on Dec 4, 2008 10:54 AM

  • Best Practice to fetch SQL Server data and Insert into Oracle Tables

    Hello,
    I want to read sqlserver data everry half an hour and write into oracle tables ( in two different databases). What is the best practice for doing this?
    We do not have any database dblinks from oracle to sqlserver and vice versa.
    Any help is highly appreciable?
    Thanks

    Well, that's easy:
    use a TimerTask to do the following every half an hour:
    - open a connection to sql server
    - open two connections to the oracle databases
    - for each row you read from the sql server, do the inserts into the oracle databases
    - commit
    - close all connections

  • NULL values are inserted into interface table for read only columns

    Hi, I developed a custom Integrator where some of the columns has to be displayed as read only in the layout. I am using SQL content to populate the data. When I upload the data NULL values are inserted into table interface? Is there any work around for this?
    Thanks
    Edited by: user593879 on Jan 12, 2010 7:21 PM

    Doesn't WebADI drive you insane at times?
    I must say, when it's all working it looks great and it is very user friendly (end-user that is, NOT for developers!) but before you get to that stage… please please Oracle invest some time making Web ADI a bit more logical an coherent, get the obvious bugs out, please let us not have to update BNE tables anymore to get things done.
    Anyway, I sorted this one out by setting the Width to zero (0) in the Layout. HTH.

  • Can select, but cannot insert into oracle tables using php.

    I am having trouble inserting data into a tables in oracle using PHP. I can insert into the tables using baninst1, but nothing else. I can't even insert using the tables' owner. Every time I try I get the ORA-00492 error of table or view does not exist. However, I can run a select statement just fine. So far, baninst1 is the only user that can actually do inserts. I've triple checked all the table grants and everything is fine. Also, I can copy/paste the exact insert statement into SQL*Plus and it works with the correct user. It doesn't have to be baninst1. I've tried everything I can think of. I've tried putting the table name in quotes, adding the schema name to the table, checking public synonyms, but everything appears to be ok. I would greatly appreciate any suggestions others may have.
    I'm using PHP 5.2.3 with an oracle 9i DB.

    Here is the code that doesn't work. It works only with baninst1, no other username will work and all I do is change the my_username/my_password to something different. This is one example function where I try to do an insert, but it doesn't work on any of the tables I try.
    Thanks for looking.
    class Oracle {
         private $oracleUser = "my_username";
         private $oraclePassword = "my_password";
         private $oracleDB = "MY_DB";
         private $c = null;
         function Connect() {
              if ( !($this->c = ocilogon( $this->oracleUser, $this->oraclePassword, $this->oracleDB ) ) )
                   return false;
              return true;
         function AddNewTest($testName, $course, $section, $term, $maxAttempts, $length, $startDate, $startTime, $endDate, $endTime)
              $result = "";
              if( $this->c == null )
                   $this->Connect();     
              $splitIndex = strpos($course, " ");
              $subjectCode = substr($course, 0, $splitIndex);
              $courseNumber = substr($course, $splitIndex + 1);
              $insertStatment = "insert into szbtestinfo(szbtestinfo_test_name,
                                                                szbtestinfo_course_numb,
                                                           szbtestinfo_section,
                                                                szbtestinfo_max_attempts,
                                                                szbtestinfo_length_minutes,
                                                                szbtestinfo_start,
                                                                szbtestinfo_end,
                                                                szbtestinfo_id,
                                                                szbtestinfo_subj_code,
                                                                szbtestinfo_eff_term)
                                                                values( '" . $testName .
                   "', '" . $courseNumber .
                   "', '" . $section .
                   "', " . $maxAttempts .
                   ", " . $length .
                   ", to_date('" . $startDate . " " . $startTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", to_date('" . $endDate . " " . $endTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", szsnexttest.nextval" .
                   ", '" . $subjectCode .
                   "', '" . $term . "')";
              //return $insertStatment;
              $s = OCIParse($this->c, $insertStatment);
              try
                   $result = OCIExecute($s);
              catch(exception $e)
              return $result;
         }

  • How to read ecel sheet and insert into oracle table

    hi all,
    am working on forms builder 6i. and i want , from a trigger to read from a a sheet excel file the data and insert into a table that i had aleady created.
    i whrite a code that can till now open the excel file but i cant read the data to insert it into the table.
    am using TEXT_IO.IS_OPEN to open the file
    TEXT_IO.GET_LINE to take each line
    and subst(x as variable) to read the first line , but the subsrt return nohing
    any solution??

    There's already a topic made on this: how to copy data from excel to oracle forms

  • Using Oracle Forms Importing Data From SQL Server into Oracle Tables.

    Dear All,
    We are using Oracle Forms 10g in windows XP and having OAS 10g and Oracle database 9i.
    How can we import data from SQL Server 2005 into Oracle tables using Oracle Forms?
    Thanks & Regards
    Eidy

    I have no idea what "Oracle Hetrogenius Services" is, so I can't help you with that, sorry.
    SQL Developer might also assist you. SQL Developer can connect to SQL Server as well as Oracle and has some tools for migration. See the documentation for details:
    http://download.oracle.com/docs/cd/E12151_01/doc.150/e12156/toc.htm
    For additional help on using SQL Developer for this task, please consult Support or the SQL Developer forum: SQL Developer
    Hope this helps,
    Jacob

  • SQL Query produces different results when inserting into a table

    I have an SQL query which produces different results when run as a simple query to when it is run as an INSERT INTO table SELECT ...
    The query is:
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      The INSERT INTO code:
    TRUNCATE TABLE applicant_summary;
    INSERT /*+ APPEND */
    INTO     applicant_summary
    (  account_number
    ,  main_borrower_status
    ,  num_apps
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      When run as a query, this code consistently returns 2 for the num_apps field (for a certain group of accounts), but when run as an INSERT INTO command, the num_apps field is logged as 1. I have secured the tables used within the query to ensure that nothing is changing the data in the underlying tables.
    If I run the query as a cursor for loop with an insert into the applicant_summary table within the loop, I get the same results in the table as I get when I run as a stand alone query.
    I would appreciate any suggestions for what could be causing this odd behaviour.
    Cheers,
    Steve
    Oracle database details:
    Oracle Database 10g Release 10.2.0.2.0 - Production
    PL/SQL Release 10.2.0.2.0 - Production
    CORE 10.2.0.2.0 Production
    TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    Edited by: stevensutcliffe on Oct 10, 2008 5:26 AM
    Edited by: stevensutcliffe on Oct 10, 2008 5:27 AM

    stevensutcliffe wrote:
    Yes, using COUNT(*) gives the same result as COUNT(1).
    I have found another example of this kind of behaviour:
    Running the following INSERT statements produce different values for the total_amount_invested and num_records fields. It appears that adding the additional aggregation (MAX(amount_invested)) is causing problems with the other aggregated values.
    Again, I have ensured that the source data and destination tables are not being accessed / changed by any other processes or users. Is this potentially a bug in Oracle?Just as a side note, these are not INSERT statements but CTAS statements.
    The only non-bug explanation for this behaviour would be a potential query rewrite happening only under particular circumstances (but not always) in the lower integrity modes "trusted" or "stale_tolerated". So if you're not aware of any corresponding materialized views, your QUERY_REWRITE_INTEGRITY parameter is set to the default of "enforced" and your explain plan doesn't show any "MAT_VIEW REWRITE ACCESS" lines, I would consider this as a bug.
    Since you're running on 10.2.0.2 it's not unlikely that you hit one of the various "wrong result" bugs that exist(ed) in Oracle. I'm aware of a particular one I've hit in 10.2.0.2 when performing a parallel NESTED LOOP ANTI operation which returned wrong results, but only in parallel execution. Serial execution was showing the correct results.
    If you're performing parallel ddl/dml/query operations, try to do the same in serial execution to check if it is related to the parallel feature.
    You could also test if omitting the "APPEND" hint changes anything but still these are just workarounds for a buggy behaviour.
    I suggest to consider installing the latest patch set 10.2.0.4 but this requires thorough testing because there were (more or less) subtle changes/bugs introduced with [10.2.0.3|http://oracle-randolf.blogspot.com/2008/02/nasty-bug-introduced-with-patch-set.html] and [10.2.0.4|http://oracle-randolf.blogspot.com/2008/04/overview-of-new-and-changed-features-in.html].
    You could also open a SR with Oracle and clarify if there is already a one-off patch available for your 10.2.0.2 platform release. If not it's quite unlikely that you are going to get a backport for 10.2.0.2.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Parsing XML file & insert into Oracle Tables

    Hi,
    Following is a sample xml file which is an input for a oracle procedure :
    <Sales ID="1" CreatedDate="16-Jan-2007" CreatedTime="16:09:40">
    <Customer ID="1" Name="Scott" Address="City1">
         <Order ID="1" Date="15-Jan-2007" TotItems="2" Value="200">
              <Item ID="01" Name="Chocolate" Qty="2" Amount="80" />
              <Item ID="03" Name="Biscuit" Qty="5" Amount="120" />
         </Order>
    </Customer>
    <Customer ID="2" Name="Tiger" Address="City2">
         <Order ID="1" Date="15-Jan-2007" TotItems="1" Value="500">
              <Item ID="01" Name="Pizza" Qty="3" Amount="500" />
         </Order>
    </Customer>
    <User ID="ABC" Name="TestUser" LastLogin="16-Jan-2007" />
    <City Code="NY" Name="New York" />
    <City Code="NJ" Name="New Jersy" />
    </Sales>
    I have individual tables for Sales, Customer, Order, Item, User & City tags with proper referential constraints. I have to parse the xml & have to insert the corresponsing tables for each & every tag if the ID in individual tag does not exists in the table. If the ID already exist, then, I have to update other attributes in the table for the corresponding ID.
    Can anyone suggest me the simplest way to perform the above said scenario?

    Dera Michael,
    Sorry for the confusing previous reply. I went through your solution again and tried for my XML File.
    I have stored the XML File in table XXLF_DS_XML.Should I make use of the table in the below query.
    Here is my SQL Query erroring Out
    SQL> SELECT EXTRACTVALUE(s.COLUMN_VALUE,
    2 '/Header@orderID') ID
    3 ,EXTRACTVALUE(c.COLUMN_VALUE,
    4 '/Detail@lineNumber') lienum
    5 ,EXTRACTVALUE(t.COLUMN_VALUE,
    6 '/Detail/Tax@currency') currency
    7 ,EXTRACTVALUE(t.COLUMN_VALUE,
    8 '/Detail/Tax/Money') customer_name
    9 FROM TABLE(XMLSEQUENCE(EXTRACT(XMLTYPE('- <Recordset>
    10 - <Header dueDate="2007-01-17T16:09:05" orderDate="2004-01-17" orderID="0009" transactionID="1389"
    type="new">
    11 <KeyIndex>2</KeyIndex>
    12 - <BillTo>
    13 - <Address addressID="5619" isoCountryCode="US">
    14 <Name>fMat</Name>
    15 - <PostalAddress name="default">
    16 <Street>34545</Street>
    17 <City>dfgfg</City>
    18 <State>AZ</State>
    19 <PostalCode>85086-1693</PostalCode>
    20 <County>Maricopa</County>
    21 <Country>US</Country>
    22 </PostalAddress>
    23 <Email name="default">[email protected]</Email>
    24 </Address>
    25 </BillTo>
    26 <PromotionCode />
    27 - <SubTotal>
    28 <Money currency="USD">32.49</Money>
    29 </SubTotal>
    30 - <Tax>
    31 <Money currency="USD">2.32</Money>
    32 <Description />
    33 </Tax>
    34 - <Shipping>
    35 <Money currency="USD">8.95</Money>
    36 <Description />
    37 </Shipping>
    38 </Header>
    39 - <Detail lineNumber="1" quantity="1">
    40 - <ItemDetail>
    41 - <UnitPrice>
    42 <Money currency="USD">29.99</Money>
    43 </UnitPrice>
    44 <ShortName>Little;reg; pxxxx® Learning System</ShortName>
    45 </ItemDetail>
    46 - <Tax>
    47 <Money currency="USD">1.68</Money>
    48 <Description />
    49 - <TaxDetail category="sales">
    50 - <TaxAmount>
    51 <Money currency="USD">1.68</Money>
    52 </TaxAmount>
    53 <TaxLocation>AZ</TaxLocation>
    54 </TaxDetail>
    55 </Tax>
    56 </Detail>
    57 - <Detail lineNumber="2" quantity="1">
    58 - <ItemDetail>
    59 - <UnitPrice>
    60 <Money currency="USD">29.99</Money>
    61 </UnitPrice>
    62 <ShortName>Little;reg; pxxxx® Learning System</ShortName>
    63 </ItemDetail>
    64 - <Tax>
    65 <Money currency="USD">1.68</Money>
    66 <Description />
    67 - <TaxDetail category="sales">
    68 - <TaxAmount>
    69 <Money currency="USD">1.68</Money>
    70 </TaxAmount>
    71 <TaxLocation>AZ</TaxLocation>
    72 </TaxDetail>
    73 </Tax>
    74 - <Tax>
    75 <Money currency="USD">0.68</Money>
    76 <Description />
    77 - <TaxDetail category="sales">
    78 - <TaxAmount>
    79 <Money currency="USD">0.68</Money>
    80 </TaxAmount>
    81 <TaxLocation>DISTRICT</TaxLocation>
    82 </TaxDetail>
    83 </Tax>
    84 </Detail>
    85 </Recordset>'),'/Recordset/Header'))) s
    86 ,TABLE(XMLSEQUENCE(EXTRACT(c.COLUMN_VALUE,
    87 '/Recordset/Detail'))) c
    88 ,TABLE(XMLSEQUENCE(EXTRACT(t.COLUMN_VALUE,
    89 '/Recordset/Detail/Tax'))) t
    90 /
    ,TABLE(XMLSEQUENCE(EXTRACT(c.COLUMN_VALUE,
    ERROR at line 86:
    ORA-00904: "C"."COLUMN_VALUE": invalid identifier
    Here is my XML Data
    <Recordset>
    <Header dueDate="2007-01-17T16:09:05" orderDate="2004-01-17" orderID="0009" transactionID="1389"
    type="new">
    <KeyIndex>2</KeyIndex>
    <BillTo>
    <Address addressID="5619" isoCountryCode="US">
    <Name>fMat</Name>
    <PostalAddress name="default">
    <Street>34545 </Street>
    <City>dfgfg</City>
    <State>AZ</State>
    <PostalCode>85086-1693</PostalCode>
    <County>Maricopa</County>
    <Country>US</Country>
    </PostalAddress>
    <Email name="default">[email protected]</Email>
    </Address>
    </BillTo>
    <PromotionCode/>
    <SubTotal>
    <Money currency="USD">32.49</Money>
    </SubTotal>
    <Tax>
    <Money currency="USD">2.32</Money>
    <Description/>
    </Tax>
    <Shipping>
    <Money currency="USD">8.95</Money>
    <Description/>
    </Shipping>
    </Header>
    <Detail lineNumber="1" quantity="1">
    <ItemDetail>
    <UnitPrice>
    <Money currency="USD">29.99</Money>
    </UnitPrice>
    <ShortName>Little;reg; pxxxx® Learning System </ShortName>
    </ItemDetail>
    <Tax>
    <Money currency="USD">1.68</Money>
    <Description/>
    <TaxDetail category="sales">
    <TaxAmount>
    <Money currency="USD">1.68</Money>
    </TaxAmount>
    <TaxLocation>AZ</TaxLocation>
    </TaxDetail>
    </Tax>
    </Detail>
    <Detail lineNumber="2" quantity="1">
    <ItemDetail>
    <UnitPrice>
    <Money currency="USD">29.99</Money>
    </UnitPrice>
    <ShortName>Little;reg; pxxxx® Learning System </ShortName>
    </ItemDetail>
    <Tax>
    <Money currency="USD">1.68</Money>
    <Description/>
    <TaxDetail category="sales">
    <TaxAmount>
    <Money currency="USD">1.68</Money>
    </TaxAmount>
    <TaxLocation>AZ</TaxLocation>
    </TaxDetail>
    </Tax>
    <Tax>
    <Money currency="USD">0.68</Money>
    <Description/>
    <TaxDetail category="sales">
    <TaxAmount>
    <Money currency="USD">0.68</Money>
    </TaxAmount>
    <TaxLocation>DISTRICT</TaxLocation>
    </TaxDetail>
    </Tax>
    </Detail>
    </Recordset>
    Thanks

  • Issue - data is not inserting into queue table

    Hi friends....i created a queue table & queue , started queue. while inserting number into queue, it is going fine. but , while browsing queue table, there is no data inserted into table. table is empty. i executed same script in another machine, it is working fine there.but, it is not working in my machine. i don't know why?.
    can anybody please help me to find out what will be the issue.
    these are the scripts i created........
    BEGIN
    DBMS_AQADM.CREATE_QUEUE_TABLE (
    queue_table => 'put_queue_table',
    queue_payload_type => 'sys.aq$_jms_text_message'
    END;
    anonymous block completed
    BEGIN
    DBMS_AQADM.CREATE_QUEUE (
    queue_name => 'QUALTY_QUEUE',
    queue_table => 'put_queue_table'
    DBMS_AQADM.START_QUEUE (
    queue_name => 'QUALTY_QUEUE'
    END;
    anonymous block completed
    DECLARE
    v_payload SYS.AQ$_JMS_TEXT_MESSAGE;
    v_enqueue_options dbms_aq.enqueue_options_t;
    v_message_properties dbms_aq.message_properties_t;
    v_message_handle RAW(16);
    v_text VARCHAR2(37);
    BEGIN
    v_text := to_char('157');
    v_payload := SYS.AQ$_JMS_TEXT_MESSAGE.construct;
    v_payload.set_text(v_text);
    DBMS_AQ.ENQUEUE(
    queue_name => 'QUALTY_QUEUE',
    enqueue_options => v_enqueue_options,
    message_properties => v_message_properties,
    payload => v_payload,
    msgid => v_message_handle
    COMMIT;
    END;
    anonymous block completed

    Please define what you mean by "when browsing [the] queue table" and why you think what you are doing should be inserting new rows in the table. Also please post full version information.

  • Weird problem w. mysql 4.0 when inserting  into a table with auto_incremet

    Since I upgraded my mysql database from 3.23 to 4.0.1
    the following code does not work anymore:
    I get this error msg:
    <b>"Invalid argument value: Duplicate entry '2147483647' for key 1"</b>
    <code>
    package mysql4test;
    import java.sql.*;
    class test {
    public test() {
    public static void main(String[] args) {
    Connection connection = null;
    Statement st = null;
    try {
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    connection = DriverManager.getConnection
    ("jdbc:mysql://192.168.0.4/x?user=x&password=");
    st = connection.createStatement();
    for (int i=1;i<10;i++)
    String insert = "insert into x (b) values('hello');";
    System.out.println(insert);
    st.executeUpdate(insert);
    } catch (Exception ex) { System.err.println(ex.getMessage());}
    </code>
    The table definition of table x is the following:
    create table x(a int(11) primary key auto_increment, b varchar(10));
    What makes the thing even more mysterious is, that doing the same thing as this programm does manually on an mysql client does not produces any error message.
    insert into x (b) values('hello'); works fine on the mysql client deliverd with the server.

    Hi eggsurplus!
    Yes, I succeeded in different ways to solve the problem. changing the table was one of it. but the problem is that i can't simply change all tables (there are a lot) as the are used in other programms.
    The simplest solution that i figured out so far was changing the insert from
    insert into x (b) values('hello')
    to
    insert into x (a,b) values("+i+",'hello')"
    But this solution is still not satisfactory as in more complex programs you can't just use the i variable of the for loop, but you have to add a new variable that increments on every insert.
    This still means changing a lot of code that i wrote for mysql 3.x.
    Besides, i tried also another jdbc driver and it still didn't work.
    The same bug was reported in a PHP forum, but without solution

  • Error when inserting into a table

    Hi,
    I am running this insert stmt
    SQL> insert into cntct select * from CUSTSRV_ADMN.cntct_bk1;
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    Below is the table structure.
    SQL> desc cntct;
    Name Null? Type
    CNTCT_KEY NOT NULL NUMBER(10)
    CNTCT_NUM NOT NULL CHAR(12)
    SRC_SYS_DESC NOT NULL VARCHAR2(5)
    ACTVTY_DT NOT NULL DATE
    CNTCT_TYPE_DESC NOT NULL VARCHAR2(15)
    CNTCT_INIATR_CD NOT NULL CHAR(1)
    CNTCT_INIATR_DESC NOT NULL VARCHAR2(10)
    CNTCT_INIATR_NAME NOT NULL VARCHAR2(30)
    CNTCT_INIATR_PHONE_NUM VARCHAR2
    CNTCT_STUS_CD NOT NULL CHAR(1)
    CNTCT_STUS_DESC NOT NULL VARCHAR2(10)
    CNTCT_AGE_DAYS_CNT NOT NULL NUMBER(4)
    CNTCT_ELPSD_TIME_SEC_CNT NOT NULL NUMBER(10)
    CNTCT_RCVD_DT NOT NULL DATE
    CNTCT_OPEN_DT NOT NULL DATE
    CNTCT_RSLTN_DT NOT NULL DATE
    CNTCT_NEW_IND NOT NULL CHAR(1)
    HIGHST_NMIS_CD NOT NULL NUMBER(1)
    INIATNG_AGENT_KEY NOT NULL NUMBER(5)
    CLSNG_AGENT_KEY NOT NULL NUMBER(5)
    CNTCT_ID NOT NULL VARCHAR2(20)
    IMG_NUM NOT NULL VARCHAR2(13)
    PRVDR_NPI NOT NULL VARCHAR2(10)
    PRVDR_TIN NOT NULL VARCHAR2(9)
    CNTCT_OPEN_DTIME NOT NULL DATE
    CNTCT_RSLTN_DTIME NOT NULL DATE
    Please advise.
    Regards,
    Narayan

    No its another table.
    I also tried using columns instead of '*'
    SQL> insert into cntct
    2 select CNTCT_KEY,
    3 CNTCT_NUM,
    4 SRC_SYS_DESC,
    5 ACTVTY_DT,
    6 CNTCT_TYPE_DESC,
    7 CNTCT_INIATR_CD,
    8 CNTCT_INIATR_DESC,
    9 CNTCT_INIATR_NAME,
    10 CNTCT_INIATR_PHONE_NUM,
    11 CNTCT_STUS_CD,
    12 CNTCT_STUS_DESC,
    13 CNTCT_AGE_DAYS_CNT,
    14 CNTCT_ELPSD_TIME_SEC_CNT,
    15 CNTCT_RCVD_DT,
    16 CNTCT_OPEN_DT,
    17 CNTCT_RSLTN_DT,
    18 CNTCT_NEW_IND,
    19 HIGHST_NMIS_CD,
    20 INIATNG_AGENT_KEY,
    21 CLSNG_AGENT_KEY,
    22 CNTCT_ID,
    23 IMG_NUM,
    24 PRVDR_NPI,
    25 PRVDR_TIN,
    26 CNTCT_OPEN_DTIME,
    27 CNTCT_RSLTN_DTIME
    28 from CUSTSRV_ADMN.cntct_bk1;
    Still have the same error.
    insert into cntct
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    Please advise.
    Regards,
    Narayan

  • How to insert the Formatted date value and insert into the database

    Hi All,
    I am having requirement of inserting the date value in to the datbase. I'm already getting the value from file as MM-DD-YYYY. Getting exception while transforming the values through the transform activity. I'm using format fate function but it is inserting null value in to the database.
    Any help from anyone would bve appreciated.
    Thanks,
    CH

    Hi,
    your input date format is fixed right? So, in the transform you can split each your date, which is in 'MM-DD-YYYY' format ... extract day, month, year.
    After that ... just put these values in order acording to the format of 'xsd:date' data type which is '[-]CCYY-MM-DDZ'.
    XPath function 'xp20:format-dateTime()' works only with 'xsd:dateTime' data type, which has format '[-]CCYY-MM-DDThh:mm:ssZ'.
    So, in your case it could be:
    <xsl:variable name="day" select="substring($inputDate,4,2)"/>
    <xsl:variable name="month" select="substring($inputDate,1,2)"/>
    <xsl:variable name="day" select="substring($inputDate,7,4)"/>
    <xsl:variable name="outputDate">
    <xsl:value-of select="$year"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$month"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$day"/>
    </xsl:variable>
    Regards,
    Martin.

  • INSERT into Oracle table as SELECT from MS Access table

    I'm trying to pull some data across from an MS Access database. I really need to pick and choose what is coming across, so migration isn't what I need. I can connect to the Access DB from SQL Developer, export data and so forth. However, I can't seem to find a way to directly access data in the MDB file from an Oracle connection. The two options that I can think of which would be perfect (if they are possible) are:
    1. If it's possible to SELECT between two open connections in SQL Developer. I can (and have) had both my Oracle conection where I want the data to go and the source Access connection opened simultaneously, but I can't see any way to address a query from one connection to another.
    2. If it's possible to create the equivalent of a database link to the Access MDB file from within my Oracle database so that I can address the query via that.
    Right now I'm exporting individual tables from Access to files, then doing a bunch of Search and Replace operations to convert them to SQL scripts with INSERT statements in the format required, then running those scripts in my Oracle connection. It works, but is very slow and tedious.

    You need to create a database link based on Database Gateway for ODBC. This gateway allows you to connect from an Oracle database to a foreign data store using a 3rd party ODBC driver.
    A suitable 3rd party ODBC driver which allows you to connect from Oracle to MS Access is the ODBC driver from Microsoft available on Windows platforms - I'm not aware of any 3rd party ODBC driver for MS Access available on Unix platforms.
    So when using DG4ODBC on Windows you can connect from your Oracle database (even when the database resides on Unix) to DG4ODBC on Windows which then connects to the Ms Access database using the MS Access ODBC driver.
    There's a separate Forum for those configs:
    Heterogeneous Connectivity

Maybe you are looking for

  • How do I get the Next Button to appear on a form?

    I have a form built off of a view. I pass a parameter from a report through a link to launch the form with the appropriate values. I would like user to then be able to navigate to the next set of information from the report without having to navigate

  • Flash will not work in safari 5.0

    I have a problem with Flash. I have a Mac Pro Safari 5.5.8 OS X10.5.8 I have downloaded from adobe site.  Installed, uninstalled the 10.3.??? It is showing in the preference panel. Works fine in Firefox. HELP PLEASE.   I have no idea what to do at th

  • Final Cut Pro to Final Cut Express -- Format issues?

    Hi, I'm shooting a project on a Panasonic HVX-200A, and my cameraman is going to import the footage to his Final Cut Pro station. He's then going to transfer the FCP footage and data over to an external hard drive, which I am going to use to edit the

  • SQL Query to find cumulative values for a Financial Year

    Dear users, My requirement is to create a SQL query for a table/view where I have day-wise data. I want to find out cumulative values for financial year by giving any date. It should add the values from start of financial year till that date in the f

  • Can I paste and keep the same columns and rows?

    Paste problems. I regularly download data from the Transport for London, Oystercard website. When I used Windows I could highlight and copy on their webpage (displayed in columns and rows) and when I pasted into Excel it pasted the data in the same f