Inserting the records into the table

Hi,
I defined a procedure as follows
create ....
Cursor C1 is
select item_id,item_name from item;
Inert into abc.t3_clas(id,name) values(NVL(c1.item_id,' '),c1.item_name);
end;
Cursor C1 is having data. There are no null values.
But after executing the procedure it's working fine but it is not loading the data.
Could you please help me out where I need do check to find out the problem.
Thanks.

832581 wrote:
create or replace
PROCEDURE cust_load AS
<var declaration)
CURSOR C1 IS
SELECT a.item_num,a.item_name FROM
(SELECT ltrim(rtrim(item_num)) itemnum,
item_name, item_cd, item_typ
     FROM abc.item_wrkg
          UNION ALL
          SELECT ltrim(rtrim(item_num)) itemnum,
item_name, item_cd, item_typ
     FROM abc.item_w_cd ) a
WHERE a.item_cd = '01'
AND a.item_typ = '28';
BEGIN
DBMS_OUTPUT.ENABLE(100000);
lvb_trun_tbl := DWB.DWB_truncate_tbl('ITEM_CTGRY');
IF NOT lvb_trun_tbl THEN
RAISE lve_trunc_failed;
END IF;
FOR c_rec in c1 LOOP
INSERT INTO abc.item_ctgry(ctgry_cd,
ctgry_name)
VALUES (NVL(c_rec.itemnum,' '),
c_rec.item_name);
lvn_rec_count := lvn_rec_count + 1;
IF MOD(lvn_rec_count,lvn_commit_seq) = 0 THEN
COMMIT;
END IF;
END LOOP;
COMMIT;
IF lvn_rec_count = 0 THEN
RAISE lve_no_rec_found;
END IF;
DBMS_OUTPUT.PUT_LINE('abc.item_CODE_LOAD - Rows loaded: '|| TO_CHAR(lvn_rec_count));
EXCEPTION
WHEN lve_trunc_failed THEN
DBMS_OUTPUT.PUT_LINE(' Truncation failed');
WHEN lve_no_rec_found THEN
DBMS_OUTPUT.PUT_LINE(' No rows inserted');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('SQLERRM);
END;
this is the procedure....
please look into this and give me your suggestions.
Thanks.You still hiding the code...
But its not throwing any error means ur logic is going wrong somewhere..
post your whole code.
and put the below tag line before and end of code..
Regards
Umesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Different methods involved in insertion of records into the table

    hi all,
    i am using Forms [32 Bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    i have parameters like emp_code(optional) and year(mandatory field-four digit year).
    Based on the parameter i have to get the details from one table and those records should be inserted into other table along with additions columns(by hardcoding the additional columns).
    To acheive this i am planning to get a cursor by selecting the necessay fields from the table passing the parameters in the where clause of the cursor.
    by looping through the cursor i will insert the records into the other table.
    here the thing is the data is going to be huge (since year is the parameter).
    so is my approach leads to the performance issue.
    i heard that there are different method of insetions,
    can anybody suggest me the better way(peformance wise) other than what i have mentioned (if you are aware of)..
    Thanks..

    This is not really a Forms issue, so you'd better go to the sql and pl/sql forum. Here, this question has been asked many times: how do I insert large volumes of data in a table?
    insert into ...
    select ....
    or CTAS (create table as select ....)
    by looping through the cursor i will insert the records into the other table.That is really the worst idea. If you can do it in sql (insert into ... select ...) DON'T do it in pl/sql.

  • Insert multiple records into a table(Oracle 9i) from a single PHP statement

    How can I insert multiple records into a table(Oracle 9i) from a single PHP statement?
    From what all I've found, the statement below would work if I were using MySQL:
         insert into scen
         (indx,share,expire,pitch,curve,surface,call)
         values
         (81202, 28, 171, .27, 0, 0, 'C' ),
         (81204, 28, 501, .25, 0, 0, 'C' ),
         (81203, 17, 35, .222, 0, 0, 'C' ),
         (81202, 28, 171, .27, 2, 0, 'C' ),
         (81204, 28, 501, .20, 0, 1, 'C' ),
         (81203, 28, 135, .22, 1, 0, 'C' )
    The amount of records varies into the multiple-dozens. My aim is to utilize the power of Oracle while avoiding the i/o of dozens of single-record inserts.
    Thank you,
    Will

    You could look at the INSERT ALL statement found in the documentation here:
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_913a.htm#2133161
    My personal opinion is that you probably won't see any benefit because under the hood I think Oracle will still be doing single row inserts. I could be wrong though.
    The only way to confirm was if you did a test of multiple inserts vs an INSERT ALL, that is if the INSERT ALL met your requirements.
    HTH.

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • Inserting Multiple Records into two table

    I want to insert records from a ADF swing form into two tables. In the first table the primary key is generated by a trigger and then I need to retrieve the primary id generated and then insert multiple records in another table using the primarykey obtained from the first table as foreign key.
    How to do this ?

    User,
    If you're using ADF Business components, have a read on the DBSequence data type. If you have two VO's linked by a view link, and the FK is a DBSequence type, all this happens for you out-of-the-box.
    Hope this helps,
    john

  • How to insert new record into oracle table from GridView in VS2005.

    I need to insert records into Oracle10g table from VS2005 GridView using the Insert Method in Business Logic Class. The Update and Delete Methods are working fine. What's the best way out?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

  • How do you insert new records into multiple tables using the same unique primary key?

    I’ve created a PHP site and MySQL server using a free app called XAMPP.  I have successfully created a form in Dreamweaver that will write data to a (name) table in the SQL database.  Here’s my question: How do you write to two (or more) tables in the same database and pass the same primary key to both tables?  In the SQL database, I defined the first field as ID and set it as the primary key with auto update.  So, when you insert a new record, it creates a unique primary key for that record.  In my form, I’m capturing info that needs to be stored to two tables at the same time; a Name table and Address table. Since the Name and Address tables use the ID field as the primary key, I believe I will need to pass the ID value from the Name table to the insert of the Address table to insure they both have the same primary key, right?

    No. You probably need the primary key from one table to be a foreign key in the other tables. In any case, I believe you can use two methods to obtain the auto generated key. First with SQL:
    http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
    And the other using a PHP function:
    http://us3.php.net/mysql_insert_id

  • Somehow ejbCreate method of an Entity EJB is not inserting a record into the database. I'm using BMP and calling the Entity bean method from a servlet. I'm using NAS 4.0 sp5 on Win 2k.

    Also if I call the insert query from within the servlet it works fine. I have disabled global transactions. Am I missing something out ? Please
    any help would be greatly appreciated.

    May be your servlet is not able to lookup the EJB. You can use some print statements and see whether lookup ok or not.
    Just a guess.
    Plese get back, if any queries.
    Thanks,
    Rakesh.

  • Custom Oaf form inserting blank records into custom table

    Hi all,
    I have developed custom OAF form to insert vendor details mapped to custom table.
    Oaf form is working fine without giving any error.
    In back end blank records is inserting into the custom table i.e. only WHO columns (creation_Date, created_by, last_update_login etc.) values are populating correctly but the
    data which i am entering in OAF form is not populating into the table.
    Please help, tnx in advance.
    Regards,
    Mohit

    Do you have mapping of your form fields with the view object and view attribute ?

  • How to insert multiple records into a table?

    hi all 
    i have a table that name is : TiketsItem
    now i  want to 100 records insert my table
    for example : TicketsHeaderRef=52000
    Active=False
    TicketsItemId=45000 to 45100
    how to insert TicketsItemId  45000 to 45100 in my table
    thanks all
    Name of Allah, Most Gracious, Most Merciful and He created the human

    So, you just want to insert the serialized data into the table, without useDate or WKRef? I'm assuming these values will be updated later?
    Try something like this:
    DECLARE @TicketsHeader TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsHeader (TicketsItemID, ticketsHeaderRef, active)
    VALUES (52000, @startInt, 0)
    SET @startInt = @startInt + 1
    END
    SELECT *
    FROM @TicketsHeader
    thanks 
    i edited your codes:
    DECLARE @TicketsItem TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsItem (TicketsItemID, ticketsHeaderRef, active)
    VALUES (@startInt,52000 , 0)
    SET @startInt = @startInt + 1
    END
    when i execute:
    SELECT *  FROM TiketsItem
    i do not see any records inserted in TiketsItem
    how to solve it?
    Name of Allah, Most Gracious, Most Merciful and He created the human

  • Insert a record into a table through email in an Oracle APEX application

    I developed an Oracle APEX application, there is a table called events. I can insert/update/delete a record in the table through browser. I am thinking in order to quickly do the data entry, user should be able to send an email, then the table should be inserted with values from email address, timestamp, subject and body. Anyd idea how to realize this functionality?
    - Denis

    Start by checking whether your mail server provides any API's for accessing emails , if it does you might be able to reduce a lot of work by using some kind of web service consumer from apex to your mail server. In any case your implementation is going to be dependent on your Mail Server configuration.
    Your problem breaks down to reading/accessing mails from the mail server from PLSQL (apex is driven by PLSQL).
    I found this other thread which could be of some use.
    WAY TO ACCESS A MAIL SERVER FROM ORACLE APEX
    <li>The following package might solve your problem directly(from carsten czarski of the German Apex community)
    [url http://plsqlmailclient.sourceforge.net]http://plsqlmailclient.sourceforge.net
    PS: POP3 support is still TBD.
    <li>I also found this posting in the orafaq forums which lists a java method and PLSQL code bit for it for accessing emails via POP3
    [url http://www.orafaq.com/forum/t/80928/2/]http://www.orafaq.com/forum/t/80928/2/
    If these do not work for you, find some java library to read mail from your server, write a PLSQL wrapper for it and use it in a scheduled job(DBMS_JOB)/a PLSQL block triggered from Apex.
    If you get stuck there, find some utility that can read mails, invoke them from your DB using java,shell scrpt,dbms_scheduler etc and use the utility's function for the rest.
    NOTE: I haven't tried any of these utilities and you must validate any java code before running them on your environment.
    Since aren't really much restrictions(other than spam checks) in sending a mail to your mail account, you might want to consider filtering out the mails from which you create records.

  • How to insert new record into altered table

    I am using JDBC with MySQL. I altered existing table and want to insert new record using java class. But it is not possible.How to do?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

  • Inserting a record into ORACLE table from a webdynpro application

    Hi,
    From My webdypro code I have 10 attributes which are need to  be inserted into a ORACLE DB table. Can anyone suggest me how to achieve it or Can you please point me a tutorrial which can help on it.
    All the attributes will be inserted in a single record.
    Thanks,
    James

    check this code
    Created on Oct 18, 2007
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package com.psft;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.StringTokenizer;
    @author BALU
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class DataBaseDAO
         ResultSet rs;
         int qID = 1;
         int noOfChoices=0;
         Connection con;
         Statement stmt;
         public DataBaseDAO()
              try{
                   /*Class.forName("oracle.jdbc.driver.OracleDriver");
               con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","bduvvuri","dbsub516");
               stmt = con.createStatement();*/
               DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
               Class.forName("oracle.jdbc.driver.OracleDriver");
               String s ="jdbc:oracle:thin:@192.168.9.34:1527:ep7";
               con=DriverManager.getConnection(s,"user1","welcome1");
               stmt = con.createStatement();
              }catch(Exception e){}
         public int register(String name,String pass,String emailid){
              int i =0;
              try{
                   PreparedStatement ps = con.prepareStatement ("Insert into USERS(username,password,email) values (?,?,?)");
                   ps.setString( 1, name);
                   ps.setString( 2, pass);
                   ps.setString( 3, emailid);
                   i = ps.executeUpdate();
                   }catch(Exception e){
                   System.out.println("ee"+e.getMessage());
              return i;
    xxxxxx (please read forum rules)
    Edited by: Armin Reichert on Jan 17, 2008 10:17 AM

  • Triggers to insert the record in a table

    I have two table 1. Holiday 2. Attendance.
    When I insert the record    in holiday table for his
     advance holiday   with empid, the same time I want to insert it attendance table
     automatically for the same date using a trigger
    Insert into attendance (empid,date,holiday) values (20078,07/10/2014,1). If holiday column value 1 represent holiday marked,
     0 represent  holiday not marked. The same thing can happen vice versa
    If employee mark his current attendance as  holiday through attendance,
     it should   be  inserted into holiday table 
    automatically using triggers.
    Insert into  Holiday (empid,date,holiday) values (20078,06/08/2014,1). If holiday column value 1 represent holiday marked,
     0 represent  holiday not marked. The same thing can happen vice versa
    Please I am looking for your help , how I can make it using triggers 
    to insert both table  in two different ways of options.
    Regards
    Pol
    polachan

    Hi polachan,
    According to your description, if you want to synchronize the data between the holiday table and the attendance table while inserting records into holiday table, you need to create a trigger on the holiday table, please try the following syntax.
    use <databasename>
    go
    create trigger Tr_holiday
    on holiday
    for insert
    as
    declare @empid varchar(20),
    @date datetime,
    @holiday int
    select @empid = empid, @date=date, @holiday=holiday from inserted
    declare @qty int
    select @qty =count(*) from attendance where empid=@empid and date=@date and holiday=@holiday
    if @qty<1
    begin
    insert into attendance
    select i.empid,
    i.date,
    i.holiday
    from inserted i
    end
    Meanwhile, if you want to insert the record into the holiday table when holiday is updated to 1 in the attendance table, you need to create another trigger on the attendance table, please try the following syntax.
    use <databasename>
    go
    create trigger Tr_attendance
    on attendance
    for update
    as
    declare @holiday int
    if update (holiday)
    begin
    select @holiday=holiday from inserted
    if @holiday=1
    begin
    insert into dbo.holiday
    select empid,
    date,
    holiday
    from inserted
    end
    end
    For more details about creating triggers in SQL Server, please review this article:
    CREATE TRIGGER (Transact-SQL).
    Thanks,
    Lydia Zhang

  • Insert records into A table in Oracle from SAP

    Hello All,
    I want to know how can we insert a record into a table which is in another server say Oracle and this needs to be done everyday.
    For example, I have a record which gives the information whether the Daily Job has run Successfully or not. Now , I have to update this information in the Oracle table.

    refer amit perfect answer.
    Re: Need to put data in oracle table from sap.

Maybe you are looking for

  • Inventory account not defined in item code

    Hi,      Iam trying to add A/p Credit memo from A/P invoice (Copy to method) and changing Unit price of one item (there 8 items) then it gives error of "Inventory account not defined item code" i check all accounts in Item group and Wh also.i also ch

  • How to install Pro*C on App Server 10g rel 2 for Linux

    Hiya, Pro*C on the database platform seems a straight forward install. Can anyone please tell me how to do the install of the Pro*C onto the App Server platform, so we can test and execute the programs there? Are there instructions for this? TIA Tony

  • How to place raster images as smart objects?

    I'm trying to duplicate Photoshop's File:Place menu functionality and I'm experiencing something that I can't figure out. (I've added my code to the end of this message.) I have a variety of test EPS images that I can run through the File:Place menu.

  • Lightroom 3.6 to photoshop CS4

    I used to use Lightroom 2, a Canon 450D and Photoshop CS4.  i had no problem using Lightroom, Photo/Edit in Photoshop to open and work with my images in photoshop.  i then upgraded to Lightroom 3.6 and now use a Canon 60D camera and still use Photosh

  • Issue with OBIEE 11g measure columns

    Hi, Recently one of our application got migrated from 10 to 11g. post migration we had patched 6.1 and 6.2. measure column defined in RPD were working fine in 10g and 11g(after patching) as well. Suddenly all measure columns are behaving abnormal. Ev