Update the table using discoverer

Hello

I'm trying to update a table whenever the user runs a report of the Office of the discoverer. I tried to use a function to do the job, but I get the error below.

ORA-14551: cannot perform the DML operation within a query.

I also tried to
1. create a procedure and update the table in this procedure.
2. function to create and call the procedure created earlier in this function and use it in the discoverer, but still does not work and I get the same error ORA-14551.

Please let me know if this is possible at all the. If SO, let me know the steps to do so.

Thank you.

Hello

Yes you can update the discoverer dashboards using a PL/SQL function. You must make the function a standalone transaction. for example

FUNCTION update_record (key_field VARCHAR2) RETURN VARCHAR2
IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
..
UPDATE your_table
..
COMMIT;
..

Rod West

Tags: Business Intelligence

Similar Questions

  • What API can be used to update the table cs_estimate_details (repair)

    I need to update the columns 'pricing_context' and 'pricing_attribute1' in the cs_estimate_details table.

    Which API can be used to update the columns. Where can I update the table directly?

    Try to use this "CS_Charge_Details_PVT" which in turn call "CS_ESTIMATE_DETAILS_PKG".

  • Update a table using the clause

    Hello

    I want to update a table using the selected values.

    Cases in the sample:


    create table as empsalary)

    Select 1 as empid, 0 in the wages of all the double union

    Select option 2, the double 0);

    Data update are as follows

    with saldata as

    (

    Select 1 as empid, 5000 as wages, 500 as double pf

    Union of all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    I tried the following query but does not work

    updated set of empsalary table (empid, salary) =

    (

    Select * from)

    with saldata as

    (

    Select 1 as empid, salary, 500 5000 as pf Union double all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    ) sl

    where sl.empid = empsalary.empid

    )

    I use oracle 10g.

    Help, please.

    Krishna Devi wrote:

    Hello

    I want to update a table using the selected values.

    Cases in the sample:

    create table as empsalary)

    Select 1 as empid, 0 in the wages of all the double union

    Select option 2, the double 0);

    Data update are as follows

    with saldata as

    (

    Select 1 as empid, 5000 as wages, 500 as double pf

    Union of all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    I tried the following query but does not work

    updated set of empsalary table (empid, salary) =

    (

    Select * from)

    with saldata as

    (

    Select 1 as empid, salary, 500 5000 as pf Union double all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    ) sl

    where sl.empid = empsalary.empid

    )

    I use oracle 10g.

    Help, please.

    Thanks for posting creates table and test data.

    The error message would have helped because it's pretty obvious that this is the problem:

    Update table empsalary

    *

    ERROR on line 1:

    ORA-00903: invalid table name

    Just remove the word "table".

  • Update of the data in the table using LAG/LEAD

    Hello!

    I have a table that looks like:

    CREATE TABLE CUSTOMER_INFO_TEST
    (
    ACCOUNT_NUM VARCHAR2 (40 BYTE),
    PHONE VARCHAR2 (100 BYTE),
    E-MAIL VARCHAR2 (300 BYTE),
    DATE OF START_DT,
    DATE OF CHANGE_DT,
    END_DT DATE
    );

    The example data:

    INSERT INTO CUSTOMER_INFO_TEST VALUES ('BOB', 555-1234', ", TO_DATE ('2011-01-01', 'YYYY-MM-DD'), TO_DATE ('2011-01-06', 'YYYY-MM-DD'), TO_DATE ('2011-01-10', 'YYYY-MM-DD'));
    INSERT INTO CUSTOMER_INFO_TEST VALUES ('BOB', 555-1234', ' BOB@GMAIL.) COM', TO_DATE ('2011-01-01', 'YYYY-MM-DD'), TO_DATE ('2011-01-11', 'YYYY-MM-DD'), NULL);
    INSERT INTO CUSTOMER_INFO_TEST VALUES ('BOB', 555-1234', ' BOB@GMAIL.) COM', TO_DATE ('2011-01-01', 'YYYY-MM-DD'), TO_DATE ('2011-01-15', 'YYYY-MM-DD'), NULL);
    INSERT INTO CUSTOMER_INFO_TEST VALUES ('JACK', 555-4321', ", TO_DATE ('01-03-2011', 'YYYY-MM-DD'), TO_DATE ('2011-03-06', 'DD-MM-YYYY'), NULL);
    INSERT INTO CUSTOMER_INFO_TEST VALUES ('JACK', 555-4321', ' JACK@GMAIL.) COM', TO_DATE ('01-03-2011', 'YYYY-MM-DD'), TO_DATE ('2011-03-11', 'YYYY-MM-DD'), NULL);

    My question:
    How can I configure end_dt (if null), to the next change_dt minus one

    It shows what I want to do:

    Select the rowid, account_num, phone, e-mail, start_dt, change_dt, end_dt, nvl (end_dt, lead (change_dt-1, 1) over (partition by account_num of start_dt order)) enddt CUSTOMER_INFO_TEST where end_dt is null;

    So, I want to update the table itself with the date in enddt. But how do I do this?

    This must be done in a single statement...

    Thanks in advance

    Richard

    Published by: user6702107 on 05-Jan-2011 09:11

    Edited by: Rydman on April 17, 2012 15:01

    Please post sample data!
    If your query returns the desired results, you can use the MERGE:

    SQL> select *
      2  from   customer_info_test;
    
    ACCOUNT_NU PHONE      EMAIL                     START_DT CHANGE_D END_DT
    ---------- ---------- ------------------------- -------- -------- --------
    BOB        555-1234                             01-01-11 06-01-11 10-01-11
    BOB        555-1234   [email protected]             01-01-11 11-01-11
    BOB        555-1234   [email protected]             01-01-11 15-01-11
    JACK       555-4321                             01-03-11 06-03-11
    JACK       555-4321   [email protected]            01-03-11 11-03-11
    
    5 rows selected.
    
    SQL> --
    SQL> merge into customer_info_test a
      2  using ( select rowid rid
      3          ,      nvl(end_dt, lead(change_dt-1, 1) over (partition by account_num order by start_dt)) new_end_dt
      4          from   customer_info_test
      5          where  end_dt is null
      6        ) b
      7  on (a.rowid = b.rid )
      8  when matched then update set a.end_dt = b.new_end_dt;
    
    4 rows merged.
    
    SQL> --
    SQL> select *
      2  from   customer_info_test;
    
    ACCOUNT_NU PHONE      EMAIL                     START_DT CHANGE_D END_DT
    ---------- ---------- ------------------------- -------- -------- --------
    BOB        555-1234                             01-01-11 06-01-11 10-01-11
    BOB        555-1234   [email protected]             01-01-11 11-01-11 14-01-11
    BOB        555-1234   [email protected]             01-01-11 15-01-11
    JACK       555-4321                             01-03-11 06-03-11 10-03-11
    JACK       555-4321   [email protected]            01-03-11 11-03-11
    
    5 rows selected.
    
  • How do I update the table in Jdev

    Hello

    I use Jdev 11.1.1.7.1.

    The control of data, I added that ADF only read the table. When I click on the button create and return to the report screen, highlight lines are added.

    Highlighted those who is not inserted into the DB table but he showed in the report. How to remove it. How can I update the table?

    Kindly advice me.

    Thank you

    Swathi

    That's what I got:

    -You have a table read-only, and a link to create.

    -When you press the link create a popup will be launched with a new record (may be a form in the same table iterator).

    -When you press save to save the changes validation triggers, stop you to insert the record.

    -After the fire of validation you will close the pop-up window (by pressing icon or by pressing Cancel).

    -After closure of the pop-up window, you will find that reading one table has some blank lines.

    If it is your problem if you have 2 choices:

    1. in the AppModule you can make a new instance on the view object (to which redirect the table) If your view object called 'EmployeesView', so, in AppModule, you should have EmployeeView1 and EmployeeView2 and your table may point to EmployeeView1, and when you create new line create in EmployeeView2 and after completing the creation you can run the query and then refresh the table (as shown in the following code).

    2 - the second option in the popup cancelListener link at the rear bean method then you can update the table by program as:

        DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("TableIteratorName"); // from pageDef.
        iter.getViewObject().executeQuery();
        RequestContext.getCurrentInstance().addPartialTarget(getTableComponent());// from table Binding property bind it to object in back bean
    
  • How to update the table with the number management

    Hello

    I need as there is a loc_tab of the created table as below,

    CREATE TABLE loc_tab
    (
    Country_ID NUMBER,
    country_code VARCHAR2 (3),
    country_name VARCHAR2 (50).
    State_ID NUMBER,
    state_code VARCHAR2 (3),
    state_name VARCHAR2 (50).
    city_id NUMBER,
    city_code VARCHAR2 (3),
    city_name VARCHAR2 (50)
    );

    I inserted records like below,
    COUNTRY_ID     COUNTRY_CODE     COUNTRY_NAME     STATE_ID     STATE_CODE     STATE_NAME     CITY_ID     CITY_CODE     CITY_NAME
    
              IND          INDIA                    TN          TAMIL NADU          CHN          CHENNAI
              IND          INDIA                    TN          TAMIL NADU          TRI          TRICHY
              IND          INDIA                    TN          TAMIL NADU          CMT          COIMBATORE
              IND          INDIA                    TN          TAMIL NADU          MDU          MADURAI
              IND          INDIA                    AP          ANDHRA PRADESH          HYD          HYDERABAD
              IND          INDIA                    AP          ANDHRA PRADESH          SEC          SECUNDRABAD
              AUS          AUSTRALIA               QLD          QUEENSLAND          BRI          BRISBANE
              AUS          AUSTRALIA               TAS          TASMANIA          HB          HOBART
              AUS          AUSTRALIA               TAS          TASMANIA          CCE          CITY OF CLEARANCE
              AUS          AUSTRALIA               TAS          TASMANIA          BUR          BURNIE
    Now, I wanted to update the table such that all ID columns are updated with running number.

    Each ID columns should get incremented so that, for Country_ID column corresponding to "India" If country_id is 1, that there must be one for all the lines with the name as "India". Likewise for "Australia".

    In the case of State, she also has the same logic with numbers repeated until the very name of the State comes.

    For the city, it of course will hold separate ID only because the name of the city will not get duplicated.

    This update must be done in the normal way using simple SQL such as no PLSQL don't like looping, etc... is involved.

    Here are the contents of the table, and that's how the table should be updated,
    COUNTRY_ID     COUNTRY_CODE     COUNTRY_NAME     STATE_ID     STATE_CODE     STATE_NAME     CITY_ID     CITY_CODE     CITY_NAME
                                            
    1          IND          INDIA          1          TN          TAMIL NADU     1     CHN          CHENNAI
    1          IND          INDIA          1          TN          TAMIL NADU     2     TRI          TRICHY
    1          IND          INDIA          1          TN          TAMIL NADU     3     CMT          COIMBATORE
    1          IND          INDIA          1          TN          TAMIL NADU     4     MDU          MADURAI
    1          IND          INDIA          2          AP          ANDHRA PRADESH     1     HYD          HYDERABAD
    1          IND          INDIA          2          AP          ANDHRA PRADESH     2     SEC          SECUNDRABAD
    2          AUS          AUSTRALIA     1          QLD          QUEENSLAND     1     BRI          BRISBANE
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     1     HB          HOBART
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     2     CCE          CITY OF CLEARANCE
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     3     BUR          BURNIE
    Thank you and best regards,
    Shiva
  • How to update the table when change list item in the classic report

    Hello
    I worked with apex 4.2 and I create normal classic report with list (named loved) select a column, now I want to update the table when the user changes the list with the new value, I can't create a dynamic action to do this, I create checkbox with the primary key and the loop for check point to update the table but I can not get the value of the list item. and for more speed, the user want to do it when changing the value from the list.

    My question
    1. how to do it in javascript and get the value of the list item and update the table with the new value
    2. do I have to use the API to create the list item so I can get the value of the report item or what.





    Thank you

    Ahmed

    You can find a lot of information in this forum (and outside in google) when you search for AJAX processes and demand. However, the tutorial in the link below should be useful:
    http://www.Oracle.com/WebFolder/technetwork/tutorials/OBE/DB/hol08/apexweb20/ajax_otn.htm

    BTW, if we answer your question, don't forget to mark the appropriate post as correct. It will help all of us in the forum.

  • Update the table on the dialog flow back task...

    Hi all

    I have a table. In a context menu of the table, a user uses a menu command to launch a workflow task merely as inline popup dialog box, which allows them to alter certain data associated with the selected line. It all works very well.

    What I'm trying to understand, that's how I trigger a refresh of partial page on the table once the workflow returned and the dialog box closes. I tried to call a support as target bean method of the "listener after" for the call activity of workflow that call the stubborn workflow, which calls AdfFacesContext.getCurrentInstance () .addPartialTarget (table), but which did not cause a refresh of the table. I waited a bit that would be the case.

    So, what event can I link at the right time in order to update the table?

    Thank you

    Hello

    When you open a workflow bounded in a small popup, then you use the earpiece back on the component that runs the pop-up window to refresh the table. On http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html, see example #69

    Frank

  • Update the Table with the push button

    Hi I want to update my table using the push button that requires a transfer of account

    For example a single account transactions into 2nd account


    I used this query, but his does not work

    Update of cb
    Set cb_acc_id =: block3.acc_id_target
    where
    cb_acc_id =: block3.acc_id_source;



    Concerning

    Wasim Ismail

    You may forgot to validate your update...

    BTW:
    your form will not recognize, you start a transaction and make an update in the database.

  • I want to update the verson using celluler data how is possible

    I want to update the verson using celluler data how is possible

    WiFi or iTunes > update the iOS on your iPhone, iPad or iPod touch - Apple Support software

  • Update the Table of Adf

    Hi all

    I have a page jspx, with a table and a button.

    Create the table data control, and it contains 4 columns

    (Name, card student, asked (Question or answer)).

    I create the code for the button to work

    1. Select a record

    2 send email

    3. when I send the request goes from Q to A

    All work fine. The mail has been sent. The demand for DB password Q has. But in my jspx table refreshes.

    Until I close and open again, it displays all the data.

    How cal I solve it?

    Thanks in advance

    Christos.

    Simply add partialTrigger on table pointing to the button.

    It will update the table when the button is clicked.

  • How to know the tables used in packages of a schema.

    How to know the tables used in packages of a pattern that I have connected.

    SELECT DISTINCT referenced_owner, referenced_name

    Of all_dependencies

    Owner WHERE = "MY_USER_NAME".

    AND type ('PACKAGE', 'BODY of PACKAGE')

    AND referenced_type = 'TABLE '.

  • How to insert image from mysql into the table using php and create the checkbox in the table?

    How can I insert image from mysql into the table using php and create the checkbox for each data as a vote? Here is my code...

    WELCOME

    connect_error) {die ("connection failed:".)} $conn-> connect_error); } $sql = "SELECT no, Calon, ID, of course, the Image OF THE candidates." $result = $conn-> Query; If ($resultat-> num_rows > 0) {echo ' '; export data of each line while ($row = $result-> fetch_assoc()) {"echo"}}
    NO Candidate INFO Vote
    " . $row ["no"]. "-" . $row ["Calon"]. "
    -" . $row ['ID']. "
    -" . $row ['class']. "
    "; } ECHO ' ' ;} else {echo '0 results' ;} $conn-> close();?} >

    hope someone can help me because I am a newbie in this program... need to finish this project... Thank you.

    If you have saved the file name in the database, it's pretty simple.

    echo '' . $row['description'] . '';
    

    Is the same for the box:

    echo '';
    

    If you have saved the image file in the database, it is much more complicated. I recommend you store only the file name in the database.

  • Update the table of contents, errors in bookmarks

    When I update my table of contenst, it creates errors in my favorites. I have a hierarchy of level three with my titles of paragraph in my table of contents. When I update the table of contents, it takes the last item in my lowest level and a level higher than it is actually.

    Any ideas of what is happening and how can I fix?

    OK, thanks to your last message, I began to explore the Table of contents dialog box and understood what the problem was. It had to do with the levels that I had assigned to the table of content items, which I was incompatible. Now I have the right levels assigned to the table of content items and it updated bookmarks perfectly!

    Thanks for your help.

  • Best way to update the images using PHP / MySQL?

    Hello
    I want to update the images using PHP/MySQL, so users can update their images and maybe a few others, but especially images.
    Thank you

    Hi, you can try this "How update an image in mysql"

Maybe you are looking for