To insert multiple rows by getting the values from the user

Hi
I want to insert multiple rows into a table using user given values dynamically.
I am a beginner to PL/SQL. Below code is part of my big code. A_row_insert is 2 and A_count is 1 (initially). While i execute , it asks for input only once and insert the same data 2 times. I want to enter two different rows. Please guide/advise me on this.
while (A_count<=A_row_insert) loop
dbms_output.put_line('Enter the value  for the row#'||A_count||' of the table '||v_req_tab_name||':');
begin
INSERT INTO customers (
customer# ,
lastname ,
firstname ,
address ,
city ,
state ,
referred ,
region
+)+
VALUES
+(+
+&customer,+
+'&lastname' ,+
+'&firstname' ,+
+'&address' ,+
+'&city' ,+
+'&state' ,+
+&referred ,+
+'&region'+
+);+
end;
A_count := A_count 1;+
end loop;
regards
Sakthivel

hi,
You need to write a procedure and call it from front end for n number of time..... check the parameters you need to pass to execute the procedure.... try given sample....
CREATE OR REPLACE PROCEDURE InsertData(i_code IN VARCHAR2,i_code_desc IN VARCHAR2,i_code_type IN VARCHAR2)
AS
BEGIN
     INSERT INTO CODE_MASTER (code,code_desc,code_type)
VALUES(i_code,i_code_desc,i_code_type);
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE ( 'Error during Insert code - '||i_code );
END;
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
exec InsertData('code1','desc1','type1');
Thnx MB

