Dynamically Updating Tables

So what I'm trying to do is have either an external script or an APEX function:
1) Find information on all of the current tables in database (schema, table, columns) which isn't hard, at the moment I have a script .
More importantly I need a way to (preferably automatically, maybe once a day, but manually is fine too)
2) update a table with that information
Is there a way to do this with PL/SQL? That would be ideal, but running an external script works. Looking around, the REST API might work? But I wasn't sure how or if it works for this.
Thanks!

Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and ensure you have updated with your profile with a real handle instead of "878859".
You'll get a faster, more effective response to your questions by including as much relevant information as possible upfront. This should usually include:
<li>Full APEX version
<li>Full DB version and edition
<li>Web server architecture (EPG, OHS or APEX listener)
<li>Browser(s)/version(s) used
<li>Theme
<li>Templates
<li>Region type
So what I'm trying to do is have either an external script or an APEX function:
1) Find information on all of the current tables in database (schema, table, columns) which isn't hard, at the moment I have a script .
More importantly I need a way to (preferably automatically, maybe once a day, but manually is fine too)
2) update a table with that informationWhy? What actual requirement is this intended to meet? What benefit would such a table provide over the existing data dictionary views?

Similar Messages

  • How can i dynamically update a table in my program?

    Hi there!
    I would like to know if anyone can assist me with advice on how to dynamically update
    a table within my program, with new values from the database?
    Thanking You all.

    Add rows to its model.
    Kind regards,
    Levi

  • Dynamic update  of cursor records when table gets updated

    Hi,
    I am having a table with 4 columns as mentioned below
    For a particular prod the value greater less than 5 should be rounded to 5 and value greater than 5 should be rounded to 10. And the rounded quantity should be adjusted with in a product starting with orderby of rank with in a prod else leave it
    Table1
    Col1     prod     value1     rank
    1     A     2     1          
    2     A     6     2
    3     A     5     3
    4     B     6     1
    5     B     3     2
    6     B     7     3
    7     C     4     1
    8     C     2     2
    9     C     1     3
    10     C     7     4
    Output
    Col1     prod     value1     rank
    1     A     5     1          
    2     A     5     2
    3     A     3     3
    4     B     10     1
    5     B     0     2
    6     B     6     3
    7     C     5     1
    8     C     5     2
    9     C     0     3
    10     C     4     4
    I have taken all the records in to a cursor. Once after rounding the request of 1st rank and adjusting the values of next rank is done. Trying to round the value for 2nd rank as done for 1st rank. Its not taking the recently updated value(i,e adjusted value in rounding of 1st rank).
    This is becoz of using a cursor having a value which is of old value.
    Is there any way to handle such scenario's where cursor records gets dynamically updated when a table record is updated.
    Any help really appreciated.
    Thanks in Advance

    Hi,
    Below is the scenario. Which I am looking for.
    ITEM_ID(A)
    ITEM_ID Value Date
    A          3     D1     
    A          5     D2
    A          3     D3     
    A          5     D4
    A          3     D5     
    A          5     D6
    Rounding for Item A has to be done for the rows less then D2 and rounding value is
    x and value adjustment to be done from very next row.
    --For record D1 rounding to be done and value adjustment is to be done from D2 to till the end untill the adjustment value is 0.
    --For record D2 (updated value has to be taken from rounding which updated in D1 row rounding) and the adjustment has to be done from very next row D3 to till the end or adjustment value is o.
    --For D3 row onwards no rounding has to be done.
    ITEM_ID(B)
    B          7     D1     
    B          8     D2
    B          9     D3     
    B          5     D4
    B          4     D5     
    B          3     D6
    Rounding for Item has to be done for the rows less then D3 and rounding value is
    y and value adjustment to be done from very next row.
    --For record D1 rounding to be done and value adjustment is to be done from D2 to till the end untill the adjustment value is 0.
    --For record D2 (updated value has to be taken from rounding which updated in D1 row rounding) and the adjustment has to be done from very next row D3 to till the end or adjustment value is o.
    --For record D3 (updated value has to be taken from rounding which updated in D2 row rounding) and the adjustment has to be done from very next row D4 to till the end or adjustment value is o.
    --For D4 row onwards no rounding has to be done.
    Thanks in Advance
    Edited by: unique on Apr 16, 2010 11:20 PM

  • TSQL - Dynamic Query Case statment update issue - to update table by left shifting the rows

    Hi all
    I need an help on my tsql query in 2000 to fix the case statement.
    I have a table like shown below.
    On this table where ever I see PortID as 101 and 105 I need to remove it and shift the rows from right to left.
    ie on First row PortID1 is 101 so I need to remove it and replace it with PortId2 and similarly PortID2 replaced my PortID3 and so on.
    ie like on excel if you delete cell we need to shift the rows to left .
    I wrote an dynamic update statement i,m not sure on the assigning dynamic case statment.
    CREATE TABLE [TravelRank]
    [Destination] [varchar] (50) NULL,
    [PortID1] [int] NULL ,
    [Distance1] [int] NULL ,
    [Rating1] [int] NULL ,
    [PortID2] [int] NULL ,
    [Distance2] [int] NULL ,
    [Rating2] [int] NULL ,
    [PortID3] [int] NULL ,
    [Distance3] [int] NULL ,
    [Rating3] [int] NULL ,
    [PortID4] [int] NULL ,
    [Distance4] [int] NULL ,
    [Rating4] [int] NULL
    INSERT into [TravelRank]
    select 'Virgin Islands','101','10','5','102','20','5','103','31','5','109','41','5'
    Union all
    select 'Guinea','101','15','3','102','22','3','105','32','2','110','45','4'
    Union all
    select 'Benin ','102','12','4','106','28','4','104','33','3','109','48','2'
    Union all
    select 'Ecuador','102','18','5','101','29','5','108','34','1','111','45','5'
    Union all
    select 'Belarus ','103','17','4','105','24','4','108','45','4','112','46','3'
    Union all
    select 'Cook Islands','105','11','2','108','23','2','101','32','2','107','42','4'
    Here is my code to fix
    declare @SQL varchar(4000)
    declare @left varchar(1)
    declare @right varchar(1)
    select @left = '1',@right = '2'
    while @left < 4
    begin
    select @SQL = '
    update t1.PortID' + @left + ' = t2.PortID' + @right + '
    t1.Distance' + @left + ' = t2.Distance' + @right + '
    t1.Rating' + @left + ' = t2.Rating' + @right + '
    'case @left
    when '1' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+3 as varchar(1)) +'
    ' when '2' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + @left + ' = null '
    t1.Distance' + @left + ' = null '
    t1.Rating' + @left + ' = null '
    else '' end'
    from [TravelRank] t1
    inner join [TravelRank] t2
    on t1.destination = t2.destination
    where t1.PortID1 = 101'
    print @SQL
    -- exec (@SQL)
    select @left = cast(cast(@left as int) + 1 as varchar(1))
    , @right = cast(cast(@right as int) + 1 as varchar(1))
    end
    Thanks a lot in advance.

    declare @SQL varchar(4000)
    declare @left varchar(1)
    declare @right varchar(1)
    select @left = '1',@right = '2'
    while @left < 4
    begin
    select @SQL = '
    update t1.PortID' + @left + ' = t2.PortID' + @right + '
    t1.Distance' + @left + ' = t2.Distance' + @right + '
    t1.Rating' + @left + ' = t2.Rating' + @right + '
    '+CASE @left
    when '1' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+3 as varchar(1)) +'
    ' when '2' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + @left + ' = null '+
    ' t1.Distance' + @left + ' = null '+
    ' t1.Rating' + @left + ' = null '
    else '' END + '
    from [TravelRank] t1
    inner join [TravelRank] t2
    on t1.destination = t2.destination
    where t1.PortID1 = 101'
    print @SQL
    -- exec (@SQL)
    select @left = cast(cast(@left as int) + 1 as varchar(1))
    , @right = cast(cast(@right as int) + 1 as varchar(1))
    end
    You were missing a couple of concats. This runs now, but I'm not completely sure if it's the output you were expecting.

  • Dynamic update of column with values derived by formula on other table.

    i have 3 tables; table A,B and C
    table A has two columns (id and Quantity), based on the id value, the quantity value is computed using a formula on two rows (one from table B and the other from C).
    the formula is different for each id value.
    but after every month the quantity value has to be updated (because tables B & C get updated monthly).
    example. given id=1, quantity= select round((sum(h.col1)/sum(p.col1), 2) from B p, C h
    given id=2, quantity=select round((sum(col1)/sum(col3)), 2) from C
    so for every id the quantity is derived by a different formula, but the quantity value has to be recomputed every month.
    need help.

    1. update table a
    quantity = decode (id,1, <formul1>, id,2 , formula 2...)
    2. if you wanto schedule this as monthly task
    use dbms_job.submit
    send the above query to "What" parameter.

  • Problem with dynamic internal table updation

    Hello Folks,
      I created  a dynamic internal table
    CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = i_fieldcat
          IMPORTING
            ep_table                  = i_dyntab
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2.
    ASSIGN i_dyntab->* TO <f_dyntable>.
    and created a work area
    CREATE DATA wg_f_split LIKE LINE OF <f_dyntable>.
        ASSIGN wg_f_split->* TO <f_wg_dyntable>.
    My requirement is that , i have to loop a normal internal table and append those records to the filed symbol internal table.
    READ TABLE i_normal_itab INTO wg_split INDEX wl_rows-index.
          IF sy-subrc EQ 0.
            ASSIGN wg_split to <f_wg_dyntable>.
             APPEND <f_wg_dyntable> to <f_dyntable>.
           endif.
    here i am geeting dump as "MOVE src TO dst" ... i can get the data in the work area FSymbol but cannot append it in Internal table Field Symbol.. Please help..
    <Added code tags>
    Edited by: Suhas Saha on Aug 3, 2011 10:52 AM

    Hello Sandra,
    Thanks for the reply..
    First i tried  appending the normal work area to the fieldsymbol  internal table.
      append wg_split to <f_dyntable>
    This is hiting dump the same dump and so i created a fieldsymbol work area. ( <f_wg_dyntable>.)and tried to append the field symbol internal table with this work area. which is again giving the dump
    APPEND <f_wg_dyntable> to <f_dyntable>. ( Again a Dump)
    Edited by: Charan-SAP on Aug 2, 2011 9:40 PM
    Edited by: Charan-SAP on Aug 2, 2011 9:42 PM

  • Updating Table Columns Dynamically

    Hi Everybody,
    I have created the following procedure to update table columns, which are having 'N/A' to Null.
    PROCEDURE PRC_UPDATE_NA_TO_NULL (p_owner all_tables.owner%TYPE, p_table_name all_tables.table_name%TYPE DEFAULT NULL)
    IS
    TYPE tc_ref_cursor IS REF CURSOR;
    v_tc_ref_cursor tc_ref_cursor;
    TYPE nt_column_name IS TABLE OF all_tab_cols.column_name%TYPE;
    v_nt_column_name nt_column_name;
    v_table_name all_tables.table_name%TYPE;
    v_set_str VARCHAR2(4000);
    v_where_str VARCHAR2(4000);
    v_sql_stmt VARCHAR2(4000);
    BEGIN
    IF p_table_name IS NOT NULL THEN
    OPEN v_tc_ref_cursor FOR
    SELECT a.table_name
    FROM all_tables a
    WHERE a.owner = UPPER(p_owner)
    AND a.table_name = UPPER(p_table_name)
    ORDER BY a.table_name;
    ELSE
    OPEN v_tc_ref_cursor FOR
    SELECT a.table_name
    FROM all_tables a
    WHERE a.owner = UPPER(p_owner)
    ORDER BY a.table_name;
    END IF;
    LOOP
    DBMS_OUTPUT.PUT_LINE('Processing Owner : '||UPPER(p_owner)||'....');
    FETCH v_tc_ref_cursor INTO v_table_name;
    EXIT WHEN v_tc_ref_cursor%NOTFOUND;
    SELECT b.column_name
    BULK COLLECT INTO v_nt_column_name
    FROM all_tab_cols b
    WHERE b.owner = UPPER(p_owner)
    AND b.table_name = UPPER(v_table_name)
    AND b.nullable = 'Y'
    ORDER BY b.column_id;
    IF v_nt_column_name.LAST > 0 THEN
    DBMS_OUTPUT.PUT_LINE('Updating '||v_table_name||'....');
    FOR i IN v_nt_column_name.FIRST .. v_nt_column_name.LAST
    LOOP
    v_set_str := v_set_str||v_nt_column_name(i)||' := NULL, ';
    v_where_str := v_where_str||v_nt_column_name(i)||' = '||'''N/A'''||' OR ';
    END LOOP;
    v_set_str := RTRIM(TRIM(v_set_str),',');
    v_where_str := RTRIM(TRIM(v_where_str),'OR');
    v_sql_stmt := 'UPDATE '||v_table_name||' SET '||v_set_str||' WHERE '||v_where_str;
    EXECUTE IMMEDIATE v_sql_stmt;
    -- EXECUTE IMMEDIATE 'UPDATE '||v_table_name||' SET '||v_set_str||' WHERE '||v_where_str;
    -- EXECUTE IMMEDIATE 'UPDATE :1 SET :2 WHERE :3' USING v_table_name, v_set_str, v_where_str;
    COMMIT;
    v_set_str := NULL;
    v_where_str := NULL;
    DBMS_OUTPUT.PUT_LINE('Finished Updating '||v_table_name||'....');
    END IF;
    END LOOP;
    DBMS_OUTPUT.PUT_LINE('Process Over....');
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    DBMS_OUTPUT.PUT_LINE(SQLCODE||':'||SQLERRM);
    END;
    The problem I am facing is that the Execute Immediate statement is not working. I have used the Execute Immediate statement in 3 different ways given in the above procedure, but none of them works and the error comes to the Exception section.
    Kindly let me have your solutions.
    Thanks in advance,
    MAK

    This approach can be dangerous. You are currently trying to update all columns in the tables to null if any of the columns are 'N/A'. Your query does not exclude external tables which may not be updatable. Your other query does not exclude data types that can not include 'N/A' such as number. You might want to move your commit outside the loop as you may end up committing partial updates.
    You might try to capture the SQL that you are generating;
    create table t(col2 varchar2(4000));Then in your package;
    insert into t values(v_sql_stmt);
    -- EXECUTE IMMEDIATE v_sql_stmt;

  • How to create Dynamic internal table with columns also created dynamically.

    Hi All,
    Any info on how to create a dynamic internal table along with columns(fields) also to be created dynamically.
    My requirement is ..On the selection screen I enter the number of fields to be in the internal table which gets created dynamically.
    I had gone thru some posts on dynamic table creation,but could'nt find any on the dynamic field creation.
    Any suggestions pls?
    Thanks
    Nara

    I don't understand ...
    something like that ?
    *   Form P_MODIFY_HEADER.                                              *
    form p_modify_header.
      data : is_fieldcatalog type lvc_s_fcat ,
             v_count(2)      type n ,
             v_date          type d ,
             v_buff(30).
    * Update the fieldcatalog.
      loop at it_fieldcatalog into is_fieldcatalog.
        check is_fieldcatalog-fieldname+0(3) eq 'ABS' or
              is_fieldcatalog-fieldname+0(3) eq 'VAL' .
        move : is_fieldcatalog-fieldname+3(2) to v_count ,
               p_perb2+5(2)                   to v_date+4(2) ,
               p_perb2+0(4)                   to v_date+0(4) ,
               '01'                           to v_date+6(2) .
        v_count = v_count - 1.
        call function 'RE_ADD_MONTH_TO_DATE'
            exporting
              months        = v_count
              olddate       = v_date
            importing
              newdate       = v_date.
        if is_fieldcatalog-fieldname+0(3) eq 'ABS'.
          concatenate 'Quantité 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        else.
          concatenate 'Montant 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        endif.
        move : v_buff to is_fieldcatalog-scrtext_s ,
               v_buff to is_fieldcatalog-scrtext_m ,
               v_buff to is_fieldcatalog-scrtext_l ,
               v_buff to is_fieldcatalog-reptext .
        modify it_fieldcatalog from is_fieldcatalog.
      endloop.
    * Modify the fieldcatalog.
      call method obj_grid->set_frontend_fieldcatalog
           exporting it_fieldcatalog = it_fieldcatalog.
    * Refresh the display of the grid.
      call method obj_grid->refresh_table_display.
    endform.                     " P_MODIFY_HEADER

  • SET_TABLE_FOR_DISPLAY - Edited value from dynamic internal table need to be captured

    Hi all,
    I have created  2 tabstrip screns which contain ALV GRID DISPLAY  in a container with dynamic internal table and editable columns .I want to capture the edited value from this ALV GRID display.I have used SET_TABLE_FOR_DISPLAY  and for this dynamc internal table is passed which is Field symbol and editable columns have to be captured for further updation into another ztable.
    When i used check_changed_data  i am getting dump as field symbol not assigned.
    Below is the code :  How can i get edited column value from below code
    call method alv_list->set_table_for_first_display
        exporting
                is_layout                     = gs_layout
        changing
          it_outtab                     = <fs_dynamic_table>
          it_fieldcatalog               = it_fieldcat[]
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4.
      if sy-subrc <> 0.
    * Implement suitable error handling here
      endif.
    Kindly help me to solve this.
    With Thanks,
    Dina.

    please provide more info about the dump to try to help you
    as max said, it could be because the field symbol is not global and if its global maybe you are not refering well to the column
    i assume that you are using "ASSIGN COMPONENT comp OF STRUCTURE struc TO <fs>" to capture the value changed
    validate always the sy-subrc after the assignment.
    but the check changed data have parameters that have the old and new values
    please provide more info...
    Regards

  • Dynamically Updating Content Server Portlets

    [urlHi, I am currently having difficulty dynamically updating content server portlets.  I have a portlet of the following form:[/url]
    ArticleName Author Title Date mystory author1 title1 04/05/01
    story2 author2 title2 06/07/04
    story author3 title3 01/02/03
    So I have this table where each one of the line items is an article in the content server. So, for example the first line item is an article "mystory" by "author1", with title "title1" and date "04/05/01" additionally there is an article text field, but this isn't displayed unless I click on the article name.
    I can set up the basics of this portlet, but when I try to add any real functionality I run into one of two problems.
    First Problem: Passing Information
    I cannot find a way to pass information between content portlets. For instance, if the user would like to "re-sort" this table based on "date", I would like to have the user click on the "date" column heading and then reload the page. To do so, I would have to pass the section name back to the page so that it could resort based on this data. I have not found anyway to effectively pass information to a content server portlet. I am building these pages through use of the presentation template framework (so I can have access to the content items) but that seems to change the way portlets are handled.
    I got around this limitation with a regular portlet by creating an intermediary page which captures passed information and stores it to the session state. Once the information was in the session state, it is accessible to the portlet on the first page. However, this only works because remote portlets do not change their session id once loaded. Content Server portlets, on the other hand, change their session id after every reload of the browser or page change. I can send information from a content server portlet to an intermediary page, but I cannot send it back to the portlet because the session id has changed so I have no idea of knowing where to send the information. I can write it to a session state, but by the time I return to the portal page, the content server has changed its session id so it does not know where to look any longer.
    I suppose it would be possible to create an application state variable and append it with some static token (if there is some static variable per portal session) but I would rather not have to deal with application variables if at all possible.
    Second Problem: Dynamically Updating PCS Tags
    Even if I were able to the pass information back to my content server portlet, I run into another issue. The easiest way to sort content server items is using the filter command in the pcs:foreach tag. So, if I wanted to sort by author name, I could do something like the following <pcs:foreach var="item" expr="filter(folderByName('content'), filtered.name == '"name")" or something like that (the syntax may be incorrect, I just wrote this off the top of my head). However, it appears that the way the presentation templates are compiled goes in the order of PCS tags THEN JSP. So I would have no way of dynamically changing the variable on which I sort. For example, if I clicked on "Date" above in my table, I would like to be able to dynamically change my code so that I sort on date, and not name. I cannot find a solution to this problem.
    My workaround is to use the pcs tags to write out all the possible sortings to java array objects. This gives me access to the data on a JSP level and based on whatever the user will chose, I could then display that array. While this works, it is extremely ghetto and inefficient. Any help or suggestions would be fantastic.
    Thanks a lot,
    Jason Grauel

    You can use just about any javascript you want in any Content Server presentation template including ones that are used for portlets.
    However, you should be careful to name javascript functions and global variables uniquely so that they do not conflict with any other javascript on the page. To do this, you can append the item id to function and variable names, for example,
    function doSomething<pcs:value expr="pcs_id"></pcs:value>() {
    return true;
    Randy

  • To create a deep structure for dynamic internal table.

    Hello
    My ALV has fields which are defined dynamically during execution.
    so, i did it in the following way,
    Declared Field symbolds, DREF and fieldcatalog as,
    FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,
                  <fs_dyntable>.
    DATA:   dref_dyntab    TYPE REF TO data,
            dref_dynwa     TYPE REF TO data.
    DATA: ts_fieldcatalog TYPE lvc_t_fcat.
    DATA: wa_fieldcatalog TYPE lvc_s_fcat.
    Updated Fieldcatalog dynamically as,
    *function module to read segment structure
        CALL FUNCTION 'SEGMENT_READ'
          EXPORTING
            segmenttyp           = v_segment_name
          TABLES
            segmentstructure     = ts_seg_structure
          EXCEPTIONS
            no_authority         = 1
            segment_not_existing = 2
            OTHERS               = 3.
        IF sy-subrc <> 0.
          CASE sy-subrc.
            WHEN '1'.
              MESSAGE e024.
              STOP.
            WHEN '2'.
              MESSAGE e025 WITH v_segment_name.
              STOP.
            WHEN OTHERS.
              MESSAGE e023.
          ENDCASE.
        ENDIF.
    *FETCH FIELDS FROM STRUCTURE OF SEGMENT AND CREATE FIELDCATALOG FOR
    EACH FIELD OF SEGMENT (DYNAMIC FIELD CATALOG)
        LOOP AT ts_seg_structure INTO wa_seg_structure.
          ADD 1 TO v_counter.
          wa_fieldcatalog-fieldname = wa_seg_structure-fieldname.
          wa_fieldcatalog-col_pos   = v_counter.
          wa_fieldcatalog-ref_table = wa_seg_structure-segtyp.
          APPEND wa_fieldcatalog TO ts_fieldcatalog.
          CLEAR wa_fieldcatalog.
        ENDLOOP.
    and generated dynamic internal table using fieldcatalog as,
    *--Method to get the structure of table using fieldcatalog.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ts_fieldcatalog
        IMPORTING
    *--Variable of type REF TO DATA.
          ep_table        = dref_dyntab.
      IF sy-subrc <> 0.
        MESSAGE e023.
      ENDIF.
    *--Dynamic internal tables required when show segments selected
      IF p_selseg IS NOT INITIAL.
        ASSIGN dref_dyntab->* TO <t_dyntable>.
    *--Create dynamic work area and assign to FS
      CREATE DATA dref_dynwa LIKE LINE OF <t_dyntable>.
        ASSIGN dref_dynwa->* TO <fs_dyntable>.
    And then i populated this <t_dyntable> which is being passed as data-table to method
    CL_GUI_ALV_GRID => SET_TABLE_FOR_FIRST_DISPLAY
    for ALV grid Display along with above used filedcatalog ts_fieldcatalog.
    Things are fine till here, but now i have the requirement to edit selected rows of the ALV display..
    As you might be aware, we need a field
            TS_STYLEROW  TYPE lvc_t_styl, (i.e, a field of type 'h' and we can say as an internal table inside an internal table or else as a deep structure)
    in the output internal table <t_dyntable> to meet our requirement.
    My issue is about declaring one such field of type 'h' in this dynamically created internal table ''<t_dyntable>".
    I tried in the following way by adding one such field to fieldcatalog :
    *Field for Styling
      ADD 1 TO v_counter.
      wa_fieldcatalog-fieldname   = 'TS_STYLEROW'.
      wa_fieldcatalog-tabname     = 'TS_STYLE'.
      wa_fieldcatalog-col_pos     = v_counter.
      wa_fieldcatalog-no_out      = 'X'.
      wa_fieldcatalog-inttype     = 'h'.      " I even mentioned this
      APPEND wa_fieldcatalog TO ts_fieldcatalog.
      CLEAR  wa_fieldcatalog.
    But this is creating a field of type 'C' in the table <t_dyntable> instead of what i was expecting
    Guyz and respected,
    Please advice me with the solution or ur ideas....
    Note : The overall requirement is create a deep structure for dynamically generated internal table.
    Your help is highly appreciated and unforgettable..!!!!!!!

    hi,
    Dynamic append
    Dynamic internal table
    Dynamic internal table
    dynamic columns in ALV
    Variant for dynamic selection
    thanks

  • Dynamic UPDATE statement with parameters for column names.

    Hello,
    On this* website I read "The SQL string can contain placeholders for bind arguments, but bind values cannot be used to pass in the names of schema objects (table or column names). You may pass in numeric, date, and string expressions, but not a BOOLEAN or NULL literal value"
    On the other hand, in this Re: execute immediate with dynamic column name update and many other
    posts people use EXECUTE IMMEDIATE to create a dynamic UPDATE statement.
    dynSQL:='UPDATE CO_STAT2 CO SET CO.'||P_ENT_B_G_NAME||' = '||P_ENT_E_G_WE||'
    WHERE ST IN
    (SELECT ST FROM STG_CO_STAT2_TEST CO WHERE
    '||P_ST||' = CO.ST AND
    CO.'||P_ENT_E_G_NAME||' > '||P_ENT_E_G_WE||' AND
    CO.'||P_ENT_B_G_NAME||' < '||P_ENT_E_G_WE||');';
    EXECUTE IMMEDIATE dynSQL ;
    Since this statement is part of a Stored Procedure, I wont see the exact error but just get a ORA-06512.
    The compiling works fine and I use Oracle 11g.
    http://psoug.org/definition/EXECUTE_IMMEDIATE.htm

    OK I extracted from all of your posts so far that I have to use "bind-variables with :"
    From all the other tuorials and forums posts, I assume using the pipe is correct so I added those as well into the script:
    set serveroutput on format wraped;
    DECLARE
    dynSQL VARCHAR2(5000);
    P_ENT_E_G_NAME VARCHAR2 (100) :='test1'; P_ENT_E_G_WE VARCHAR2 (100) :='01.02.2012'; P_ENT_B_G_NAME VARCHAR2 (100) :='01.01.2012';
    P_ST                VARCHAR2 (100) :='32132';
    BEGIN
    dynSQL:= 'UPDATE CO_STAT2 CO SET CO.'||:P_ENT_B_G_NAME||' = '||:P_ENT_E_G_WE||'
                  WHERE ST IN (SELECT ST FROM STG_CO_STAT2_TEST CO WHERE
                  '||:P_ST||'                           = CO.ST                  AND
                  CO.'||:P_ENT_E_G_NAME||'     > '||:P_ENT_E_G_WE||' AND
                  CO.'||:P_ENT_B_G_NAME||'    
    < '||:P_ENT_E_G_WE||')';
    --this is somehow missing after the last < '||:P_ENT_E_G_WE||')';
    dbms_output.enable;
    dbms_output.put(dynSQL);
    --EXECUTE IMMEDIATE dynSQL;    
    END;Problem:I think I figured it out, the dates that I parse into the query need additional '

  • How to generate a dynamic update query to update error flag in a mapping?

    i have a mapping in which i m loading log table through generated parameter file.But i want to update the error flag using dynamic update query.for that i have to generate a query and use update sqloverridw in target instances.but i m not getting how to implement it.Please help..!!

    Hi  All, I have a scenario. Below is the source record. field1|field2|field3|field4|field5|field6|field7
    5|20150329|1|980100001|500|My name is Lalita|25
    5|20150329|1|303444442|200|My name is |Lalita.I work in TCS|26
    5|20150329|1|442101001|1000|My name is Lalita.I worked Syntel|56
    5|20150329|1|446788900|300|My name|67  My source file is | separator. But for field6 the data might come with '|'.
    So I want to import the data along with '|' after separating all field in Informatica Layer.  Source team is not going to preformat the file. Please suggest how to achive this.

  • Dynamic Update in real time with slider control

    We have requirements to display complex data in a graphical format. So far this has gone well by leveraging ADF and DVT components (dvt:Map, dvt:gauge, dvt:bargraph, af:tables, af:inputNumberSlider, etc.); however, we recently have been asked to add real-time animation of these controls over time. In brief, the user requires the ability to control the on-screen visualization of data by sliding the control on an af:inputNumberSlider (or equivalent) that represents a multi-month time scale. While sliding this control, the user expects to see the data visualization controls dynamically update in real time, keeping up with the rate at which the user moves the slider control. Think of this like a flip book animation where the slider controls the page the user is looking at and they can flip through the pages forwards or backwards at any desired speed. The time slider increments are one hour.
    Our current application architecture:
    Oracle ADF Fusion Web Application (v 11.1.1.5)
    EJB 3.0
    Eclipselink
    Oracle 11g
    Any kind of help is highly appreciated.
    Thanks,
    Mehabub

    Hi,
    the af:inputNumberSlider does not provide this functionality. Your alternative is a custom component (or any component that raises a client JS event) and call an af:serverListener in a custom event to send the notification to the server.
    Frank

  • Dynamic update of text from JTree manipulation

    Hi I working on an application that uses both a JTree and text view at the same time.
    What I want to do is everytime a node is added/edited/removed from the JTree the text for that node is dynamically updated in the tree view.
    At the moment what I do is everytime something is edited in the JTree the whole text is re-written. This is causing the program to slow down for large files.
    What I have thought of doing is producing the text for only the edited node, however this may affect others node, for example if a child node is added the parent node needs a closing tag.
    Is there anyway I could possibly do this?
    An alternative I had thought of was, because it is the syntax highlighting that is taking the time. I thought I could produce the full text for the edited tree then compare it to the pre-editted text. Then only sytax highlight the difference and add it to the text view. Would this be possible?
    Cheers Alex

    On 04 Apr 2007 in macromedia.dreamweaver.appdev, DrBlanston
    wrote:
    > I am trying to figure out a way to update certain fields
    on my ASP
    > pages based on input from different fields. For
    instance, I am
    > writing a program with an SQL 2005 database underneath.
    This
    > program takes data from fields that the user will input
    and needs to
    > update another field with a calculated result, then
    update the
    > database.
    >
    > Example,
    >
    > TaxRateField * SquareFootage = BilledAmount
    > (where all three of these fields are in the table)
    >
    > When a new record page is there for the end user, I want
    them to be
    > able to select a rate code (which has a
    factor/multiplyer associated
    > with it), then enter the Square footage, and have the
    > BilledAmount field automatically calculated. So when
    they hit the
    > submit button, all three values are inserted into the
    database.
    >
    > Any suggestions?
    Just enter the rate and the square footage; do the
    calculation when you
    pull the data from the database. In general, you don't want
    information stored in a database which depends on other
    information (ie
    calculated fields). The prime example is calculating an age
    when you
    get Date of Birth information.
    Joe Makowiec
    http://makowiec.net/
    Email:
    http://makowiec.net/contact.php

Maybe you are looking for

  • EMail and SMS problem

    hi  I just got a Blackberry Pearl. I configured it to receive my email. Now there is an email icon and all the email goes there. BUT it also started going into the folder that was the repository for SMS text messages. So someone told me to go into ge

  • Popup with window.open should arise only once onclick

    i want a popup that should arise only once onclick but i am getting that popup how many times i am clicking

  • Create a user programmatically  with OracleMembershipProvider

    Hi, I looked everywhere in the Oracle doc and in forums and there is no example how to do what's done above with the microsoft provider. MembershipCreateStatus status; string passwordQuestion = ""; string passwordAnswer = ""; MembershipUser newUser =

  • HELP!  WD Passport External Drive stopped being recognized by my Mac

    This happened out of the blue. It worked fine for 2 years. No problems. Then today when I plug it into my Mac, I hear it spin for about a minute but my Mac won't recognize it.  The drive doesn't show up at all, anywhere, including the Disc Utility. 

  • Anyone please explain these two router stats.

    Having a (hopefully) minor glitch at the moment with what seems like a stuck IP profile, main thread here. A couple of other questions though.  http://community.bt.com/t5/BB-in-Home/How-often-do-BT-reset-the-HH-remotely-and-should-it-effect-IP/... In