SQL script to insert values into a table based on the type of user

Hello

I have a requirement where I need to insert (username, groupname) in a table based on the user name.

We have two types of user accounts:

(1) user name, which starts with "DV" example: "DVPATM."

regular user 2) example: 'PATM '.

If the user name begins with "DV" under instruction insert should kick in

insert into < tablename > (username, groupname) VALUES (< username > ' < groupname1 >).

otherwise below insert statement should kick in

insert into < tablename > (username, groupname) VALUES (< username > ' < groupname2 >).

I need to use SQL or stored only procedure.

Please suggest

Thanks in advance

All things being constant, you could use decode/case just for groupname by examining the first character t the user name, for example

insert into (username, groupname) VALUES (, (substr ( , 1, 2) the case when "DV" then else end));

Fixed edit: value for OTHERS, as noted by Frank

Tags: Database

Similar Questions

  • Gears - error when you try to insert values into a table with multiple columns

    Hello

    I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.

    I have:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?, ?)', [devName, devAge]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I get the error:

    net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.

    I use this reference: http://code.google.com/apis/gears/api_database.html

    Everything works if I have only one field as:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?)', [devName]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56

    Thank you

    Davy

    Yes, a SQLite database will persist between battery pulls.  The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.

    In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data.  This adds extra overhead fresh for the final, delete and insert first for a given table.  Instead, define and finalize your drawing before you create your table.  Once created, review the static schema.

    That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.

    See you soon,.

    Adam

  • table name not valid error when inserting values into a table

    I use the following statement to insert values into a table:

    curs. Execute ("INSERT INTO _ * '%s' * _ VALUES ((SELECT MAX (REC_ID) + 1 OF GSAP_MSG_IN), (SELECT MAX (gsap_msg_id) + 1 OF GSAP_MSG_IN), 'SHELLSAP', sysdate, '%s', EMPTY_BLOB(), 1, SYSDATE, EMPTY_BLOB (), SYSDATE)" %(*table_name*,file_extension)) ")

    whence table_name the following statement

    table_name = ' config.staging_db_tablesNames ['in_msgs]

    as I created a configuration file for all parameters that can change. The value of the table in the audit using a print command is correctly, but when put in the query above to run the insert statement gives an error. The following is the summary of comprehensive performance where you can see the table name as

    $ python gsapscnr.py
    Vote for the data files in/home/mh/inbox /...

    GSAP_MSG_IN
    Traceback (most recent call changed):
    File "gsapscnr.py", line 147, in it?
    poll_for_data()
    File "gsapscnr.py", line 86, in poll_for_data
    Sorter = load_details_first)
    File "gsapscnr.py", line 42, survey
    curs. Execute ("INSERT INTO '%s' VALUES ((SELECT MAX (REC_ID) + 1 OF GSAP_MSG_IN), (SELECT MAX (gsap_msg_id) + 1 OF GSAP_MSG_IN), 'SHELLSAP', sysdate, '%s', EMPTY_BLOB(), 1, SYSDATE, EMPTY_BLOB (), SYSDATE)" %(table_name,file_extension)) ")
    cx_Oracle.DatabaseError: ORA-00903: invalid table name

    Can anyone help with this problem please. I'm passing the value of the table in a bad way. Also if anyone can suggest a good tutorial for paythong programming using cx_Oracle.

    Concerning

    Print the SQL string that you establish, cut and paste it this output in SQL * more and see if it runs. This may show you that you should remove the single quotes around the name of the table %s in the Python file.

  • Problem inserting values into a table

    Hi all

    I'm newbe and I'm stack.
    I have a human tasks (model begun), which contains 4 input fields (all channels).
    I have a complex data type called Test, which is defined as 2 channel fileds (Description and result) and a registered number (test).
    I have a Test table, insiemiDiTest.
    What I want to do is to create 2 test object in the input fields and insert in the insiemiDiTest table, to then be able to use the loop to insert into the DB.
    Assume that the user insert the following information in the filed entry:
    INPUT1 descrTest1
    ResultTest1-INPUT2
    INPUT3 descrTest2
    INPUT4 resultTest2
    I want to play in the process of the insiemiDiTest variable of length 2 and the following content:
    insiemiDiTest [1] .testNumber = 1
    insiemiDiTest [1] .description = descrTest1
    insiemiDiTest [1] property = resultTest1
    insiemiDiTest [2] .testNumber = 2
    insiemiDiTest [2] .description = descrTest2
    insiemiDiTest [2] property = resultTest2

    If I use data binding and I have a link
    INPUT1 with .description insiemiDiTest [1]
    INPUT2 with property insiemiDiTest [1]
    Number('1') with .testNumber insiemiDiTest [1]
    I get an error saying that the insiemiDiTest [1] .description is empty and cannot be copied.

    Unfortunaly I can't directly use the table in the task of the user, because later I have to use the conversation when the calling process and we found I have limitation.
    I can get an indication on how to do it.
    I'm approccing in the right way or am I completely wrong?
    Thanks in advance and Merry Christmas.

    Because your input is coming from a few strings and not a table, you can just add a Script activity to your process and to define table of your target XSD using XML.

    To do this, you must add a Script to the activity-> click on "Data Associations"-> drag the icon above your target expression builder object on the right side (not the table but the table parent)-> open the XPath expression box in the Middle-> click 'XPath Exp' in the drop-down list at the top.

    I don't know what your XSD, but in the text below, I tried to show you the XML you need for this XPath expression using the values you provided.

    oraext:parseXML(concat('
    
      
        ','1','
        ',bpmn:getDataObject('descTest1'),'
        ',bpmn:getDataObject('resultTest1'),'
      
    
      
        ','2','
        ',bpmn:getDataObject('descTest2'),'
        ',bpmn:getDataObject('resultTest2'),'
      
    
    '))
    

    When I 'bpmn:getDataObject('...')', you should rather to insert your data object variables four your process chain.

    Hope this helps,
    Dan

  • How to insert values into a table

    Hello Experts,

    I would like to know if its possible to fill data in one table by performing a loop.

    I have the following table:
    Draw)
    NUMBER OF NUM,
    START_DATE DATE NOT NULL,
    END_DATE DATE NOT NULL,
    CHAR DEFAULT ACTIVE (1 BYTE) 'Y')

    Now my table must contain the foll:
    NUM start_date end_date active
    1 2010-01-23 21:00 30/01/2010 19:00 Y
    2 2010-01-30 21:00 02/06/2010 19:00 Y

    I have an initial date and the end_date is always (start_date + 7) and the beginning of the next by the previous end_date but time varies from 19:00 to 21:00.


    This is what I have at the moment, but I'm stuck out of
    CREATE SEQUENCE num_seq
    MINVALUE 1
    START WITH 1
    INCREMENT BY 1
    CACHE 10
    
    CREATE OR REPLACE procedure draw_date IS
    
    
    begin
    
    INSERT INTO draws
    (num,
    start_date ,
    end_date,
    active )
    VALUES
    (num_seq.nextval,
    ?,
    ?+7 days,
    Y);
    COMMIT;
    end;
    but I'm kind of stuck a bit for the date

    Thank you

    Hello

    You can try something like:

    INSERT INTO draws
    (num,
    start_date,
    end_date,
    active)
    with last_date as (select trunc(max(end_date)) dt from draws)
    select
    num_seq.nextval,
    last_date.dt + 21/24,
    last_date.dt +7 +19/24,
    'Y'
    from last_date;
    COMMIT;
    

    Untested code because I don't have the create table and insert orders... and I'm feeling lazy today.
    ;)

  • Insert values into a table from another table without duplicates

    Hello

    I have a table with a field called ID; This field has duplicate values of ID.

    Then I have an empty table B (with the same fields of the table A) and I want to insert the values of the ID (on the table) without duplicates.

    Can you help me?


    Thank you much in advance.

    Hello

    If your table has duplicate values, then you cannot add a UNIQUE constraint. In this case, you will need to use a roundabout way or remove duplicates before imposing the constraint. Hope it answers your question.

    see you soon

    VT

  • insert into the table based on the difference in line (or using less)

    Hello

    Oracle Version: 11g

    Operating system: Solaris 10.

    I was wondering if it is possible to insert data in a table based on the operator 'less' Please?

    We have a very large table in a database, we moved to a different database. The table is cleared by a line for a certain range of dates, and we wondered if it is possible to insert this line of data in the remote database using the difference of rank between the two tables.

    Here's the query that we are running:

    SELECT ID , TO_CHAR (creation_datetime, 'yyyy-mm-dd')
    from TABB10 
    where TO_CHAR (creation_datetime, 'yyyy-mm-dd')='2014-03-18' 
    minus 
    SELECT ID , TO_CHAR (creation_datetime, 'yyyy-mm-dd')
    from TABB10@TABB_LINK.APDB00 
    where TO_CHAR (creation_datetime, 'yyyy-mm-dd')='2014-03-18'
    

    TO_CHAR (CR ID

    ---------------------- ----------

    2.4111E + 17-18 / 03 / 2014

    Any ideas please?

    Thank you

    If I don't get me wrong, you can insert as below

    INSERT INTO REMOTE_TABLE@DBLINK

    SELECT ID, TO_CHAR (creation_datetime, "yyyy-mm-dd")

    of TABB10

    where TO_CHAR (creation_datetime, 'yyyy-mm-dd') ='' 2014-03-18

    less

    SELECT ID, TO_CHAR (creation_datetime, "yyyy-mm-dd")

    of TABB10@TABB_LINK. APDB00

    where TO_CHAR (creation_datetime, 'yyyy-mm-dd') ='' 2014-03-18

    Concerning

  • Doubt about inserting data into a table

    Hi all, when I try to insert data into a table through an anonymous block, the pl/sql block runs successfully, but the data are not get inserted. Can someone please tell me where I am doing wrong?
    SQL> DECLARE
      2
      3  V_A NUMBER;
      4
      5  V_B NUMBER;
      6
      7  v_message varchar2(25);
      8
      9
     10  BEGIN
     11
     12
     13  select regal.regal_inv_landed_cost_seq.NEXTVAL into V_A from dual ;
     14
     15  select regal.regal_inv_landed_cost_seq.currval into V_B from dual ;
     16
     17  INSERT INTO rcv_transactions_interface
     18  (
     19               INTERFACE_TRANSACTION_ID,
     20               HEADER_INTERFACE_ID,
     21               GROUP_ID,
     22               TRANSACTION_TYPE,
     23               TRANSACTION_DATE,
     24               PROCESSING_STATUS_CODE,
     25               PROCESSING_MODE_CODE,
     26               TRANSACTION_STATUS_CODE,
     27               QUANTITY,
     28               LAST_UPDATE_DATE,
     29               LAST_UPDATED_BY,
     30               CREATION_DATE,
     31               CREATED_BY,
     32               RECEIPT_SOURCE_CODE,
     33               DESTINATION_TYPE_CODE,
     34               AUTO_TRANSACT_CODE,
     35               SOURCE_DOCUMENT_CODE,
     36               UNIT_OF_MEASURE,
     37               ITEM_ID,
     38               UOM_CODE,
     39               EMPLOYEE_ID,
     40               SHIPMENT_HEADER_ID,
     41               SHIPMENT_LINE_ID,
     42               TO_ORGANIZATION_ID,
     43               SUBINVENTORY,
     44               FROM_ORGANIZATION_ID,
     45               FROM_SUBINVENTORY
     46  )
     47
     48  SELECT
     49       regal.regal_inv_landed_cost_seq.nextval,      --Interface_transaction_
    id
     50       V_A,                                          --Header Interface ID
     51       V_B,                                          --Group ID
     52       'Ship',                                       --Transaction Type
     53       sysdate,                                      --Transaction Date
     54       'PENDING',                                    --Processing Status Code
    
     55       'BATCH',                                      --Processing Mode Code
     56       'PENDING',                                    --Transaction Status Cod
    e
     57       lc.quantity_received,                          --Quantity
     58       lc.last_update_date,                          --last update date
     59       lc.last_updated_by,                           --last updated by
     60       sysdate,                                      --creation date
     61       lc.created_by,                                --created by
     62       'INVENTORY',                                  --Receipt source Code
     63       'INVENTORY',                                  --Destination Type Code
     64       'DELIVER' ,                                    --AUT Transact Code
     65       'INVENTORY',                                  --Source Document Code
     66        msi.primary_uom_code ,                       --Unit Of Measure
     67        msi.inventory_item_id,                        --Item ID
     68        msi.primary_unit_of_measure,                  --UOM COde
     69        fnd.user_id,
     70        V_A,                                         --Shipment Header ID
     71        V_B,                                         --SHipment Line ID
     72        82,                                           --To Organization ID
     73        'Brooklyn',                                     --Sub Inventory ID
     74        81,                                            --From Organization
     75        'Vessel'                                       --From Subinventory
     76
     77    FROM
     78       regal.regal_inv_landed_cost_tab lc,
     79       fnd_user fnd,
     80       mtl_system_items msi
     81
     82    WHERE
     83       lc.organization_id = msi.organization_id
     84       AND  lc.inventory_item_id = msi.inventory_item_id
     85       AND  lc.created_by = fnd.created_by;
     86
     87  commit;
     88  v_message := SQL%ROWCOUNT;
     89  dbms_output.put_line('v_message');
     90  END;
     91  /
    v_message
    
    PL/SQL procedure successfully completed.
    SQL> select * from rcv_transactions_interface;
    
    no rows selected
    Thanks in advance!

    There is no problem with inserting data!
    Only there is no data! This means that your select statement retrieves no rows.
    You can see the output of your program (0). This means that there where no line in the result set.

    Please check the output of your tax return independently:

    SELECT
    --        regal.regal_inv_landed_cost_seq.nextval,      --Interface_transaction_id
     --       V_A,                                          --Header Interface ID
    --        V_B,                                          --Group ID
            'Ship',                                       --Transaction Type
            sysdate,                                      --Transaction Date
            'PENDING',                                    --Processing Status Code
            'BATCH',                                      --Processing Mode Code
            'PENDING',                                    --Transaction Status Code
            lc.quantity_received,                          --Quantity
            lc.last_update_date,                          --last update date
            lc.last_updated_by,                           --last updated by
            sysdate,                                      --creation date
            lc.created_by,                                --created by
            'INVENTORY',                                  --Receipt source Code
            'INVENTORY',                                  --Destination Type Code
            'DELIVER' ,                                    --AUT Transact Code
            'INVENTORY',                                  --Source Document Code
             msi.primary_uom_code ,                       --Unit Of Measure
             msi.inventory_item_id,                        --Item ID
             msi.primary_unit_of_measure,                  --UOM COde
             fnd.user_id,
      --       V_A,                                         --Shipment Header ID
    --         V_B,                                         --SHipment Line ID
             82,                                           --To Organization ID
             'Brooklyn',                                     --Sub Inventory ID
             81,                                            --From Organization
             'Vessel'                                       --From Subinventory
         FROM
            regal.regal_inv_landed_cost_tab lc,
            fnd_user fnd,
            mtl_system_items msi
         WHERE
            lc.organization_id = msi.organization_id
            AND  lc.inventory_item_id = msi.inventory_item_id
            AND  lc.created_by = fnd.created_by;
    

    Published by: hm on 13.10.2011 23:19

    I removed the references of the sequence and the variables V_A and YaeUb.
    BTW: Why do you want to include V_A and YaeUb in two different columns?

    The use of sequences in your code seems a bit strange to me. But this has nothing to do with your question.

  • dbms_job. Submit insertion values in a table using stored procedure

    values are inserted into a table by using the stored procedure by using the sequence and creating a job to trigger after every 10 seconds...

    create table test (collar number);

    table created.

    create sequences seq_test
    start with 1
    Increment 1;

    order of creation.

    create or replace procedure sp_test is
    Start
    loop
    Insert into test values (seq_test.nextval);
    end loop;
    commit;
    end;

    created stored procedure

    Report the number of jobno;
    BEGIN
    DBMS_JOB. SUBMIT)
    jobs = >: jobno.
    This = > 'sp_test;',
    next_date = > TRUNC (SYSDATE + 1/1440).
    interval = > 'SYSDATE + 10/86400',.
    no_parse = > TRUE
    );
    COMMIT;
    END;

    stored procedure created successfully



    every thing is done, but why the feature is always wrong...
    Please help me

    Hello

    Lucien wrote:
    ...
    create or replace procedure sp_test is
    Start
    loop
    Insert into test values (seq_test.nextval);
    end loop;
    commit;
    end; ...

    Have you tested this procedure first? It has an infinite loop. If this is the case, it's inserting row after row in the table, but never to commit, because he never leaves the loop.

    It seems that what you posted is a much simplified version of what you really do. Simplify things for posting on this forum is a good idea, but this one is so simple that I don't see the point of it, so I can't offer a better way to do. Maybe you shouldn't have a loop in the process. Whatever you do, test it before you submit it as a job.

  • How to load the values into a table?

    In my jspx page, I have a combo and a table... Based on the values of the drop-down list, when I click on a button, I want to load the values into a table... The data in the table are from 5 database tables. I created a viewObject readonly... What to do to load the values from the table, I click on a button?

    Ensure that you have defined a variable to bind your view object.

    Read-only or not, this is what would make the Execute with action of parameters available.

    John

  • Is there an easy way to filter a 2D table based on the values in two fields?

    Y at - it an easy way to filter a 2D table based on the values of one of the fields. In my attached VI the output array has the following format:

    Ident Frame Type bytes TimeStamp data

    10:57:07.621 3AD00016 POUVEZ 8 0000000000000000 data frame

    10:57:07.622 3AD00017 CAN data frame 8 000005E000000000

    10:57:07.624 3AD00018 POUVEZ 8 0000000003300000 data frame

    10:57:07.625 2DC00000 POUVEZ 8 0000000000000000 data frame

    10:57:07.626 3AD00019 POUVEZ 4 0000030000000000 data frame

    I would like to delete all lines that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the data above the fourth row would be removed. The only way I can see to do this is to form a 1 d table. Is there a better approach?

    Thank you.

    Hi chuck72352,

    After you've sorted your data, you can use the function InRange. Combined with a "search in 1 table D", you get the range you really want.

    Mike

  • divide the table based on the number of lines

    Hello

    I am trying to split a table based on the number of lines and then treat.
    Say I have a TEST_XXX table that contains 50 lines, what I would do is.
    to access multiple lines of 10. How can we achieve this?

    What I thought is, once the table is created and the line are filled.
    Add a new column to the table and perform a procedure that inserts of 1 to 10 first lines
    and 2 to 10 lines and 3 to 10 next ranks... etc. Based on this, that we can treat
    the first set of lines then play next or etc...

    is there a better way to do it?

    Code to create the table:
    CREATE TABLE TEST_XXX
    (
      A_ID   VARCHAR2(10),
      B_ID   NUMBER,
      c_ID   VARCHAR2(10),
      D_ID   NUMBER
    )
    Code to add lines:

    DECLARE
    BEGIN
      FOR I IN 1..50
      LOOP
          INSERT INTO TEST_XXX VALUES('ABCDE',123,'ZYXWV',321);
      END LOOP;
      COMMIT;
    END;
    The original problem is, I have a huge table, and I write a sql query to process,
    When I treat him by selecting all the values in the table, it is very slow.
    But when I have treat small Coulon (say 100 rows), it works very well.
    That's how I got the approach described above in mind.

    You can use NTILE.

    See:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions101.htm#SQLRF00680
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:47910227585839

  • Records of BSE - flat at different DB tables based on the first field

    Hello

    I have a flat file that has records of six types of diff. There are six diff corresponding to each of these records in the DB tables. My requirement is each time a flatfile such intervenes, all records must be inserted to their corresponding tables based on their record identifiers.

    This is the same file:

    000 | SEC-U. S. - MF | 1234 | POPOC | 679. JANUARY 15, 2009 01:04:48 | SSS
    100. 226312 | 7130667 | JANUARY 13, 2009 03:05:21 | 0 | 27. NET STANDARD|1.5%/30 90. 90. 1.5 | 30. USD | N | 282954105 | SHELTON105 | ELANCE SSPF | BILL OF LIVONIA TO | 238. Setzer | Pamela | 9000 | 1234 | E||||||||||||| 105. 1234 | SEC-U. S. - MF | JANUARY 15, 2009 01:04:36 | 591785 | Pamela | Setzer | APPROVED | JANUARY 13, 2009 03:05:29 | N | N|||| N | OPEN | WE | JANUARY 13 09 | 1. N|||||||||||||||| Y|||| N | Y|||||||||| 7130667 980064 | New PO | ALL THE |
    200 | 1. 9000 | N | Each | EA | 221170-153731-0-1-4. 1. Mike Hopper | JANUARY 15, 2009 01:04:37 | MRO||||||||||||||||||||| 8011170000 | 7130667 | 18585180 | 1234 | JANUARY 13, 2009 03:05:21 | 226312 | 80.11.17.00.00 | 1. 10. REJECT | MISC7 | THERE | FIXED | OPEN | N|||||||||||||||
    300. 1. Each | January 15, 2009 04:00 | 9000 | 0 | 0 ||| N|||||||||||||||||| PRA-PRODUCTS | PRA | 4001 FAIRVIEW | SALEM | 97302 | WE | OR | 1-800-547-0252 | 7130667 | 18585180 | 16529041 | 1234 | JANUARY 13, 2009 03:05:21 | JANUARY 15, 2009 01:03:40 | 0 | 0 | 0 | PRA-PRODUCTS | 1. N|||||| N | N | 10. REJECT | NONE | N | 15. 30. WARNING | 0 | 100. PRA-PRODUCTS | STANDARD | CLOSED FOR THE RECEPTION. N|||||| 591785 | THERE | JANUARY 13 09 | N | P|||||||||||
    400. 1. 350. 7203. 60075 | 000 | 0000 | 2734. Petersen | Mary M | 9060 | Petersen | Mary M | 208037547 | PRA-PRODUCTS | 9000 | 0 | 7130667 | 18585180 | 16529041 | 1234 | JANUARY 13, 2009 03:05:21 | JANUARY 15, 2009 01:04:08 | 16930995 | 1. 9000 | 0 | 0 | 208037547 | 0 ||| FEES | SUPRA-PRODUITS INV ORG | 35072036007500000002734 | 10000002030000000000000 | 35072036007500000002734 | N | PRA-PRODUCTS | SALEM | 97302 | OR | FEES | N|||| N | N|||||||||| 0 | 0 | 0 |||
    100. 226355 | 7136890 | JANUARY 14, 2009 02:46:38 | 0 | 28. NET STANDARD|2%/20 45 | 45. 2. 20. USD | N | C25962101 | CLARK INC | TAMPA101 | OASIS | BILL of LIVONIA to | 9911 | furrow. Mary | 1100 | 1234 | E ||| [email protected] | OASIS | 101 | 1234 | SEC-U. S. - MF | January 15, 2009 01:04:34 | 590978 | Mary | Furrow. N/AN/A | APPROVED | JANUARY 14, 2009 02:46:45 | N | N|||| N | OPEN | WE | JANUARY 14 09 | 1. N|||||||||||||||| Y|||| N | Y||||||||| GESTPOA | 7136890 24772 | PO/reissue | ALL THE |
    200 | 1. 1100 | N | Each | EA | 1. Renewal of the agreement for fast calibration | JANUARY 15, 2009 01:04:37 | MRO||||||||||||||||||||| 7315210000 | 7136890 | 18596861 | 1234 | JANUARY 14, 2009 02:46:38 | 226355 | 73.15.21.00.00 | 1. 10. WARNING | FIXED | OPEN | N|||||||||||||||
    300. 1. Each | January 14, 2009 04:00 | 1100 | 0 | 0 ||| N|||||||||||||||||| GLOBAL HQTRS | 8985 town | Bradenton | 34202 | WE | FL | 7136890 | 18596861 | 16541696 | 1234 | JANUARY 14, 2009 02:46:38 | JANUARY 15, 2009 01:03:40 | 0 | 0 | 0 | GLOBAL HQTRS | 1. N|||||| N | THERE | 10. WARNING | WARNING | N | 15. 30. WARNING | 0 | 0 | GLOBAL | STANDARD | OPEN | N|||||||||||||||| THERE | JANUARY 14 09 | N | P|||||||||||
    400. 1. 200 | 2900 | 61090 | 300. 0000 | 0000 | Loparev | Brand | 14716 | Loparev | Brand | 218011185 | GLOBAL HQTRS | 1100 | 0 | 7136890 | 18596861 | 16541696 | 1234 | JANUARY 14, 2009 02:46:38 | JANUARY 15, 2009 01:04:32 | 16944101 | 1. 1100 | 0 | 0 | 218011185 | 0 ||| FEES | GLOBAL | 20029006109030000000000 | 10000002030000000000000 | 20029006109030000000000 | N | GLOBAL HQTRS | Bradenton | 34202 | FL | FEES | N|||| N | N|||||||||| 0 | 0 | 0 |||
    999 | SSS | 1234 | 88. 158. 158. 158

    Please suggest how can this be achieved?

    Thank you
    RV

    Published by: user10236075 on May 7, 2009 13:12

    You can use the DB adapter and the adapter will create it for you. The Assistant should walk you through it. You select the tables and relationships.

    I tend to use the PL/SQL instead of the insert / merge feature. It requires very strong skills of PL/SQL, but it offers some flexibility around formatting etc.

    Take a look at this post to implement the PL/SQL, you can see my example. Its creates the varrays for AQ, but all you need to worry.

    Re: Can I pass a pl/sql table as a parameter for a database adapter

    see you soon
    James

  • How to update the password on the other table based on the mod

    Hello

    I need to update the password for the other table based on the mod.

    I have two table 'user' and 'reset '.


    User:

    Username username password date_exp

    s232322 Bobby John sdds4545df4r 10/12/2010
    s454566 George Bill f444556gh76 07/14/2010
    s343466 Bill Clinton fgf54tyujkkkhj 06/12/2011
    .
    .
    .


    Reset:

    Series encrypt decrypt

    fgf5656fg 0 Watellemon
    1 dfggf5665 lime juice
    dfdffd545 2 applesalad
    3 54r4gggt airlines
    construction of 4 hg44hh63
    5 fgf4343yh security
    .
    .
    .

    How can I update the password of a table to another table "reset"?

    Ex: query

    Update user set password = (select Encrypt reset where mod (length (username), 10))


    If mod (length (username), 10) is 0, it should take series "0" encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 1, it should take serial '1' encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 2, it should take series '2' encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 3, it should take series '3' encrypt the password and update the password in the table "user".
    If mod (length (username), 10) is 4, it should take series '4' encrypt the password and update the password in the table "user".
    ....


    Please help me write an update query.




    Thank you
    Nihar

    Hi, Nihar,

    You almost had it! You just need to correlate the subquery for the main UPDATE statement, like this:

    UPDATE     user_table     u     -- USER is a built-in function; it's not a good table name
    SET     password = ( SELECT  encrypt
                   FROM    reset     -- RESET isn't a very good table name, either
                   WHERE   serial     = MOD ( LENGTH (u.username)
                                             , 10
                                   )
                 );
    
  • API to insert values into the table of apps

    Hello

    I created a table with front end applications. Creating columns and rows. Now, I want to insert values in different columns of the corresponding lines.
    Can you get it someone please let me know the API that I can use here to insert the column values?

    Kind regards!

    If you want to insert data in the standard table oracle, then you must use the api instead, then apply the insert statement, this api oracle used to check the validation of the company etc.

    Regarding the concern with regard to insert the date as you said, this is why you should use this api 'PAY_USER_COLUMN_INSTANCE_API' to insert data in pl/sql script.

Maybe you are looking for