Tabular Form- PL-SQL packages

Hi
I'm building apex application with pl-sql package, that's mean i encapsulate all my DML statements into this packages (for standardization purpose)
Now i want use the apex tabular from and make my DML statements throw my package not the automatic Dml which created by tabular form
is it possible?

You don't need to use collections if you don't want to save the values before they submit the page , for example, reloading the page after changes,adding multiple rows etc. You can also use your package to handle DML's with this approach(infact you cannot do it easily with builtin tabular forms) , here's a discussion on that : {message:id=9437137}.
As for the question of performance, a comparison between using a direct SQL query and collections approach has been done here : {message:id=9413326}.
But the collections method should compare to the builtin tabular form in performance, since it practically has to do the same steps(internally) and additionally always does a checksum comparison.
In any case, how many records are we talking about updating a the same time, you do know that any of these approaches _process only those records in the pagination page(ie the first 15 records fetches by default) and not on the whole result set_ ?
I would suggest you to get familiar with using this approach first before worrying too much about performance.

Similar Messages

  • 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.

  • HTML in SQL for tabular form

    I am trying to use HTML directly in SQL statement for tabular form (see SQL below). When the tabular form runs it is not converting the HTML so it displays as this:
    Manala<span style="color:blue;">pan</span>
    Am I missing something?
    select
    "PK_ID",
    "CODE",
    decode(instr(upper(city_name),upper(:P3_SEARCH)),
    0, city_name,
    substr(city_name,1,
    instr(upper(city_name),upper(:P3_SEARCH)) - 1)
    || '<span style="color:blue;">' ||
    substr(city_name, instr(upper(city_name),upper(:P3_SEARCH)),
    length (:P3_SEARCH))
    || '</span>' ||
    substr(city_name, instr(upper(city_name),upper(:P3_SEARCH)) + length(:P3_SEARCH) )) "CITY_NAME",
    "STATE_CODE"
    from "#OWNER#"."ZIP"
    where upper(city_name) like '%' || upper(:P3_SEARCH) || '%'

    Right. The HTML is correct but the only way it will display right is when I changed the field attribute to 'Standard Report Column'. Unfortunately, that removes the field from being a text field (input).

  • Dynamic Action On change tabular form question

    Hi guys!
    I've wanted to add dynamic action on change (tabular form) to execute PL/SQL which checks if column of the tabular form has changed and if yes it changes walue of text field to Y or N. It doesnt work...and I don't know why. If I create validation with this PL/SQL it works. Can you help?
    DA:
    On change - Tabular Form
    PL/SQL;
    DECLARE
       nazwa     VARCHAR2(4000);
       counter   NUMBER := 0;
    BEGIN
       FOR i IN 1 .. apex_application.g_f08.COUNT
       LOOP
        SELECT NAZWISKO INTO nazwa FROM SPR_META.M_UZYTKOWNICY WHERE NAZWA_UZYTKOWNIKA = apex_application.g_f02(i);
          IF wwv_flow_item.md5(nazwa) <>  wwv_flow_item.md5(apex_application.g_f08(i)) THEN
            counter := counter + 1;
          END IF;
       END LOOP;
       IF counter > 0 THEN
       :P5_IS_TABULAR_FORM_CHANGED := 'Y';
       ELSE
        :P5_IS_TABULAR_FORM_CHANGED := 'N';
      END IF;
    END;Page items to submit: P5_IS_TABULAR_FORM_CHANGE
    What's wrong?
    With regards,
    PsmakR

    Region static id shouldn be in bracketsYou missed the '#' informt of the region id.
    why my original PL/SQL process did not work
    FOR i IN 1 .. apex_application.g_f08.COUNTThis works only when the application array has values and that happens only when the page is submitted.When you submit the dynamic action , it isn't.
    This script combined with script to detect changes makes apex page running very slowIf you use that PLSQL code(assuming it works as expected) , then its going to take a server request every-time you change a field in the tabular form and loop though all the array values(if they would be submitted before) and recalculate and compare the checksums . Isn't that going to be very inefficient.
    As for that JS code, it only runs at the client side. You can do all the server side checks on submit, when the user expects some delay due to processing.

  • Tabular form with non base table field

    I want to develop a tabular form with
    1. A non-base table edit field to accept a value
    2. Insert/update another table based on the input value
    3. Also, computed field on each row based on other fields on the records (like post-query trigger in oracle forms at block level - for each row)
    Thanks,
    Rachna

    Thanks for your reply.
    Varad, I like the link you sent me. It has a lot of good information.
    I created a process (under page processing) called "Update/Insert Process" that dosn't seem to be working.
    Question, I created a manual tabular form with SQL Query and created a process (under page processing) called "Update/Insert Process", then I check for each record in the tabular form. If the old value <> new value then I update/insert in the new table.
    Any step by step will be highly apprciated - to create process/validation etc.
    Thanks,
    Rachna

  • Tabular form - how to insert the latest timestamp based on the action

    I am using tabular form(updatable sql report) to insert/update multiple values into one table. I have two data elements that is hidden from the user, Created_dt and Update_Dt.
    I need to insert Created_Dt with current system date value when new record is created and update Update_Dt when current record is updated. I need to implement similar logic for Created_By and Updated_By so I cannot use database trigger.
    I am not able to figure how to do this. Can someone please help me with it?
    Thanks!

    Sample trigger showing how to store date/time and user id of who changes a row:
    CREATE OR REPLACE TRIGGER  "gartner_USER_REPOSITORY_T1" BEFORE INSERT OR UPDATE ON  "GARTNER_USER_REPOSITORY" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW begin
       begin
          if inserting then
             if :NEW.USER_ID is null then
               select gartner_User_Repository_SEQ.NEXTVAL into :NEW.USER_ID
               from dual;
             end if;
             IF :NEW.CREATED_BY IS NULL THEN
               :NEW.CREATED_ON := SYSDATE;
               :NEW.CREATED_BY := nvl(v('APP_USER'),USER);
             END IF;
          end if;
          if updating then
             :NEW.Modified_ON := SYSDATE;
             :NEW.Modified_BY := nvl(v('APP_USER'),USER);
          end if;
       end;
    end;
    ALTER TRIGGER  "gartner_USER_REPOSITORY_T1" ENABLE
    /Thank you,
    Tony Miller
    Webster, TX
    You can get more with a kind word and a two-by-four than you can with just a kind word
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Using a custom PL/SQL to populate the primary key in a tabular form

    I want to use a Custom PL/SQL Function to populate the primary key when I insert a new record into a tabular form. I want to get the value from a hidden page Item. The code I am using for the primary key source is:
    BEGIN
    INSERT INTO TEAM_MEMBERS(TEAM_ID)
    VALUES(:P75_TEAM_ID);
    END;
    When I try to insert a new record I get the following error:
    Error      ERR-1904 Unable to compute item default: type = Function Body computation_type= BEGIN INSERT INTO TEAM_MEMBERS(TEAM_ID) VALUES(:P75_TEAM_ID); END; .
    ORA-06550: line 5, column 2: PLS-00103: Encountered the symbol ";" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "exit" was substit
    Any ideas what I am doing wrong?
    Thanks!

    Brian - Sometimes whitespace at the end of the block causes this. Be sure to trim everything after the last semicolon including tabs and newlines.
    Scott

  • How to use SQL function in Tabular Form

    Edited by: JuniorNewbi on 03-Nov-2009 08:15

    Hi
    I want to have a Tabular Form in which the Report Source sql statement is retrieved via an SQL function, so that the resulting report can show a variable number of columns and column names.
    The following great web site shows just the kind of thing i'm trying to do (Tabular Form Dynamic):
    http://htmldb.oracle.com/pls/otn/f?p=31517:195:518536699796436::NO:::
    However, as an Apex newbie, i don't know how to invoke the SQL function from within the page. The "Report Source" appears to only allow a static "select...." style of entry.
    I don't have access to the Denes Kubicek's workspace so don't know how he would have invoked his PL/SQL Function.
    Can anyone help?
    Thanks in advance!
    Edited by: JuniorNewbi on 03-Nov-2009 08:46

  • Setting the cell width in a Tabular Form (SQL Query (updateable report) )

    version 3.2.1
    I have a Tabular Form (SQL Query (updateable report) ) and I have a column that is a VARCHAR2(4000) that when displayed extends the cell to the full length (which of course makes sense).
    How can I set the width of this cell to something like 30 or 50 and wrap the contents?
    Thanks,
    Joe

    Scott,
    Thank you for replying.
    Your suggestion kinda worked. I say kinda because when the report is first displayed the cell is the full width and appears to ignore the width setting. There is a Select List on the report to restrict some of the data that is displayed. When a selection is made from this Select List, it appears that the cell width is then adjusted to what was set, but not for every selection from this Select List.
    I made the width entry in Tabular Form Element - Element Width
    Any idea why the width setting is ignored?
    Thanks,
    Joe

  • Executing a column which has a sql query in a tabular form

    Hi,
    I have a tabular form which contains a column named as SQL which has sql statements in it. Without going to the SQL workshop in Apex i want to execute that query in the tabular form itself. For that i've created a page item which fetches the particular rows sql query and created a button 'EXECUTE'. When i click the execute button it should run the query and should display whether the query is correct or not and should show the error message.
    Can any one provide solution for this or whether there are any other ways to achive this scenario.
    With Regards
    Balaji.P.K

    Balaji P.K wrote:
    Can any one provide solution for this or whether there are any other ways to achive this scenario.Difficult as we have no idea what this "scenario" actually is. Go back several steps and explain in detail the problem this is supposed to solve.
    I have a tabular form which contains a column named as SQLBad idea. <tt>SQL</tt> is a PL/SQL reserved word. Using any token from Oracle namespaces as a database identifier is confusing/problematic.
    which has sql statements in it.Why? Where does this SQL come from? What is the source of the tabular form?
    Without going to the SQL workshop in Apex i want to execute that query in the tabular form itself.Explain the "execute that query in the tabular form itself" concept. Where do the results go?

  • Tabular form last row not accessible through PL/SQL

    i am using apex 3.2
    I have created one tabular form for daily receipt of material.
    data get stared in table storereceipt. Now I have created one PL/SQL , it reads each row of tabular form one by one and update quantity of item in master table.
    begin
    FOR i IN 1 .. apex_application.g_f02.COUNT
    LOOP
    if apex_application.g_f12(i) != 'LOCK' then
    update inv_ms_item set qty = qty apex_application.g_f11(i)+ this row update quantity in another table
    where id = apex_application.g_f10(i);
    end if;
    END LOOP;
    end;
    problem arrives in last row, which was created blank with add row then data was entered and submit button was clicked.
    my pl/sql is called on click of submit button . it updates all items except on last row.
    remaining things works fine.
    if i create 5 rows with add row and click one more time. last row will be blank. now if i click submit then all rows get updated and as last row is blank i dont have to care about it.
    Edited by: TEJU on Oct 21, 2010 4:40 PM
    Edited by: TEJU on Oct 21, 2010 4:40 PM

    Hi ,
    Teju this is the major drawback in the apex 3.2 because if u see the length when there is only one record is present in the tabular form
    then the outpuyt u will get is undefined , but though the colum exists it wont .
    i have faced this problem , one thing u can do is use document.getElementByID method of java script
    first find out the length , that specifies how many rows are present then write a loop
    for 1=0 till i<=-tahta length
    document.getElemetByid('f01_00'+i)
    /* this will give u f01_001 ...this can be ur element 1 , f01_002 this will ur element two .
    I had already used it and its working fine...
    Regards,
    Nandini Thakur.

  • Calling User written pl/sql Packages from forms 9ias

    I want to call Pl/sql package (my own) from forms 9ias.
    Actaully i am upgrading my application forms 6i to 9ias forms.
    Please suggest me a solution.

    Same way as 6i. What is the problem ?

  • Forms based on PL/SQL Package

    Hi all
    I investigate Forms Blocks with DML Data Target Type = "Procedure". We want move business logic that is currently located in various row-level-triggers on the DB into PL/SQL-packages.
    I wonder if DML Returning Value really does not work when I insert the data through a Procedure. I found no statement about it in the documentation (clearly, it works only with DB 8i and newer, but we are on 11g now). The Signature of the PL/SQL Procedure for Insert
    procedure do_insert (p_tab_test in out tab_test) is...
    with it's in out parameter suggests somewhat Returning DML to work. I wonder if it should be possible to expand the Oracle-generated insert procedure like
    DECLARE
    bk_data PA_TEST.TAB_TEST;
    BEGIN
    PLSQL_TABLE.POPULATE_TABLE(bk_data, 'BLOCK2', PLSQL_TABLE.INSERT_RECORDS);
    PA_TEST.DO_INSERT(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'BLOCK2') ;     -- <-----------------------suggested new line
    END;

    I will try to clarify:
    My expectations:
    I make inserts into a DB-table using a PL/SQL Procedure. In the examples (e.g [http://www.dulcian.com/papers/ODTUG/2000/What-Do-You-Base-Your-Block-On.htm] ) ,with DML Data Target Type = Procedure, the table of records used to pass on the data to the package is declared as in-out parameter. So, if I
    - change the data in the table of records in the package during insert-processing (1)
    - and set the block property DML Returning Value to Yes (2)
    I expect forms to update the data in the block/items after the insert processing to reflect the changes made in step 1 (3)
    Every thing works well except (3).
    The Background:
    We've got an application with DML Data Target Type = Table with almost all blocks. There are a couple of DB-Triggers on these tables implementing business-logic, which we would like to transfer into packages (so change DML Data Target Type to Procedure). But the application uses Returning DML here and there, which seems not to work togethter with DML Data Target Type = Procedure. Before dropping this idea, I would like to be sure that this is not intended to work.
    It seems to me that if the insert-procedure generated by forms builder contained an additional line
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'BLOCK2');+
    at the end, this should work.
    Thank you for your effort
    Pascal

  • REquire a copy of SQL*Forms 3.0 package

    Any body please help me.
    We are getting a lot of inquiries about the migration from SQL*Forms 3.0 to Forms 6i. For this purpose we want to do
    a trial migration at our office.
    for doing this we want a copy of SQL*FORMS 3.0.
    Anybody can help me where we can get the SQL*Forms 3.0 package and how to get it.
    Thanks and regards
    Satish

    I've never done any database migration from 6 to 8i only from 7 to 8. But you can try to do this and see if it works. Try to export out one table from your Oracle 6 database as a trial and import that table into your Oracle 8i. If this works, you can export the whole database and re-import that into 8i. Of course, this is assuming that you want to change nothing in the schema. Most of the time we find that it is not really worthwhile doing a migration like that except for preserving historical data. We would normally import data and then transform it making full use of the new features offered by Oracle 8i.

  • How create tabular form using dynamic sql

    I have 50 tables and I need create application for support all these tables, I don't want to create 50 tubular regions.
    I want create list of tables; user pick one of them and I want generate dynamic tabular form for suppot.
    Is it possible?
    Thanks Mary

    Hi Mary,
    It is possible, but you would have to control everything manually. Have a look at: [http://apex.oracle.com/pls/otn/f?p=33642:252] - I've included instructions explaining how this has been created
    Andy

Maybe you are looking for