How to fill out the list for inserts in the procedure?

I want to populate a list for a string of inserts.  All pads are the same except each iteration will change by this list.

inserting into table X (A, B) values (1,2);

In my case, I want to change the value each time column 2.

So, something like this:

DECLARE

v_species varchar2 (10);

CURSOR spec_code_cur is

This is an example of my list... I need to get into the cursor.  I thought to use the double, but it did not work.  They do not live in any table yet, so I can't question.

ACGL,

AGCR,

ALINT,

ARTR2,

IDEC,

CEVEV4

BEGIN

FOR v_species in spec_code_cur

LOOP

insert into nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off)

values ('450DB4460A7449B0E0440003BA9ECAD1',v_species, 'ON');

END LOOP;

END;

/

The desired output would be for inserts run as:

insert into nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off)

values ('450DB4460A7449B0E0440003BA9ECAD1','ACGL', 'ON');

insert into nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off)

values ('450DB4460A7449B0E0440003BA9ECAD1','AGCR', 'ON');

insert into nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off)

values ('450DB4460A7449B0E0440003BA9ECAD1','ALINT', 'ON');

insert into nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off)

values ('450DB4460A7449B0E0440003BA9ECAD1','ARTR2', 'ON');

insert into nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off)

values ('450DB4460A7449B0E0440003BA9ECAD1','CEDI', 'ON');

insert into nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off)

values ('450DB4460A7449B0E0440003BA9ECAD1','CEVEV4', 'ON');

I thought that the dual purpose was to pull information from "thin air"... but it does not work.

Thank you.

If you pass the input as a single string set, you can do that.

WITH T1 AS)

SELECT "ACGL AGCR, ALINT, CEVEV4, IDEC, ARTR2" COL1 OF DOUBLE)

SELECT ' INSERT INTO nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off) VALUES (')

|| CHR (39) | ' 450DB4460A7449B0E0440003BA9ECAD1' | CHR (39) | «, » || CHR (39) | REGEXP_SUBSTR(COL1,'[^,]+',1,LEVEL) | CHR (39) | «, » || CHR (39) | ' WE '. CHR (39) |') ;'

FROM T1

CONNECT BY LEVEL<=>

OUTPUT:

INSERT INTO nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off) VALUES ('450DB4460A7449B0E0440003BA9ECAD1', "ACGL", "ON");

INSERT INTO nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off) VALUES ('450DB4460A7449B0E0440003BA9ECAD1', "AGCR", "ON");

INSERT INTO nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off) VALUES ('450DB4460A7449B0E0440003BA9ECAD1', 'ALINT', 'ON');

INSERT INTO nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off) VALUES ('450DB4460A7449B0E0440003BA9ECAD1', "ARTR2", "ON");

INSERT INTO nrtx_taxa_list_items (txlstdef_cn_fk, symbol_fk, on_off) VALUES ('450DB4460A7449B0E0440003BA9ECAD1', 'CÉDI', 'ON');

Tags: Database

