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;

Similar Messages

  • How to create table columns dynamically ?

    Hi All,
    I am working on an SSRS report that will show sales in the past 5 years. If the user selected to view sales of past 3 years he will only see 3 columns. so How can I create table columns dynamically at run time and how can I make sure that their dimensions
    will adjust to fit the report page size.

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • Automatically updating table column in OBIEE

    Hi folks,
    I have a requirement for say i have to update a table column based on a condition, but this update should happen on daily basis (i mean it should be scheduled once daily) by checking if any records in that column meets the condition then update it
    example :- column='Pending' then update it with 'Approved' . As transactions records comes on daily into the table.OBIEE should check and update the row so next time it doesnt show this row as 'Pending' .
    I have thought of 2 approaches for this
    1) Through writeback it is possible to update but manually ( the issue is it cant be automated or scheduled on daily basis and update multiple records on a go)
    2) Writing a stored procedure or function for update, but how can i accomplish this procedure to be scheduled or run once daily.how to use it?
    Any thoughts on the above two points or any method you guys can think off.
    Any help is appreciated !
    Cheers,
    KK

    Kranthi,
    This shud be easy...
    - Create a direct database request...with Update Statement
    eg: Update table set col = 'Approved' where col = 'Pending'
    - Create an ibot using the above DDR and schedule it on daily basis.
    This will update the full table with new value on daily basis based on the condition

  • Updating table column

    Hi All,
         How can I update the column of a table?
    More precisely, I am having a table with five rows and five columns and I already put values
    in all by using the program.When user clicks a button, I have to show different values in
    each cells of my last column.
    Thanks
    priya.

    Hi Priya,
    Lets say that you have a view controller's context structure as follows...
    YBAPI_INPUT
    |_OUTPUT
      |_TABLE_NODE
        |_COLUMN1
        |_COLUMN2
        |_COLUMN3
        |_COLUMN4
        |_COLUMN5
    The follwoing code will help you in accessing values in the last row.
    for (int i = 0; i < wdContext.nodeYBAPI_INPUT().nodeOUTPUT().nodeTABLE_NODE().size(); i++) {
    wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeYBAPI_INPUT().nodeOUTPUT().nodeTABLE_NODE().getTABLE_NODEElementAt(i).setCOLUMN5("SET NEW VALUE HERE"));
    Hope this helps.
    Regards,
    Rekha Malavathu

  • How to control internal table columns dynamically based on input

    i have 2 fields in the selection screen - user and tcode
    we can give any number of tcodes as in put
    based on requirement i need to display all the tcodes belongs to one user in one row
    in other words
    the out put table columns should increase dynamically based on number of tcodes entered
    in the input
    how to do this?
    Edited by: tummala swapna on Apr 7, 2009 11:55 AM

    This may be useful to you..
    FIELD-SYMBOLS : <FS_TABLE> TYPE ANY TABLE.
    DATA: DREF TYPE REF TO DATA,
          WA_DREF TYPE REF TO DATA,
          DY_LINE TYPE REF TO DATA,
          ITAB_TYPE TYPE REF TO CL_ABAP_TABLEDESCR,
          WA_TYPE TYPE REF TO CL_ABAP_STRUCTDESCR,
          STRUCT_TYPE TYPE REF TO CL_ABAP_STRUCTDESCR,
          ELEM_TYPE TYPE REF TO CL_ABAP_ELEMDESCR,
          COMP_TAB TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE,
          COMP_FLD TYPE CL_ABAP_STRUCTDESCR=>COMPONENT,
          OTAB TYPE ABAP_SORTORDER_TAB,
          OLINE TYPE ABAP_SORTORDER.
    BEGIN DYNAMIC STRUCTURE FOR FINAL INTERNAL TABLE @@@@@@@@@@@@@@@@@@
    STRUCT_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME('table or structure name').
    COMP_TAB = STRUCT_TYPE->GET_COMPONENTS( ).
    STRUCT_TYPE = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
    ITAB_TYPE = CL_ABAP_TABLEDESCR=>CREATE( STRUCT_TYPE ).
    CREATE DATA DREF TYPE HANDLE ITAB_TYPE.
    ASSIGN DREF->* TO <FS_TABLE>.
    END DYNAMIC STRUCTURE FOR FINAL INTERNAL TABLE @@@@@@@@@@@@@@@@@@

  • How to add/remove table columns dynamically?

    Please help urgently!

    Don't access the view layout (UI element references) in action event handlers. You have to place this code in wdDoModifyView().
    In the action handler, store the information needed (e.g. table column ID, insertion position, whatever) in some context attribute or in some member variable of the view.
    In wdDoModifyView(), check if table modification should be done, get the table instance using view.getElement(<tableID>), use the IWDTable API to modify the table.
    Finally, reset the flag or configuration data indicating that the table should have been modified.
    This is not really elegant, but that's the way it is...
    Armin

  • Select table columns dynamically at runtime

    Hi All,
    I've the requirement where user wants to see report columns based on certain parameters.
    Report contains revenue data for range of periods for a transaction, and each period is a column in table (period starting from 01-JAN-2010 to 31-DEC-2020). All the transactions may not start and end at a same period. Now report need to be display only certain columns (periods) based on period range parameter.
    Ex: if trx_123 started in 01-JAN-2011 and ended in 31-MAR-2011 and trx_234 started in 01-FEB-2011 and ended in 31-JUL-2011. now the report output should display in following format.
    Trx Number   period_01-JAN-2011   period_01-FEB-2011   period_01-MAR-2011   period_01-APR-2011   period_01-MAY-2011  period_01-JUN-2011   period_01-JUL-2011
    trx_123                    100                           120                                  180                            
    trx_234                                                       50                                  100                                      80                                 20It should not display all the periods (columns) in table.
    Any suggestion on how to develop this report with dynamic columns (any reporting tool)?
    Thanks in advance!!

    Hi,
    You can do this type of report in Discoverer using a crosstab report. Having period data in separate columns makes this difficult and generally this is not good database design.
    You can get around the problem using a row generator. If you join the data to a row generator so that you have a single column containing the period data and a row for each item of period data then you can use the crosstab report to show only the periods that contain data.
    See this [url http://learndiscoverer.blogspot.com/2008/10/row-generators.html]link for more information on row generators.
    Rod West

  • Update table control dynamically

    Dear gurus,
    I have created a table control of my internal table "i_main" using Screen Painter's table control wizard. I have made all fields editable via double clicking the field, clicking Program, then Input = Possible.
    My i_main table and table control contains the following fields:
    hunit TYPE vekp-vpobjkey.
    printno TYPE i.
    groupno TYPE i.
    batch TYPE mseg-charg.
    qtyTYPE mseg-menge.
    After my program has populated i_main table control, I now want to manually override the contained values in i_main and my table control z_init. When I type in a new value for my quantity column, for example I change 22 to 5. It goes back to 22, and nothing happens.
    Any advice on what should I do to update fields of my table control, as well as i_main?
    Thank you very much!

    in pai event.
    loop at iternaltable.
    module move_to_table ON CHAIN-REQUEST.
    endloop.
    module move_TO_TABLE.
    MODIFY IT FROM WA_ZTBCTRL INDEX ZTBCTRL-CURRENT_LINE.
    ENDMODULE.

  • Fetch XML data stored in database table column dynamically

    Hi All,
    I am working as a SQL guy but never worked on XML in SQlbefore.
    During some project work , we need to fetch value from xml stored in database column.
    Problem is rowsof xml column arebit different and have different values.
    Could anybody help me to build something dynamic to fetch all values from each row .
    My data look like:
    TEXT
    <
    RiskEndorsement><ExistingExposureSplitLimitsChange><NewRiskLimitSeq>536504</NewRiskLimitSeq><EffDate>11/1/2011</EffDate></ExistingExposureSplitLimitsChange></RiskEndorsement>
    <
    RiskEndorsement><MandatoryStateRateSplit><StateCode>NY</StateCode><EffDate>4/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement>
    <
    RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197608</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.890</ExModFactor><SplitDate>3/11/2012</SplitDate></NonAnniversaryExModSplit></RiskEndorsement>
    <
    RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197613</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.970</ExModFactor><SplitDate>1/13/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement>
    <
    RiskEndorsement><MandatoryStateRateSplit><StateCode>AL</StateCode><EffDate>7/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement>
    <
    RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>208975</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>230094357</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.8700</ExModFactor><SplitDate>1/1/2012</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement>
    <
    RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213467</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>2431638</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.6800</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement>
    <
    RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>213473</RiskBureauSeq><RiskIDStatusSeq>1615</RiskIDStatusSeq><RiskIDNbr>917661014</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.860</ExModFactor><SplitDate>10/1/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement>
    <
    RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213497</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>1146456</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.830</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement>
    Andrew

    Please post a concise and complete example. Include table DDL and sample data INSERT statements.
    Cause the solution depends on your actual structure. Otherwise take a look at the
    nodes() method.
    E.g.
    DECLARE @Sample TABLE
    ID INT IDENTITY ,
    Data XML
    INSERT INTO @Sample
    ( Data )
    VALUES ( '<RiskEndorsement><ExistingExposureSplitLimitsChange><NewRiskLimitSeq>536504</NewRiskLimitSeq><EffDate>11/1/2011</EffDate></ExistingExposureSplitLimitsChange></RiskEndorsement> ' ),
    ( '<RiskEndorsement><MandatoryStateRateSplit><StateCode>NY</StateCode><EffDate>4/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement> ' ),
    ( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197608</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.890</ExModFactor><SplitDate>3/11/2012</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
    ( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197613</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.970</ExModFactor><SplitDate>1/13/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
    ( '<RiskEndorsement><MandatoryStateRateSplit><StateCode>AL</StateCode><EffDate>7/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement> ' ),
    ( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>208975</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>230094357</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.8700</ExModFactor><SplitDate>1/1/2012</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' ),
    ( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213467</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>2431638</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.6800</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' ),
    ( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>213473</RiskBureauSeq><RiskIDStatusSeq>1615</RiskIDStatusSeq><RiskIDNbr>917661014</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.860</ExModFactor><SplitDate>10/1/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
    ( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213497</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>1146456</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.830</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' );
    SELECT ID ,
    ExistingExposureSplitLimitsChange.value('NewRiskLimitSeq[1]', 'INT') AS NewRiskLimitSeq ,
    ExistingExposureSplitLimitsChange.value('EffDate[1]', 'DATE') AS EffDate
    FROM @Sample S
    CROSS APPLY S.Data.nodes('/RiskEndorsement/ExistingExposureSplitLimitsChange') A ( ExistingExposureSplitLimitsChange );
    SELECT ID ,
    MandatoryStateRateSplit.value('StateCode[1]', 'NVARCHAR(255)') AS StateCode ,
    MandatoryStateRateSplit.value('EffDate[1]', 'DATE') AS EffDate
    FROM @Sample S
    CROSS APPLY S.Data.nodes('/RiskEndorsement/MandatoryStateRateSplit') A ( MandatoryStateRateSplit );
    SELECT ID ,
    NonAnniversaryExModSplit.value('RiskBureauSeq[1]', 'INT') AS RiskBureauSeq ,
    NonAnniversaryExModSplit.value('RiskIDStatusSeq[1]', 'INT') AS RiskIDStatusSeq ,
    NonAnniversaryExModSplit.value('RiskIDNbr[1]', 'INT') AS RiskIDNbr ,
    NonAnniversaryExModSplit.value('ExModStatusSeq[1]', 'INT') AS ExModStatusSeq ,
    NonAnniversaryExModSplit.value('ExModFactor[1]', 'FLOAT') AS ExModFactor ,
    NonAnniversaryExModSplit.value('SplitDate[1]', 'NVARCHAR(255)') AS SplitDateText
    FROM @Sample S
    CROSS APPLY S.Data.nodes('/RiskEndorsement/NonAnniversaryExModSplit') A ( NonAnniversaryExModSplit );
    SELECT ID ,
    AnniversaryRatingDateSplit.value('RiskBureauSeq[1]', 'INT') AS RiskBureauSeq ,
    AnniversaryRatingDateSplit.value('RiskIDStatusSeq[1]', 'INT') AS RiskIDStatusSeq ,
    AnniversaryRatingDateSplit.value('RiskIDNbr[1]', 'INT') AS RiskIDNbr ,
    AnniversaryRatingDateSplit.value('ExModStatusSeq[1]', 'INT') AS ExModStatusSeq ,
    AnniversaryRatingDateSplit.value('ExModFactor[1]', 'FLOAT') AS ExModFactor ,
    AnniversaryRatingDateSplit.value('SplitDate[1]', 'NVARCHAR(255)') AS SplitDateText
    FROM @Sample S
    CROSS APPLY S.Data.nodes('/RiskEndorsement/AnniversaryRatingDateSplit') A ( AnniversaryRatingDateSplit );

  • Update table column with same auto-increment value, via T-SQL stored procedure

    Good Evening to every one,
    I have a table 'Contracts' as we can see in the picture below (I exported my data on An Excel Spreadsheet). Table's primary key is 'ID' column.
    I am trying to create a stored procedure (i.e. updContractNum), through which I am going to update the 'Contract_Num' column, in every row where the values on Property_Code, Customer, Cust_Category and Amnt ARE EQUAL, as we can see in the schema above.
    The value of Contract_Num is a combination of varchar and auto_increment (integer). For example, the next value on 'Contract number' column will be 'CN0005' for the combination of 11032-14503-02-1450,00
    I' m trying to use CURSORS for this update but I am new in using cursors and I am stuck in whole process. I atttach my code below:
    CREATE PROCEDURE updContractNum
    AS
    --declare the variables
    DECLARE @CONTRACT_NUM VARCHAR(10); -- Contract Number. The value that will be updated on the table.
    DECLARE @CONTRACT INTEGER; -- Contract number, the auto increment section on contract number
    DECLARE @CONTR_ROW VARCHAR(200); -- Contract row. The row elements that will be using on cursor
    DECLARE CONTRACT_CURSOR CURSOR FOR -- Get the necessary fields from table
    SELECT PROPERTY_CODE, CUSTOMER, CUST_CATEGORY, AMNT
    FROM CONTRACTS;
    OPEN CONTRACT_CURSOR -- open a cursor
    FETCH NEXT FROM CONTRACT_CURSOR INTO @CONTR_ROW
    WHILE @@FETCH_STATUS = 0 -- execute the update, for every row of the tabl
    BEGIN
    --update Contract_Num, using the format coding : contract_number = 'CN' + 0001
    UPDATE CONTRACTS
    SET CONTRACT_NUM = 'CN'+@CONTRACT_NUM+1
    END
    CLOSE CONTRACT_CURSOR
    Thank you in advance!

    You dont need cursor
    You can simply use an update statement like this
    UPDATE t
    SET Contract_Num = 'CN' + RIGHT('00000' + CAST(Rnk AS varchar(5)),5)
    FROM
    SELECT Contract_Num,
    DENSE_RANK() OVER (ORDER BY Property_Code,Customer,Cust_category,Amnt) AS Rnk
    FROM table
    )t
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Can I auto update table column??

    Hi,there,
    I have a table, need to update one field at the specified time every night,how can I achieve that
    using trigger or PL/SQL?
    Thanks a lot!!!
    A Green

    Hi,
    You can schedule routines (jobs) to be run periodically using the job queue. For more details on creating jobs, here is the documentation link:
    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96521/jobq.htm#1079
    Hope that helps.
    Savitha.

  • Update table column from another

    Hi,
    I´m having trouble updating data from one table to another. I wish to syncronize the geometry field of the table FAROLFAROLIM from FAROLFAROLIM_OUT. By standard SQL I've tried this:
    update FAROLFAROLIM f, FAROLFAROLIM_OUT ff set f.GEOM = ff.GEOMETRY
    where f.IDFAROLFAROLIM = ff.IDFAROLFAROLIM
    Can you help me figuring out what is wrong???
    Thanks in advance
    Operator

    dude you are doing wrong thing...
    please use following command.
    UPDATE FAROLFAROLIM f
    SET (f.GEOM) =
    ( SELECT ff.GEOMETRY
    FROM FAROLFAROLIM_OUT ff
    WHERE f.IDFAROLFAROLIM = ff.IDFAROLFAROLIM );
    cheers,
    Sandy

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

  • Is it possible to change nunmber of columns dynamically in table control

    Is it possible to change number of columns dynamically in table control? if so how it could be done?
    Thnaks in advance.
    Sounder

    You can update the table control in your program, the table control is a structure of the type CXTAB_CONTROL of TYPE-POOLS cxtab.
    There you can hide or display column the same way you do for fields in LOOP AT SCREEN. there you will ahve to LOOP AT <control>-COLS.
    TYPE-POOL CXTAB .                                                                               
    TYPES:                                                                               
    BEGIN OF CXTAB_COLUMN,                                                          
             SCREEN      LIKE SCREEN,     "Attributes struktur SCREEN                      
             INDEX       TYPE I,         "Position of a column on the screen               
             SELECTED(1) TYPE C,          "Indicator 'column selected'                     
             VISLENGTH   LIKE ICON-OLENG, "Visualised length of a column                   
             INVISIBLE(1) TYPE C,         "Indicator 'column invisible'                    
           END   OF CXTAB_COLUMN,                                                                               
    BEGIN OF CXTAB_CONTROL,                                                         
             FIXED_COLS    TYPE I, "Number of fixed columns                                
             LINES         TYPE I, "Number of lines to display                             
             TOP_LINE      TYPE I, "Top line during next PBO                               
             CURRENT_LINE  TYPE I, "Current line during LOOP/ENDLOOP                       
             LEFT_COL       TYPE I, "Fist scrollable column after fixed area               
             LINE_SEL_MODE    TYPE I, "Line-selection  : none(0), single(1),               
             COL_SEL_MODE     TYPE I, "Column-selection:        multiple(2)                
             LINE_SELECTOR(1) TYPE C, "Indicator: 'With line-selection col'                
             V_SCROLL(1) TYPE C,            "not used                                      
             H_GRID(1) TYPE C,        "Indicator: 'Horizontal  grid-lines'                 
             V_GRID(1) TYPE C,     "Indicator: 'Vertikal    grid-lines'                    
             COLS      TYPE STANDARD TABLE OF CXTAB_COLUMN                                 
                            WITH NON-UNIQUE DEFAULT KEY,                                   
             INVISIBLE(1) TYPE C,                                                          
           END   OF CXTAB_CONTROL,                                                         
    Regards

  • Open a Dynamic URL from a Table column link

    Hi,
    Jdev Version (11.1.1.6.0)
    I have requirement to open a dynamic URL from table column. Any time I click on link, it should generate dynamic URL based on column attribute and open in popup or browser. Can someone pls suggest how to achieve this.
    Thanks
    Ank

    1)If you have any parameters that needs to be passed to build that dynamicURL, just set a propertyListener on the column attribute and get the value.
    2)Then on the af:commandLink action, build your dynamicURL with the required parameters.
    3) If you URL is all together a different application which doesn't share your transaction, you can open it as below
    In the below code, urlWithParams will be your dynamicURL.
    ExtendedRenderKitService erks =
    Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
    StringBuilder sbURL = new StringBuilder();
    sbURL.append("window.open(\"" + urlWithParams + "\");");
    erks.addScript(facesContext, sbURL.toString());
    You can also try the above response by user 948181.
    Hope it helps.

Maybe you are looking for