Tabular Form - want to add default to column

Hi I have a Tabular Form with 5 columns. I have an Item as one default.. no problem.
I want the default of another column to be the results from a PL/SQL Expression (as the available choice shows as being possible).
or the result of a select statement:
select count(*) +1 from my_table where x = :P3_id;
Anyone know how I can do it?
Thanks Bill

Hi Scott,
Haven't tried either because the selection of "Default Type" under "Tabular Form Element" has 3 choices:
No Default
Item (Application or Page Item Name)
PL/SQL Expression or Function
I selected PL/SQL Expression or Function but no textarea to write your PL/SQL block... or query...

Similar Messages

  • Tabular form - How to add a G_USER column?

    Hi All,
    I have a tabular form that shows records form a table. the form allows updates only, not inserts/deletes.
    I want to add a column to hold the user who last updated the record. I know I can use APEX_APPLICATION.G_USER function but I am not sure where to put it.
    I tried by creating a computation but it shows me only page items, since I am using tabular form the column is not a page item.
    Also, how can ensure to update only those rows who were actually updated by the user and not all rows that were displayed?
    Thanks

    Fabio,
    You can create a database trigger on the table, "when updating" ...
    :NEW.LAST_UPDATED_BY := nvl(v('APP_USER'), user);
    Scott

  • Want to add one new column in Report form

    Hi all,
    I have searched in forum but not able to find the answer.
    I want to add one new column in form 12KST1C. I have added one column PR commitment in left and saved the form, it is showing in form but when i am running the report again then pr commitment column which i have added in form is not coming in report.
    How to activate this form or column?
    Help me....in doing so...

    If you are copying the 12KST1C to Z12KST1C and executing the s_alr_8701333 report, you will not see the new column added to Z12KST1C
    With the new Form Z12KST1C, create a new Report Z12KST1C and assign a new TCODE. Also you have to select all rows and column of form Z12KST1C
    TCODE CJE5
    Select the form Z12KST1C
    Extras--Drildown display --Select Rows and columns
    Select the all colhmns by F9
    Hope this helps.
    Edited by: psconsultant on May 20, 2011 8:42 AM

  • I want to add image in column is it possible then how to add image in data base what data type we need to do

    I want to add image in column is it possible then how to add image in data base  what data type we need to give we required any casting  please show me one example
    jitendra

    Hi again,
    Several points that can help more:
    1. If you are working with Dot.Net, then I highly recommend read the first link that you got! This is nice and simple coding. Another option is this link which is even better in my opinion:
    http://www.dotnetgallery.com/kb/resource21-How-to-store-and-retrieve-images-from-SQL-server-database-using-aspnet.aspx
    2. As i mention above both link use the column's type image. There are several other option of working with Files. In most of my applications architecture I find that it is better to use a column which let us use any type of file and not an image column.
    In choosing the right column's type for your needs basically your fist question should be if if you want to store your data inside relational database environment or outside relational environment. It is a good idea to look for blogs on this issue. Next
    if you chose to store your data inside then you need to chose the right column type according to your server version. I highly recommend to look for blogs on the differences between those column's types: IMAGE, 
    Check those links:
    To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem
    http://research.microsoft.com/apps/pubs/default.aspx?id=64525
    FILESTREAM feature of SQL Server 2008
    http://msdn.microsoft.com/library/hh461480
    FileTables feature of SQL Server 2012
    http://technet.microsoft.com/en-us/library/ff929144.aspx
    Compare Options for Storing Blobs (SQL Server)
    http://technet.microsoft.com/en-us/library/hh403405.aspx
    Binary Large Object (Blob) Data (SQL Server)
    http://technet.microsoft.com/en-us/library/bb895234.aspx
    Managing BLOBs using SQL Server FileStream via EF and WCF streaming
    * Very nice tutorial!
    http://petermeinl.wordpress.com/2012/02/20/managing-blobs-using-sql-server-filestream-via-ef-and-wcf-streaming/
    [Personal Site] [Blog] [Facebook]

  • Clone Rows - Tabular form - Client side add rows

    Hello all,
    I feel in love with this particular Tabular form, http://htmldb.oracle.com/pls/otn/f?p=24317:49 because of the Capabilities it has to create a "clone row".
    a very advance feature I like a lot.
    The trouble is when I go under >Report> and select which columns I would like to view, some will be hidden with default values.
    the default values I would like to keep hidden are: a Time Stamp, and :APP_USER.
    So when the user decides to clone a row the first original row will stay intact with all the information including the hidden values, but as for the cloned rows the hidden values are missing.
    Is there something missing in the javascript that permits this from happening?
    Please Help.
    <script type="text/javascript">
    var g_this;
    function fn_delete(pThis)
    var l_tr=$x_UpTill(pThis,'TR');
    l_tr.parentNode.removeChild(l_tr);
    function fn_CloneRow(pThis){
    g_this=pThis;
    l_tr=$x_UpTill(pThis,'TR');
    l_table=$x_UpTill(l_tr,'TABLE');
    l_tbody=$x_UpTill(l_tr,'TBODY');
    l_clone=l_tr.cloneNode(true);
    html_RowHighlight(l_clone,"D0D0E0");
    l_inputs=l_clone.getElementsByTagName('input');
    for (var j=0;j<l_inputs.length;j++) {
    l_this=l_inputs[j];
    if (l_this.type=="hidden") l_this.value="";
    if (l_this.name=="fcs") l_this.value="zzzz";
    if (l_this.type=="checkbox") l_this.parentNode.removeChild(l_this);
    // Change Clone functionality to Delete
    var l_img=l_clone.getElementsByTagName('img')[0];
    l_img.src="/i/delete.gif";
    if (document.all) l_img.onclick=function(){fn_delete(this)};
    else l_img.setAttribute("onclick","fn_delete(this)");
    l_tbody.insertBefore(l_clone,l_tr.nextSibling?l_tr.nextSibling:l_tr);
    </script>

    I have't looked at the specific clone-row sample code you mentioned in your post, but just wanted to point out that we've introduced client-side add-row functionality in APEX 4.0, so if you're using this code to add new rows on the client-side, then using the built-in functionality might be easier. Of course if you actually want to get a copy of an existing row, that might not be sufficient. As for the MRU process, the way APEX identifies new rows is by looking at the primary key or ROWID column value, which needs to be NULL. APEX also looks at the apex_application.g_fcud array, which holds information for each row on whether to do an create, update or delete. This array was introduced in APEX 4.0, and that's what could potentially be causing your example to fail after the upgrade.
    Regards,
    Marc

  • Tabular Form - How to store in a column the User details (APP_USER)

    Hi all,
    I have let's say the following table:
    USER_COMMENTS(
    ID number primary key,
    COMMENT_TEXT varchar2(50),
    POSTED_BY_USER varchar2(50),
    DATE_POSTED date,
    UPDATED_BY_USER varchar2(50),
    DATE_UPDATED date)
    How do I, using a Tabular Form, get the USER details in the columns POSTED_BY_USER and UPDATED_BY_USER and the SYSDATE in DATE_UPDATED...
    I've tried the following:
    Created tabular form, all fields included. In Report Attributes > edit UPDATED_BY_USER > Display as Display as Text (saves state); Default Type: Item (application or page item); Default: APP_USER.
    It's not working.
    Thanks!
    Andrei

    It has to be a text field column type with source like the other updatable columns. You should hide that column and create a second of display as text if you want to show the content. Once this is done then you can use the default value and just type the item name there as you did:
    P1_ITEM
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Tabular form condition type value of item / column in expression 1

    Hi
    Question 1
    I was wondering if anyone can help with the necessary syntax so that I can set a Condition Type for a column in a Tabular Form.
    What I'm trying to do is show or hide a column based on the contents of another column in the same row for instance show column DETAIL or DETAIL_READ_ONLY if column READ_ONLY is set to 'Y'
    Value of item / column in expression 1 = #READ_ONLY# or READ_ONLY (alas neither works)
    Expression 2 = Y
    I can set all the DETAIL or DETAIL_READ_ONLY columns to either hide or show at the same time by
    Value of item / column in expression 1 = P100_READ_ONLY (works well but lacks granularity)
    Expression 2 = Y
    Question 2
    Are Tabular Forms such that all fuctionality has to be global, what effects one column must be the same for all
    I know that Oracle prefers that developers don't use tabular forms but they are usefull for data visability when setting up related data in the same table.
    e.g. surveys, questionnaires etc apps the web was made for
    Thanks
    Derek

    Hi Sandro
    Thanks for replying
    The problem I have is Tabular Forms
    Detail Text Detail Read Only Read only
    Event 1a Event 1b Y
    Event 2a Event 2b N
    Event 3a Event 3b Y
    What I want it to look like is
    Detail Text Detail Read Only Read only
    ___________Event 1b__________ Y
    Event 2a_____________________ N
    ___________Event 3b__________ Y
    This would mean that the Text Field containing Event 2 could be updated but the Display Only fields containing Event 1 and Event 3 cannot be changed.
    The trick is to be able to mix and match data types for the same data because Tabular Forms columns don't have a conditional read only choice.
    Sorry about the rudimentary diagram, but its the old 80 / 20 rule =>20 percent functional
    Edited by: derekf on 4/02/2013 17:50

  • Tabular form - how to auto populate a column with the user name

    Hi,
    I have a tabular form with 3 columns - (customer name, notes, user). my users are allowed to enter customer details in the notes section... as soon as the user completes notes section and save the form, I want "USER" field to be auto populate with the user name so that I may track activity by the user...
    Please advice how to accomplish it...
    thanks in advance

    Hi,
    After user saves the forms that means commit to the database, so you can simply write a trigger like:
    CREATE OR REPLACE TRIGGER "AUDIT"
    before insert or update on TABLE1
    for each row
    begin
    :new.user_field := nvl(v('APP_USER'),user);
    end;
    Regards,
    Aljaz
    Edited by: Aljaz on 4.3.2012 22:03

  • Tabular form - let end user hide/show columns

    I have been requested to create a tabular form, but end user should have ability to hide/show columns, also they should rename the column headers. So I have created a table with column name called "attribute1", attribute2", etc. Based on that table, create a tabular form, which has column header as "attrbute1", "attrbute2", etc. Now end user wants to rename attrbute1 as he wants. And he/she also wants to have a link called "hide/show" next to the column header, so end user can control which column they want to hide/show. It is so easy to do that control from developer side, however, shift that function to end user from front end seems very difficult to me. I have search around and haven't found any good solution yet. Please help. Thanks advance.

    Hi,
    Anyone, can help me with this scenario.
    Brgds,
    Mini

  • Tabular Form - Setting a default value just on first row.

    Hi all,
    how to set a tabular form default value only in the first row?
    When I click on "add row" I want the new row have a blank value.
    Thanks in advance.

    Hi,
    When you add a new row to the tabular form, any existing rows should be saved to the database. You can, therefore, check for the existence of such records and set the value of a hidden page item accordingly. The default value for a tabular form item can then be based on this hidden item.
    This can be done by setting the Source Used to "Always, ..." on the hidden item called, say, P1_DEPTNO_DEFAULT, and the Source to something like:
    DECLARE
    X NUMBER;
    BEGIN
    SELECT COUNT(*) INTO X FROM EMP WHERE DEPTNO = :P1_DEPTNO;
    IF X > 0 THEN
      RETURN '';
    ELSE
      RETURN :P1_DEPTNO;
    END IF;
    END;This is a "PL/SQL Function Body" Source Type.
    In this example, we are checking if there are any EMP records with a DEPTNO value that matches P1_DEPTNO. If there are, then the tabular form must contain at least one row already, so we return an empty string. If there are no records, the tabular form must be empty, so we return the P1_DEPTNO value.
    The Default settings on the DEPTNO column in the tabular form would then be:
    Default Type: Item (application or page item name)
    Default: P1_DEPTNO_DEFAULT
    Andy

  • Setting a Default Value within a Tabular Form

    Hi All,
    Using Apex 2.2.1
    Hoping someone can assist. I have the following two scenarios where I would like to set a default value to a column within a tabular form.
    Scenario One:
    Prior to actually displaying the tabular form on the page, I have a region on this page where I ask the user to select a Application No. first (using a Select List with Submit). Once this item, say P50_APP is set to a value, the Tabular Form region is then presented to the user by where I then allow them to enter certain information required using the 'Add Row' button. One of the columns within this tabular form also represents the Application No.
    My questions are:
    a) I have made the Application No. within the tabular form as a LOV, so when the user hits the 'Add Row' button, how can I set the initial value to P50_APP value using the 'Default Type and Default' items within the column?
    b) Since I am trying to achieve a master-detail type scenario here, if (a) above is not possible, if I hide the Application No. column within the tabular form, how can I set it to P50_APP when the user presses either the 'Add Row' or 'Submit' buttons?
    Scenario Two:
    Is it possible to pass a value from a tabular form, i.e a column within this tabular form on one page, to another tabular form column on a another page (when the user presses the 'Add Row' button) within the same application?
    For example, on page 50 I have the column #APP_NUMBER# passed onto page 60 which is another tabular form that also holds the same column name #APP_NUMBER# , so when the user on page 60 hits the 'Add Row' button, I would like the App Number column default to the one just passed over from page 50.
    Is this possible?
    Apologies if I am asking the same things in both scenarios - just want to make sure I understand MRUs.
    Thanks.
    Tony.

    Hi Andy,
    Thanks for getting back to me but I think you are referencing these default values in the wrong section.
    What I am actually trying to set is the value of a column within a tabular form to P50_APP and it seems to me that the only available options for setting default values on a tabular form column are by using:
    Default Type: which can be one of:
    No Default
    Item (application or page item name) or
    PL/SQL Expression or Function
    and then actual source is set against:
    Default:
    Unsure as to how to actually set the value of P50_APP which is in session to the individual tabular column mentioned above.
    FYI, I have tried selecting for Default Type: Item (application or page item name) and then specifying for Default:&P50_APP. as well as Default Type:PL/SQL Expression or Function and specifying for Default: :P50_APP but to no avail.
    Tony.

  • Using select list as default value in tabular form.

    Hi,
    I am using Application Express 4.1.0.00.32. I have two questions that are related.
    I have a Select item *'P1_SELECT'* and a tabular form My Items.
    Question 1. The My Items tabular form col1 Attributes are set Display As Text Field, and the Tabular Form Attributes are set Default Type = item(application or page item name), Default = P1_SELECT. I have checked the session state value is set on P1_SELECT ie. Fred. What I need to know is, why, when adding a row to the tabular form My Items does col1 not display 'Fred' as the default value from the select item P1_SELECT? I can change col1 of the Tabular form to be Display as Text (save state) and this will work. However that leads me on to:
    Question 2. After adding say 3 rows to the form, I then change the select P1_SELECT value to Bob and Bob is now set in session state on the P1_SELECT item, but when I again add row to the form the value Fred is still the value not Bob. It seems that the tabular form keeps the default value as Fred and not Bob. How can I get this to look or work like:
    col1_
    Fred
    Fred
    Fred
    Bob
    Your help is needed.
    Thanks.

    Howard (DBA in Training) wrote:
    Do you submit the page or set the value after changing the selection? If not, the display value seems to be Bob but the working value is still Fred. That's what you are seeing right? In the "Settings" section, what do you have for "Page Action when Value Changed". I've been using "Redirect and Set Value" because I was staying on the same page after the selection.
    Additional info which might be helpful (or NOT). ====================
    NOTE: I am just a novice's novice with APEX and I had much agony with Select Lists. It was challenging to have the Select List value displayed because there seem to be so many different sources of the Select List value, namely:
    1) the current value in the session state
    2) the value you can specify in "Source value or expression" in the "Source" section of the Select List item
    3) the value you can specify in the "Post Calculation Compution" in the "Source" section of the Select List item
    4) the value you can specify in the "Default value" of the "Default" section of the Select List item
    [Now, if I've misdescribed any of these, remember, this is from a novice's perspective.]
    It's like putting a clock (back) together. Get any of the pieces wrong and it will probably not work right.
    I had an addiitonal challenge in that I wanted the same Select List displayed on multiple pages and for the currently selected value (from the former page) to already be set on the new page when it was displayed. What fun!
    To see what I did here: http://apex.oracle.com/pls/apex/f?p=43250:101 login Dever/Ima9Dever
    Remember, I'm doing many things you will likely not need to do. I iniitalized the Select List for the first time it displayed. I copied the Select List value from old page to new page by storing it in an application item F217_SYS_NIC_NM.
    Best wishes,
    HowardHi Howard,
    You don't have submit the page for just setting one item's session state. you can use a Dynamic Action OR use Page Items to Submit property if available (this is available in various places such as sql region,chart region etc)
    In context to this question you don't have to do any of those..just see my example above
    Thanks

  • ReadOnly columns on Tabular Forms (Javascript?)

    I have a question in regaurds to tabular forms. I have a tabular form set up, working perfectly. However, I want to be able to make certain columns readonly upon adding the new row (clicking new row button).
    Scenario:
    1) Go to tabular form
    2) Click add row
    3) Once the new row apppears, the columns should all be read only columns (i.e. cant type in them)
    4) Exception: There is one column, a select list, that shouldn't be readonly.
    5) Depending on which value is selected from the select list, determines which columns will be editable, or un-read-only.
    - The last step is merely a conditional. The part that is plaguing me is accessing the actual columns of the tabular form. I'm not too sure how to go about this. Would I even have to make changes to the actual AddRow() function itsself?
    Thanks for any help in advance
    sincerely, #StillLearningApexGuy

    wOW,..this example works perfectly. My javascript/jquery is a little rusty but I should be able to tweak the example for my needs.
    Thanks for the example. I am in your debt
    Sincerely #GreatfulApexGuy

  • ADD ROW in tabular form with new max value for a certain field

    All,
    I have a tabular form with an 'ADD ROW'-button.
    When a row is added the field 'TemplateID' should get
    automatically a new value which is MAX from TEMPLATEID + 1.
    I would be very glad, if someone has a hint for me.
    Thanks in advance,
    lucio

    Hi
    the cause of not seeing the 'Default Item Field' is,
    that during creation of a 'Tabular Form' the column with the
    primary key doesn't get that feature, why so ever.
    I still hope that someone could give me a hint why that code isn't working:
    function SetNewID(vDBID)
    v_check = $v('P20_MAX_TEMPLATEID');
    pNd = $u_Carray(vDBID);
         for(var i=0;i<pNd.length;i++){
              var node = $x(pNd);
              node = $x_Check_For_Compound(pNd[i])
              var lTr = $x_UpTill(node,'TR');
    updateRow = lTr.rowIndex - 1;
    document.wwv_flow.f02[updateRow].value=$v(v_check)
    Many thanks in advance
    lucio                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Horizontal scroll bar in tabular form with columns freeze

    Hi All,
    I have a requirement where i have to create a tabular form in which the first three columns should be in freeze mode and it should have a horizontal scroll bar.
    with the help of Google i found an example [http://apex.oracle.com/pls/otn/f?p=267:46]
    I want the same thing as in the example but with first three columns in freeze mode
    But could not find out how to create this column freeze and horizontal scroll bar.
    Let me know if you have any idea on this
    Thanks in advance,
    Ananth

    Hi,
    It is easy to look at the page source and see what they have done
    if you search for var d1 = document.getElementById("d and d1 you see some javascript doing the magic.
    Thanks

Maybe you are looking for