Similar Questions

  • How to fill out the customer type when you submit a form?

    How to fill out the customer type when you submit a form?

    You can't do right now in British Colombia by means of forms.

  • How to fill out the "to:" line with a variable email address?

    I'm new to coding and am not sure how to ask my question. I have a link in an 'Email' symbol that I would like to have the window open to a 'mailto', but there are several instances of that symbol on the timeline, each using a different email address. If the [symbol]. Email.Click code reads as follows:

    Window.Open ('mailto:'+ sym.getVariable = ("emailWindow"), "_self")

    and the line in the Stage.creationComplete code that is supposed to call the variable code reads:

    sym.getSymbol("Details_David").$("Email").html ("[email protected]" "").setVariable("emailWindow","[email protected]");

    With this code, the browser opens a window of mailto, but the ' to: ' line readings, "indefinite".

    Either in the [symbol]. Email code. Click, I have:

    Window.Open('mailto:"emailWindow"',"_self")

    without the "emailWindow" as the variable name, the "to:" line to the mailto line reads, "emailWindow".

    How to fill out the "to:" line with a variable email address?

    Otherwise, it works better:

    1)

    replace

    sym.getSymbol("Details_David").$("Email").html ("[email protected]").setVariable("emailWindow", "mailto:[email protected]");

    with

    sym.getSymbol("Details_David").$("Email").html ("[email protected]");

  • How to fill out the empty fields of a document downloaded from my email?

    I have the filliing problews in the blank spaces where my personal information is required.  It seems that I can read and save the document, do not fill the required spaces.  I need help

    Hi Atiimkwabena,

    I guess you are trying to fill out the PDF using Adobe Reader. (Correct me if I'm wrong)

    If so, this form can not be Reader rights enabled. Adobe Reader is a single PDF reading software is only meant to read and save a blank copy of the PDF. If you want to change something in the PDF file, then the creator has enable user rights (commonly called player to extend rights) so that you can save the completed PDF file. This can be done by Adobe Acrobat.

    I would ask you to kindly contact the author of the PDF file to allow the user rights and send it again.

    I hope this helps.

    Kind regards

    ~ Dominique

  • How to fill out the list of dynamic measurements

    Hello

    I create a dynamic action on a region by using a select list (item) (lov on table A).

    now the problem is that if the value in the selection list is present in the table B then must trigger the action.

    can someone tell me how to fill the column of values as the values in table B.

    I don't want to set the values manually.

    Thank you
    Little Foot

  • You can create a hidden page element that acts as an indicator of the condition "exists."
  • Create a D.A. say 'Set Hidden Page Item"that fires on the element of change o selection list, which is of type 'set Value' and uses a function body PLSQL to set the hidden page (the affected item) item, choose the item of list selection in the field 'referred to submit page '.
    Now the PLSQL block, can return 1/0 'TRUE' or 'FALSE' or 'Y' / ' not etc. Depending on whether the record exists in the other table (or whatever condition you have)

    Now when the selection list is changed, the hidden element would be set correctly by using this dynamic Action.

    So, to check if the element exists, we can use the value of the element of hidden after that page.

    You can do this either as another action True under the dynamic Action of "Set Hidden Page Item" itself (after the action SetValue True) and added a condition using the value of the hidden element
    or add another dynamic Action, fired when the hidden item is changed and when the value of the hidden element corresponds with that of your conidtion.

    Hope that I was clear enough.

  • How to fill out (display) values for several blocks in which there is no relationship between the blocks (tables).

    Hello.

    Is it possible to fill in the values (execute_query) several blocks where there is absolutely no relationship between the tables in the same form?

    There is no relationship between the tables. All are separate tables with different columns. None of the names of columns match

    & also the values of the columns do not match. I created blocks for all tables. When I click on run, only the first block of values (first picture) is filled.

    other values of block did not get filled. Is it possible to fill in the values for all of the blocks where there is not relationship, or when there is no master block?

    Is there something I can do for this? It is mandatory for me to put all the blocks in a single form.

    Help me, please. Please do not respond.

    Thank you.

    Create a key-EXEQRY-trigger on the block where 'throw you' the quers. In it, put something like

    GO_BLOCK ('BLOCK1');

    EXECUTE_QUERY;

    GO_BLOCK ('BLOCK2');

    EXECUTE_QUERY;

    ...

  • How to fill out the USER name in a [RESOLVED] text field

    Hi all

    Forms 10g (10.1.2.0.2), Windows XP
    In my form, I have 2 blocks.
    1 block with a single element, where we enter a value and press on enter (this place you block2 and run the query).
    Block 2 (tabular) will get the records. This block2 have now 3 columns (caseid, userid, date).

    Now when I insert a new record, I just need to get the caseid only. And username and date must be filled in automatically.
    I am able to fill in the date by setting the property Initial Value * $$DATETIME$ $* for the column.
    And I tried many ways to fill the username in the userid column without success.

    I am tired of something like that
    In *When-New-Item-Instance*
    
    if :System.Cursor_Item is null then
         :BLOCK2.userid := Get_Application_Property(USERNAME);
    else
         null;
    end if;
    /*In this case, I can navigate to to the last recrord w/o any changes in the fetced records
     and while inserting the new record, USERNAME doesn't populate.*/
    In *When-New-Record-Instance*
    
    declare
         v_dummy varchar2(15) := null;
    begin
         v_dummy := nvl(:system.cursor_value, null);
         Copy(to_char(v_dummy), :System.Cursor_Item);
         if :System.Cursor_Item is null then
              Copy(null, :System.Cursor_Item);
              :BLOCK2.userid := Get_Application_Property(USERNAME);
         else
              null;
         end if;
    end;
    /* Nothing populates into the userid item while inserting new record */
    Any help please...

    Use one

    :BLOCK2.userid:=GET_APPLICATION_PROPERTY(USERNAME);
    

    or

    :BLOCK2.userid:=USER;
    

    in a WHEN-CREATE-RECORD-trigger.

  • How cascade/fill out the value of a column in a table?

    Hello

    I am begging in the oracle apex,

    Now I use 5 Apex


    Capture.PNG

    I want to select when point items popup lov (1) ... I want to get auto fill in the balance column .


    Please help me with the steps...

    Thank you.



    Hi Amr Abdeen,

    Made some changes to the page not 34

    1. remove the code button to add a line

    $("#f03_0001").attr ("onchange", "javascript:f_fetch_balance (this)");

    It is not necessary.

    2. convert key lov Popup to popup lov (Query based)

    Now it's working.

    Please check and let me know if you have any questions.

    Kind regards

    Jitendra

  • How to fill out the name of the file to the file upload

    Hi team,

    I'm trying to fill in the name of the file that is selected in the Explorer of files to other filed(text field) in the same region (dynamically when the file is selected). Is there a way to do this?

    Thank you

    Jyo

    Hi, Jyo

    Create a dynamic Action with the following parameters:

    Event: change

    Selection type: point

    Article (s):

    By this DA you can set the value of another element in your page. File name, in that you can get

    • using jQuery: dittos var = $("#P1_FILE_BROWSE").val)
    • without jQuery: dittos var = document.getElementById("P1_FILE_BROWSE");
  • How to fill out the database in the drop-down list box

    Hi all, I want to display all the data in database (c_type) column in the drop-down list box, how can I do?

    I use form 6i.

    Sorry if the question is already exist in the forum...

    Kind regards

    Maybe this helps http://andreas.weiden.orcl.over-blog.de/article-28957008.html

  • How to fill out the list devices shared in the sidebar of finder

    The Finder sidebar shows no sharing and peripherals.  2 mac under v10.11.4, each set to share files and screens between them and set for the remote access connection.  Both on the same account iCloud.

    Try to make a remote access connection and cannot start without shared target device in the my sidebar of the Finder.

    Pls help.

    You have your preferences set Finder at? Finder > Preferences > sidebar > shared - all options are checked?

  • How to fill out the table foreign key to the primary key form

    Hi all

    I'm stuck in this problem for 3 days, and I'm about to research and implement solutions on the internet.

    I have two tables

    create table prim (a number primary key, b varchar2 (100));

    create table CHILD (a number references (a) prim, varchar2 (100)) c;

    I created a page for PRIM table.

    = page name form on PRIM2

    I have manually two columns for the CHILD table to know

    P26_A_1 (for the primary key in the CHILD table)

    P26_C (for the column in the CHILD Table c)

    now when the user clicks on the button CREATE, a row must be inserted into the child table.

    I want to assign the P26_A to P26_A_1 during the validation process, so that a line must be inserted into the PRIM table as well as in the CHILD table.

    How to do this?

    I downloaded my application page in https://apex.oracle.com

    my workspace identifiers are inferior to

    name of the workspace = IMBERT

    username = demo

    password = demo

    kindly guide me.

    Thank you.

    Hello

    I created a new page (page 30) similar to your page and added the insertion of the child. It just check the page and code. It works now, when you insert the prim file is triggered a second trial which inserts the child record manually.

    On page 26 it was some sort of mistake, was easier to create a new as it was almost a standard form.

    Concerning

    Bottom

  • showing a date of entry of the Recordset, how to fill out the dates does not appear?

    I've been several different directions on it, but it can work.

    I'm trying to list a date range as Nov 1-8 November, that is to say Nov1, 2, Nov3, etc., under each date show a COUNTY recordset for this date and if there is no record for this date, indicates 0.

    I have this sql

    mysql_select_db($database_connbubba, $connbubba);
    $query_rs_count = "SELECT yard_sales.yardsale_date,DATE_FORMAT(yard_sales.yardsale_date, '%b %d') AS theDate,COUNT(*) FROM yard_sales WHERE yard_sales.yardsale_date>=CURDATE() GROUP BY yard_sales.yardsale_date";
    $query_limit_rs_count = sprintf("%s LIMIT %d, %d", $query_rs_count, $startRow_rs_count, $maxRows_rs_count);
    $rs_count = mysql_query($query_limit_rs_count, $connbubba) or die(mysql_error());
    $row_rs_count = mysql_fetch_assoc($rs_count);
    


    user publishes their yard sales information in the db and the yardsale_date column is date YYYY-MM-DD

    with this configuration, so I have a table with 2 lines (rs_count.theDate and rs_count. COUNT) and the table is repeated horizontally.

    so the result is

    2 Nov6 Nov8

    1 yard Sale 2 Yard Sale 1 Yard Sale

    How can I get

    Nov2                 Nov3                   Nov4                 Nov5                   Nov6                      Nov7                  Nov8

    1 yard Sale 0 Yard Sales 0 Yard Sales 0 Yard sale Yard Sales 0 Yard Sale 1 Yard Sale 2

    Thanks for your help,

    Jim balthrop

    You cannot display the data that do not exist, so you must first create another calendar table which includes all the possible dates. You can then join this table to your main table. Pull on the dates of the calendar table and count the number of sales in your main table. To group the dates table.

  • How to fill out the Date and time in the OPS page CO

    Hi all

    How to generate the date current system (without using "select sysdate from dual"), in the controller OAF (processRequest) to an OAMessageDateFieldBean page?
    When I use the following code, the month is always displayed in January alone.
    In his display as a page OFA: January 26, 2009 15:46:30
    Using System.out.println: 2009-05-26 15:46:30.0

    Kindkly help me in this regard.

    Code
    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    SimpleDateFormat f = new SimpleDateFormat ("yyyy-mm-dd hh: mm :"); ")
    String dateString = am.getOADBTransaction () .getCurrentDBDate () m:System.NET.SocketAddress.ToString ();

    java.sql.Date sqlDate = new Date (f.parse (dateString) .getTime ());

    DateField OAMessageDateFieldBean =
    (OAMessageDateFieldBean) webBean.findIndexedChildRecursive ("currentDate");
    dateField.setValue (pageContext, sqlDate);

    System.out.println (am.getOADBTransaction () .getCurrentDBDate (). ToString());

    Kind regards
    Joe

    Hey Joe,

    Change the line of code...

    Of

    SimpleDateFormat f = new SimpleDateFormat ("yyyy-mm-dd hh: mm :"); ")

    TO

    SimpleDateFormat f = new SimpleDateFormat ("yyyy-MM-DD hh: mm :"); ")

    It will work...

    Thank you
    Anoop

  • How to fill out the story in entity object columns when creating a new line

    Hello

    I use Jdeveloper 12.1.3 to develop an ADF Application.

    My database table that has 4 columns of audit.

    CREATED_BY

    LAST_UPDATED_BY

    I added 2 new types story available under Tools-> Preferences->-> Types of history ADF business components.

    11. created by username

    12 modified by user name

    Where are these values be saved? which file will have these details of the story newly added columns.

    Note:-I'm trying to follow the blog by Jobinesh http://www.jobinesh.com/2011/02/creating-custom-history-types.html

    Also, in the method of getHistoryContextForAttribute(AttributeDefImpl attr) of CustomEntityImpl, how I'll call columns of type story newly created?

    Also, how can I distinguish if this event is create or update?

    See you soon

    AJ

    Hi AJ,.

    the entry is stored in the %JDEV_USER_HOME%\o.BC4J\jbo.properties file (in most cases %JDEV_USER_HOME%=%APPDATA%\Roaming\JDeveloper\system[YOUR JDEV VERSION] on windows machines)

    Greetings,

    Markus

