Updating a table from tabular form using a process

Hi
I have a tabular from creating using wizard
I've a field called Last_updated_by in the table
the username is assigned to an item P2_user based on the user who logs in.
What I need is,when any row is updated, I need to update the last_updated column with value in p2_user.
Need help on this
I'm using apex 3.2 with 11g
tried the below
declare
idx number:=1;
begin
FOR i in 1 .. wwv_flow.g_f01.COUNT
LOOP
for j in idx .. wwv_flow.g_f02.count
loop
update table_name set last_updated_by=:p2_user where ID=APEX_APPLICATION.G_F02(j);
idx:=j+1;
end loop;
END LOOP;
end;
Its updating the table,but all the rows are getting updated,just not the selected rows.
Not sure what I'm doing wrong here
thanks
Archana
Edited by: Agowda on Jan 12, 2012 1:55 AM

I am looking for the same... can you please share how did you got this working
thanks

Similar Messages

  • Insert/update multiple tables from one form.

    I'm working on an app. that requires the user to fill out a form. The contents from the form is then used to either insert new records or update existing records in multiple tables. Is that possible? Can someone give a details example?

    You should create a form like you would create it having one table. Use row_id as primary key. The rest of the process are done by the triggers - those will take care of updating the right table depending which column was hit.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • A sticky problem updating fields on a tabular form

    I have an application where I'm trying to match skillset supply to skillset demand. We have resources and we have work for resources to do. Resources possess a set of skills. Work requires a set of skills. Skillsets are described by three fields: Domain, Target, Skill. So, we are able to capture the supply of skills in a table:
    RSRC_ID (FK to Resource table)
    DOMAIN
    TARGET
    SKILL
    PROFICIENCY  (this is the skill level 1 to 5)The relationship of resources to skill supply is 1 to many. Conversely, work demands skills, and so we capture skill demand in a table:
    WORK_ID (FK to Work table)
    DOMAIN
    TARGET
    SKILLThe relationship of work to skill demand is 1 to many also.
    Users assign skills to resources using a master-detail form. It works fine
    Users assign skills needed to work also using a master-detail form, and it works fine as well
    A view then joins the skillset supply to skillset demand so that assignments can be made only where supply and demand match. This view is used in the LOV below.
    The problem I have is that I am using a mapping table to capture assignments of work to resources or resources to work. It is a many to many mapping of work and resources with matching skillsets, and it looks like this:
    RSRC_ID  
    WORK_ID
    DOMAIN   (
    TARGET   ( These are the skillsets where demand equals supply and are derived from the view and presented in the LOV )
    SKILL      (I've created master-detail forms for the two types of assignments. An LOV in the detail form will present qualified resources or eligible work and then return the appropriate RSRC_ID or WORK_ID, but I must also populate the other three fields (DOMAIN, TARGET and SKILL) before I can insert or update the record. Here's the LOV from the form where resources are assigned to work:
    SELECT sed.domain||'.'||
           sed.target||'.'||
           sed.skill||'/'||
           sed.skill_prof||'  '||
           r.first_name||' '||
           r.last_name "d",
           r.rsrc_id "r"
    FROM   ri_resource r, ri_skill_supply_eq_demand sed
    WHERE  r.rsrc_id = sed.rsrc_id
    AND    sed.work_id = :P18_WORK_ID
    order by 1It is not enough to just match the work to the resource, we must record for what skillset they are matched. I can't seem to see an easy way to populate the three other fields in the tabular form using data that I can retrieve with the LOV.
    I am using APEX 4.1. Any help is appreciated.

    Hi Dan,
    Please could you replicate your problem on apex.oracle.com and share some developer credentials with us? It will be easier to demonstrate how this would be achievable.
    For this specific problem, you will need to re-create all your relevant DB objects and populate them with some sample data.
    Kind Regards, Pete

  • Query for create manual tabular form using apex collection using item textfield with autocomplete

    can we create a manual tabular form inside item textfield with autocomplete ?
    how it is possible?
    with Apex_item API used for this item.
    i used this code for creat  cascading select list
    select seq_id,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
            p_idx                       =>   1,
            p_value                     =>   c001,
            p_query                     =>   'SELECT C001 D
         , C002 R
      FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = ''col1''',
            p_attributes                =>   'style="width:150px" onchange="f__name(this,parseInt(#ROWNUM#));"',
            p_show_null                 =>   'Yes',
            p_null_value                =>   null,
            p_null_text                 =>   '- Select name -',
            p_item_id                   =>   'f01_'|| LPAD (ROWNUM, 4, '0'),
            p_item_label                =>   'Label for f01_#ROWNUM#',
            p_show_extra                =>   'NO') name,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
            p_idx                       =>   2,
            p_value                     =>   c002,
            p_query              =>   ' SELECT null d, null r FROM dual WHERE 1 = 2
            p_attributes                =>   'style="width:150px"',
            p_show_null                 =>   'Yes',
            p_null_value                =>   null,
            p_null_text                 =>   '- Select name -',
            p_item_id                   =>   'f02_'|| LPAD (ROWNUM, 4, '0'),
            p_item_label                =>   'Label for f02_#ROWNUM#',
            p_show_extra                =>   'NO')name2,
    from apex_collections
    where
    collection_name = 'COLLECTION1'
    It is fine .
    but i want item in tabular form  textfield with autocomplete and remove select list. my requirement is using textfield with autocomplete select a employee name and second item textfield with autocomplete display dependent perticular employee related multiple task.
    how it is created.i have no idea related textfield with autocomplete.Please help me....

    pt_user1
    I understand that the add row button is currently doing a submit.
    To not submit the page you need a dynamic action on the page.
    Does the javascript function addRow do what you want?
    Otherwise have a look at the following two threads Add row in manual tabular form using dynamic action and Accessing Tabular Form & Add Elements to Collection without Page Submit.
    You're process could be something like:
    Add the new values to the collection using the idea's in the second thread and at the same time add the new row.
    And as second action refresh your tabular form.
    If you get stuck set up what you have done on apex.oracle.com using the tables from the demo application.
    Nicolette

  • Creating tabular form using SQL query

    Hi,
    I need to create a tabular form using an SQL query so that multiple rows of a table are displayed on screen and are editable to the user.
    I have created this sort of form before using the Tabular Form wizard however for this form I need to enter SQL to produce it.
    The steps I take are:
    1. Create Page
    2. Page with Component
    3. Form
    4. Fow on a SQL query
    5. For the query I have: 'select * from depot_master_customer'
    However when I view the page, it just displays one blank field with the title '*' !!
    I am doing something completely wrong here? It seems like it should be a simple thing to do.
    Any help appreciated, this one is driving me mad.
    Thanks
    Simon

    Simon,
    You will need to manually create the tabular form and DML process. This is covered in detail in the How To document shown below:
    http://www.oracle.com/technology/products/database/htmldb/howtos/tabular_form.html
    Have you tried this yet?
    Good luck!
    Emilio.

  • Unable to delete row(s) from tabular form

    Hi!
    I created report with row selector, when I select one row I get tabular form regarding to the selected row from report. I can insert and update data from tabular form, but I have problem with deleting them. Error I get is ORA-01403: no data found (Row 207589)My tabular form is created by wizard and primary key is managed by database rowid, I use apex 4.1 an 10g database.
    Do you know for any solution for my problem?
    Regards,
    drama9346
    Add:
    For creating report and tabular form I use code and suggestion from this thread: {thread:id=2490862}
    Edited by: drama9346 on 28.1.2013 1:51

    Hi,
    I tried everything I know and I didn't solve my problem.
    Can anyone give me some clue?
    Regards,
    drama9346
    Add:
    I solve my problem.
    Edited by: drama9346 on 29.1.2013 1:52

  • Is it possible to update internal table from database table

    Hello All:
              I know how to update database table from internal table in one shot (batch) but is the reverse possible? Can I update some fields in an internal table from a database table in one shot (without looping) because my internal table is huge? Could you please provide me any ideas how to acheive something like this? Thanks in advance and answers will be rewarded.
    thanks.
    Mithun

    Hello my friend,
    You can do it MAYBE , i think you can reverse the update doing a ROLLBACK, but only after you update....not after the program finishes..
    To update some fields at once use:
    UPDATE DBTABLE FROM TABLE IT_TABLE
    Hope this helps!!
    Gabriel

  • Insert data into table from JSP page using Entity Beans(EJB 3.0)

    I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
    1. I have a table 'FRIENDS', (in Oracle 10g database).
    2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
    3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
    4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
    5. I am using JDev as editor.
    Please provide me code ASAP or link with similar example.
    Thank you.
    Anurag

    Hi,
    I am also trying that scenario. So u can
    Post the jsp form data to a Servlet which will act as a Controller.
    In the servlet invoke the business method.
    Similar kind of app is in www.roseindia.net
    Hope this would help u.
    Meanwhile if u get any optimal solution, pls post it.
    Thanks,
    Happy Java Coding.

  • FRM-41213 When calling report from a form using RUN_REPORT_OBJECT

    Hi,
    I get an error frm-41214:unable to connect to the report server when i am trying to call a report from a form using RUN_REPORT_OBJECT.
    My code is as follows:
    I have created a simple report using employee table such tht when i give the department number as parameter it should get the corresponding details along with that i also have highlited the system parameters:
    DESFORMAT
    DESNAME
    DESTYPE
    also other user parameters as
    p_action
    p_servername
    p_user_connect
    and in the before parameter form trigger the following code:
    function BeforePForm return boolean is
    vc_parameter_form VARCHAR2(4000);
    vc_hidden_runtime_values VARCHAR2(1000);
    vc_report_name VARCHAR2(100);
    begin
    IF (:P_ACTION = '_action_') THEN
         vc_hidden_runtime_values := '_hidden_';
    ELSE
         srw.get_report_name(vc_report_name);
              vc_hidden_runtime_values:='report='||vc_report_name||'&destype='||:destype||'&desformat='
    ||:desformat||'&userid='||:p_user_connect||'&server='||:p_servername;
    END IF;
    vc_parameter_form:='<html><body bgcolor="#ffffff"><form method=post action="'
    ||:P_ACTION||'">'||'<input name="hidden_run_parameters" type=hidden value="'
    ||vc_hidden_runtime_values||'">'||'<center><p><table border=0 cellspacing=0 cellpadding=0><tr><td>'
    ||'<input type=submit></td><td width=15><td><input type=reset></td>'||'</tr></table><p><hr><p>';
                        srw.set_before_form_html(srw.text_escape,vc_parameter_form);
    return (TRUE);
    end;
    After this i created a form with department table as my datablock:
    I created a report object in the form with name REPORT6.
    -Created a procedure in the form with the following code
    PROCEDURE RUN_REPORT_OBJECT_PROC(report_id REPORT_OBJECT,reportserver VARCHAR2,runformat VARCHAR2) IS
    report_message VARCHAR2(100);
    rep_status VARCHAR2(100);
    vc_user_name VARCHAR2(100);
    vc_user_password VARCHAR2(100);
    vc_user_connect VARCHAR2(100);
    vc_connect VARCHAR2(300);
    BEGIN
    vc_user_name:=get_application_property(username);
    vc_user_password:=get_application_property(password);
    vc_user_connect:=get_application_property(connect_string);
    vc_connect:=vc_user_name||'/'||vc_user_password||'@'||vc_user_connect;
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,BATCH);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,ASYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,runformat);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,reportserver);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'p_deptno='
    ||:Dept.Deptno
    ||' paramform=yes P_USER_CONNECT='
    ||vc_connect||' P_SERVERNAME='||reportserver
    ||' P_ACTION=http://iitv-1:8888/reports/rwservlet?');
    report_message:=run_report_object(report_id);
    rep_status := report_object_status(report_message);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')LOOP
    rep_status := report_object_status(report_message);
    END LOOP /* Wait for Report to be finished */;
    IF rep_status='FINISHED' then
    web.show_document('http://iitv-1:8888/reports/rwservlet/getjobid'||
    substr(report_message,instr(report_message,'_',-1)+1)||'?server'
    ||reportserver,'_blank');
    ELSE
    message (rep_status||' Report output aborted');
    END IF;
    END;
    I created a press button and in the when_button_pressed trigger i added the following code:
    declare
         repid REPORT_OBJECT;
         repserver VARCHAR2(100);
         runformat VARCHAR2(10);
    BEGIN
         repid := find_report_object('REPORT6');
         repserver := 'rep_iitv-1';
         runformat := 'HTML';
         run_report_object_proc(repid,repserver,runformat);
         END;
    Then tried to run the form but i got this error frm-41213 unable to connect to the report server.
    Any one please help me.

    Run_report_object can't work with forms9i
    Regards
    Vikas Singhal

  • Update cluster table from Web dynpro

    Hi
    I am trying to export data to a cluster table from web dynpro using this statement:
    EXPORT zhr_sanct_st100 FROM zhr_sanct_st100 TO DATABASE zhr_clrm(ep) ID zhr_clrm-srtfd.
    same piece of code work well if I include it in a report program through se38, but If I use it in Web dynpro, it doesnt update the cluster table and there is no error shown.
    please reply ASAP.
    Vishal kapoor

    Thanks for your immediate reply. it worked this way:
    IMPORT structure name TO structure name
      FROM DATABASE cluster table name
      TO wa_zhr_clrm
      ID zhr_clrm-srtfd.
    initially i missed to insert a work area wa_zhr_clrm, which has all the key fields of the cluster table.
    Regards
    Vishal Kapoor

  • Delete rows from Tabular form

    Hi,
    Anyone knows how dynamicly delete rows from Tabular Form (on button click, button is as item)?
    Thanks.

    I am in a great fix. We had a test instance.. and we had a version apex 3.2.. But when the same application has been uploaded to prod.. we used apex 4.0.Why on Earth would you do this? The whole point of the testing is to verify that the application will work in the production environment: the first requirement for this is that the test and production environments are equivalent.
    has any body is facing the same issue as mine..Yes, as is easily discovered by searching the forum...see Delete button doesn't work in tabular form after upgrade from APEX3.2 to 4.

  • Is it possible to export tables from diffrent schema using expdp?

    Hi,
    We can export tables from different schema using exp. Ex: exp user/pass file=sample.dmp log=sample.log tables=scott.dept,system.sales ...But
    Is it possible in expdp?
    Thanks in advance ..
    Thanks,

    Hi,
    you have to use "schemas=user1,user2 include=table:"in('table1,table2')" use parfileexpdp scott/tiger@db10g schemas=SCOTT include=TABLE:"IN ('EMP', 'DEPT')" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log{quote}
    I am not able to perform it using parfile also.Using parfile it shows "UDE-00010: multiple job modes requested, schema and tables."
    When trying the below, i get error
    {code}
    bash-3.00$ expdp directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=(\'MM\',\'MMM\') include=TABLE:\"IN\(\'EA_EET_TMP\',\'WS_DT\'\)\"
    Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 October, 2010 18:34:32
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Username: / as sysdba
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SYS"."SYS_EXPORT_SCHEMA_01": /******** AS SYSDBA directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=('MM','MMM') include=TABLE:"IN('EA_EET_TMP','WS_DT')"
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
    Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "MM"."EA_EET_TMP" 0 KB 0 rows
    ORA-39165: Schema MMM was not found.
    Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
    /export/home/nucleus/dump/test.dmp
    Job "SYS"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at 18:35:19
    {code}
    When checking expdp help=y shows :-
    {code}TABLES Identifies a list of tables to export - one schema only.{code}
    As per few testing,tables from different schemas are not possible to export using expdp in a single command.
    Anand

  • Hi, Bapi or function module to update RBCO table from an internal table.

    I have a requirement to  update RBCO table from an internal table.  is there any Bapi or function module  or any other method other than update, modify statements.
    Moderator message: Welcome to SCN!
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Jul 12, 2011 12:28 PM

    I don't know if any FM exists for your requirement. But you may like to copy it into a custom table and modify it according to your enterprise needs.

  • Query for create manual tabular form using apex collection add row button functionality

    Hello everyone
    My requirement is i created a tabular form manually using apex collection but if i click on add row button then previously selected data refreshed and added new row in this form it is fine.but i don't want to refreshed previously selected data and click on add row button then add new row .how it is possible? plz help
    Thanks & Regards,
    Ujwala

    Ujwala
    Instead of starting a new thread with the same question as Query for create manual tabular form using apex collection add row button functionality.
    Could you answer the question about what you see while debug the javascript code.
    If you don't understand the question or have trouble debug javascript let us know.
    Nicolette

  • Unable to Update Collection from Tabular Form

    I have built several Tabular Forms where I have updated the apex_collection with the data entered into the form. Then I loop thru the collection and update the database.
    I now Copy a working form to create a new form using data from a different table. All I am doing is changing the underly apec_collection with a different select statement and give it a new collection name. The number of columns on the tabular form are the same as the working form.
    Now I run the form and I get ORA-01403: no data found Error UNABLE to UPDATE ROWS
    It is acting like it is not finding any data from the collection. But I put in the same selection critera for the update into a report below the tabular form and I see data just fine.
    Here is the code I am using to update the collection when the SAVE button is pressed (Process on Submit before Calculations).
    begin
    for c1 in (
    select seq_id from apex_collections
    where collection_name = 'IPR_MATRIX' and c001 = :P21_FACILITY
    and c002 = :P21_DEPT
    order by seq_id) loop
    c := c+1;
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>5,p_attr_value=>wwv_flow.g_f01(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>6,p_attr_value=>wwv_flow.g_f02(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>7,p_attr_value=>wwv_flow.g_f03(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>8,p_attr_value=>wwv_flow.g_f04(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>9,p_attr_value=>wwv_flow.g_f05(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>10,p_attr_value=>wwv_flow.g_f06(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>11,p_attr_value=>wwv_flow.g_f07(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>12,p_attr_value=>wwv_flow.g_f08(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>13,p_attr_value=>wwv_flow.g_f09(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>14,p_attr_value=>wwv_flow.g_f10(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>15,p_attr_value=>wwv_flow.g_f11(c));
    apex_collection.update_member_attribute (p_collection_name=> 'IPR_MATRIX',
    p_seq=> c1.seq_id,p_attr_number =>16,p_attr_value=>wwv_flow.g_f12(c));
    end loop;
    end;
    Any Ideas what I am doing wrong?

    c is set to 0
    It looks like I may have found my problem.
    There tabular form is limited by a where clause in the report to a subset of the collection. Making the collection match the same where clause seems to have fixed my problem.
    Not clear on why that works like that but it looks like I may have it working.

Maybe you are looking for