Similar Messages

  • How to get a value from the previous element (XSLT/XPATH gurus ahoy!)

    Hi All,
    I am building an RTF template for a "letter of reference"-report. Sometimes there are several rows in the data, that need to be printed as one. This is due to consecutive temporary contracts, which will be printed out as one period of service.
    Here's a simplified data example to illustrate the problem.
    <ROW>
    <START_DATE>01-01-1980</START_DATE>
    <END_DATE>01-01-1988</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-1988</START_DATE>
    <END_DATE>01-01-1990</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-2000</START_DATE>
    <END_DATE>01-01-2005</END_DATE>
    </ROW>
    With the data above, I should print two lines:
    01-01-1980 - 01-01-1990
    01-01-2000 - 01-01-2005
    I need to compare START_DATE of an element (except for the first one) with the END_DATE of the previous element, to find out whether to print the END_DATE for that element or not. How can I get that value from the previous element?
    Thanks & Regards, Matilda

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • Insert multiple rows into a same table from a single record

    Hi All,
    I need to insert multiple rows into a same table from a single record. Here is what I am trying to do and I need your expertise. I am using Oracle 11g
    DataFile
    1,"1001,2001,3001,4001"
    2,"1002,2002,3002,4002"
    The data needs to be loaded as
    Field1      Field2
    1               1001
    1               2001
    1               3001
    1               4001
    2               1002
    2               2002
    2               3002
    2               4002
    Thanks

    You could use SQL*Loader to load the data into a staging table with a varray column, then use a SQL insert statement to distribute it to the destination table, as demonstrated below.
    SCOTT@orcl> host type test.dat
    1,"1001,2001,3001,4001"
    2,"1002,2002,3002,4002"
    SCOTT@orcl> host type test.ctl
    load data
    infile test.dat
    into table staging
    fields terminated by ','
    ( field1
    , numbers varray enclosed by '"' and '"' (x))
    SCOTT@orcl> create table staging
      2    (field1  number,
      3     numbers sys.odcinumberlist)
      4  /
    Table created.
    SCOTT@orcl> host sqlldr scott/tiger control=test.ctl log=test.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Wed Dec 18 21:48:09 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 2
    SCOTT@orcl> column numbers format a60
    SCOTT@orcl> select * from staging
      2  /
        FIELD1 NUMBERS
             1 ODCINUMBERLIST(1001, 2001, 3001, 4001)
             2 ODCINUMBERLIST(1002, 2002, 3002, 4002)
    2 rows selected.
    SCOTT@orcl> create table destination
      2    (field1  number,
      3     field2  number)
      4  /
    Table created.
    SCOTT@orcl> insert into destination
      2  select s.field1, t.column_value
      3  from   staging s, table (s.numbers) t
      4  /
    8 rows created.
    SCOTT@orcl> select * from destination
      2  /
        FIELD1     FIELD2
             1       1001
             1       2001
             1       3001
             1       4001
             2       1002
             2       2002
             2       3002
             2       4002
    8 rows selected.

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • How to get the values from the resultset???

    I have a problem with this code given below,
    i am executing an sql query which return a union of values from two tables.
    the problem here is how do i read the values from the resultset.
    here is the code....
    package com.webserver;
    import java.sql.*;
    public class UnionDemo{
    public static void main(String args[]){
    Connection connection =null;
    Statement statement =null;
    ResultSet rs =null;
    try{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    connection = DriverManager.getConnection("jdbc:oracle:thin:@:1521:ORCL","scott","tiger");
    statement = con.createStatement();
    rs = statement.executeQuery("(select tablename from node where appid=432) union (select tablename from uomnode where appid=432)");
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    while (rs.next()){
    System.out.println(rs.getString(1));
    // instead of rs.getString(1) I also used rs.getString("tablename") but of no success....
    }//end of while
    }catch(Exception exp){
    exp.printStackTrace();
    finally{
    try{
    if (rs!=null) rs.close();
    if (statement!=null) statement.close();
    if (con!=null) con.close();
    }catch(Exception exp1){
    exp1.printStackTrace();
    }//end of finally
    }//end of main
    }//end of class
    when i execute this program i get an oracle error ORA-01009
    which says (java.sql.SQLException: ORA-01009: missing mandatory parameter)
    can anyone help to retrieve the values from this resultset...
    thanx

    [cut]
    i am executing an sql query which return a union of
    values from two tables.
    the problem here is how do i read the values from the
    resultset.[cut]
    When the error occours?
    1) Executing query ?
    2) Retrieving the field from the resultSet ?
    3) ecc. ?
    BTW, first of all, try to execute the query removing the parenthesis
    of the two select statement. I know that there are some problem
    with the oracle jdbc driver about them.
    Hope it helps.

  • How to get the value from the checkbox

    Hi All,
    Good Evening,
    i want to get the value from the check box.
    for this i wrote like this
    OAMessageCheckBoxBean cbb=(OAMessageCheckBoxBean)webBEan.findChildRecurssive("item240")
    String val=cbb.getvalue(pageContext).toString();
    val getting the value only when checkbox is checked.
    suppose check box is not checked that time i got NULL POINTER exceptionn.
    so
    i tried the following way alsoo
    string val=pageContext.getParameter("item240");
    here val return 'on' only when checkbox is checked.
    otherwise NULL value returnss.
    but i want to get the value is 'Y' when i am checked the checkbox
    otherwise returns NULL valuee.
    already i set the checkbox properties alsoo
    Checked :Y
    unchecked:N
    pls tell me

    Hi,
    use
    try
    OAMessageCheckBoxBean cbb=(OAMessageCheckBoxBean)webBEan.findChildRecurssive("item240")
    String test = cbb.getvalue(pageContext).toString();
    catch(Exception e)
    String test = "";
    this way you can handle null pointer exception.
    Thanks,
    Gaurav

  • I want to get the values from the second hiphen only

    Hey Guys,
    I have one column and the data like this
    col1 = 'AI463-901-001'
    Now,
    I want to get the values from the second hiphen only(any no. of values).
    Please can any one help me on this .
    Thanks in advance!
    Regards,
    -LK

    you have a mistake
    you result is -001
    this is right
      select substr('AI463-901-001',instr('AI463-901-001','-',1,2)+1) from dual;
      -- @user11928732 -  if you are using Oracle Database 11g, ttry this please
    with data as
      (select  'AI463-901-001'from dual)
      select substr(str,instr(str,'-',1,2)+1) from data;
      select substr(<YOUR COLUMN>,instr(<YOUR COLUMN>,'-',1,2)+1) from <YOUR TABLE>;result is : 001
    Edited by: Mahir M. Quluzade on May 3, 2011 5:37 PM

  • Unable to get the value from the textfield in valueChangeEvent

    Hi,
    I have created one custom textField by extending the CoreInputText. Now i have attched default ValueChangeListener to it. I am using this textField in my application.
    Now i type some thing and do a focus lost, the value change listener get called. i want to validate the value entered. In that listener method if i take the getSource() from ValueChnageEvent object and do a getValue() I am getting the entered value.
    My problem is that if i do a getValue() of the textField i am not gettting the value entered.
    How can i get the entered value from the textfield.? Is there any method to notify to do this?
    Thanks in advance.

    Hi,
    I tried to the value from coreInputText also. If i check the getValue method of the component, i am getting the last updated value. I have debug the FlowPhaseListsner also. And i found that this listener is calling before the updateModel phase. Due to that i am not getting the value from the Field.

  • When i am retreiving the values from the access table i am getting null val

    hi all,
    I comeacross the following problem,I connected my applet to the Access database with jdbc:odbc driver.
    I am trying to retreive the values from the table.I am getting the result correctly when the same code with using applet it was giving the correct result.
    when I am using an applet program it was giving the null value istead of the actual records.
    can anybody tell me the reason why
    thanks in advance
    and also how to connect the databse in the webserver when i installed my applet in the client side
    please give me some suggestions to do that
    thankyou
    lakshman

    Hi Krishna,
    Can you please copy the code generated by ODI for creating your C$ table ?
    i mean :- create table C$_0Entity ( from the operator log
    Regards,
    Rathish A M

  • How to pass the values from the Wb Dynpro Application to the SAP Backend ?

    Hi All,
    Good morning..,
    I have scenario like:
    I want to pass the values from the web dynpro appication to the SAP Back end R/3 Table. IN backend the RFC is writtn to accept the structure input from the Webdynpro.
    Upto know I imported the corresponding RFC and maaped to the View.
    How to proceed with the coding to save the data...
    PLease suggest...
    Regards and Thanks in Advance,
    CSP

    Hi  Pradeep
    Steps:
    1. First create an instance for bapi and bind the instance to the bapi node.
      Z<bapi name> zb=new Z<bapi name>();
      wdContext.nodeZ<bapi name>. bind(zb);
    2. Then if u have the import parameter u have to set them by using
        The instance of the above bapi.
        Zb.set<import parameters>;
    3. If the bapi has a table parameters then the structure for the table parameters will also be imported
       In the model class.
    4. Set the table parameters by creating the instance for that structure and using this instance set it.
       Z<Struct>itm tab=new Z<Struct>();
       Tab.set<table parameters>
    5. Then add the structure instance to the bapi instance.
        Zb.add(Tab);
    6. Then Execute the bapi after setting the import parameters.
    7.  If there is any export parameters, then get the values after execution.
    Look at this thread for codes
    Re: RFC call on click of button
    Regards,
    Arun

  • Does coherence cache the value from the cache?

    Hi, I have the question about if the coherence caches the value from the cache? I believe it does from my test, just want to get the confirmation.
    I like to use an example to describe my question. For example:
    If (key1, value1) are in the cache1, (value1 is an object),
    for the first time, if cache1.get(key1), coherence will deserialize value1 and return. But if in the same JVM, when cache1.get(key1) is invoked again, coherence will return value1, which I believe is cached by coherence in the current JVM, and return; instead of deserializing and return it. Is that right?
    I am asking this question because I found a problem in our project when use coherence. As the above example, if I use value1 = cache1.get(key1), and in our project, value1 object has a set method to change one of its internal attributes, and this method was indeed invoked after value1 get from cache1. Then in another class, value2 = cache1.get(key1) is called again, and I found out that value2's attribute will have the modified value, even cache1.put(key1, value1) is never invoked in the first place.
    Of course, this kind of behavior matches the java.util.Map. But coherence cache is a cluster/distributed environment. In the above example, if on another data node, value3 = cache1.get(key1) will get the original attribute value in value3, since the deserialize object will always get the original value, unless the new value is put in explicitly by cache1.put(key1, value1).
    In this case, should cache1.get(key1) always return a clone object make more sense?
    Thanks

    You observation is correct. More specifically for cache topologies which include an in-process cache Coherence may return the same object reference for repeated get requests on the same key. I say "may" because for any variety of reasons we may also have to retrieve a fresh copy from a remote cache server. When possible we will return existing objects for performance reasons avoiding costly things like network hops, and de-serialization. Any modifications made to an object returned from the cache will not be made automatically available to other cluster members. Additionally if these modifications are made concurrently with another thread performing a cache.put() on the same value could result in a corrupt cached value if your serialization methods are not thread-safe. Best practice dictates that unless you are sure that you are using a cache topology which does not include an in-process cache that you treat the values returned from the cache as immutable, and instead deep clone() it before making any modifications.
    The distributed-scheme and remote-scheme are the only types of caches which do not include in-process caching, and thus always return "mutation safe" values. The most common in-process cache topology is near-scheme, but others include replicated-scheme, optimistic-scheme, local-scheme, and the programatically created ContinuousQueryCache.
    thanks,
    mark

  • After selecting the value from the list box, want to disable checkbox

    hi guru,
    After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
    so please help me on this.
    thanx,
    man

    in PBO,
    loop at screen.
      if screen-name = your textbox's name.
        screen-input = 0.
        modify screen.
      endif.
    endloop.

  • How to create multiple rows in a child table from the multi select Lov

    Hi
    We have Departments and EmployDept and Persons tables and each employee can associate multiple departments and vice versa.While creating a Department page there should be a Multi Select LOV(values from Persons table) with search option for the Persons.From the search panel we can select multiple persons for that department.Suppose we have selected 5 persons and click on submit, then it should create 5 rows in the EmployDept table for 5 persons with that department id.
    Any inputs on how to implement this scenario please..

    Maybe you can get some ideas from here -
    http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html

  • Getting rpm values from the fans on the MSI NEO2-FIR motherboard doesn't work

    I currently have 6 Noctua NF-S12-1200 120mm fans spinning in my computer but i am unable to get rpm values from them except the cpu-fan. It doesn't work to get a readout from the others with either, BIOS, Dual Core Center or Speedfan. Regarding Speedfan is it true it don't support the SuperIO Chip on the Neo2, the FINTEK F71882F? It's not currently listed in their supported temperature sensors list.
    So whats the problem? Shouldn't atleast DualCore Center atleast show the rpm's from the other chassis fans?
    Or the fans don't support sensor readings?
    Thanks!

    Quote from: Jack on 13-October-10, 00:15:36
    Well, there is nothing that can be done about.  SysFAN 1 & 4 support sensor readings,  #2,#3 and #5 don't.  You can also see that in BIOS Setup.  #1&#4 are the only ones that show up there (H/W Monitor section).  This is not a malfunction or a bug.  You have to live with no fan sensor readings or be creative about the wiring.
    The problem is that i use the UNLA cables from Noctua which half the speed of the NF-S12 fans i run with. And it blocks the rpm readouts in Speedfan and BIOS.
    http://www.noctua.at/main.php?show=productview&products_id=5&lng=en
    Strange thing is that the CPU fan reads fine with the ULNA cable attached but the SYSFANS will not read the rpm with the ULNA cables.
    What is wrong?

Maybe you are looking for

  • How many apps can you build with ADP Single Edition?

    DPS Single Edition means that you can only create ONE app through the App Builder? If you need to create 2 or 3 what are your options? Creative Cloud, Prodfesional Edition? Creative Cloud suscribers need to buy the DPS anyway?

  • Unable to place bookmarks in bookmark toolbar.

    Have tried everything to place bookmarked web sites in the bookmarks toolbar. But to no avail. One solution was to drag the Icon from the address bar, but I only see a padlock. When trying to bookmark a site from the drop down menu and ask it to go t

  • I have dead strip on my iphone5 screen

    I have a strip on my iphone5 screen that is not at all responsive to touch.  I used a sketch app in the picture below to show where the dead spot is.  What can be done to fix this?  I am not aware of anything I did that could cause this (ex. drop the

  • PR mandatory only for few PO document types

    Hi SAP Gurus, Issue being faced in a support project. A buyer is authorised to create 5 different PO doc types. Requirement is to make for only 2 PO document types PR is mandatory. Need immeidate inputs. Any suggestion without implementing user exist

  • 24 fps video does not play in CS5.5 source monitor without choppy motion

    Problem: 24 fps video does not play in CS5.5 source monitor without choppy motion. 30 frame will play fine. I took the same 24fps shot, using the exact same setup parameters, and played it in my CS5.0. No problem. I did them side by side and checked