Maybe you are looking for

  • Requirement of DNS and DHCP Server Essentials 2012 home

    I have a Server Windows Essentials 2012 acting as DNS and DHCP server with a domain name for backups etc on my home network. It's that everything works fine, no errors, no problem. Works well actually, telling me when the children did not install upd

  • Impossible to install programs with Windows Installer error

    I use a 32-bit version of Windows Vista Home Basic Service Pack 2 and I have problems with the update of Windows Installer, which in turn affects my attempt to install other programs. I tried to get the Windows Installer redistributable version but e

  • Difficulty of TrustedInstaller 880 directories - locking property Instructions for one at a time

    I've uploaded a directory from one media to another structure, and when I went to clean, I've locked saying me that I needed permission from TrustedInstaller.  There are instructions on how to change the owner and permission on a directory, but I alm

  • GLC-GE-100FX - connection to 3550 switch MMF

    Hello, I have an OM1 MMF fiber flow between two switches, the first being a 3750 and the second being a 3550. The link is currently greater than the maximum distance for OM1 @ 1000 Mb/s (220 m) so I would downgrade 100FX using the FPS needed link / G

  • AAA again of the different permissions

    In a previous post, I asked how I could assign RO permissions when a user connects to a firewall, but RW access when they connect to a switch, I was given a Cisco Ko to follow, but this only allows the user to be in a group RO or RW... I need the sam