The use of FORMS_DDL to upadate another table

Hi all

I want to update a record in a table by using the statement of forms_ddl against a button to a form that is based on another table. I used the following to do this but no updates or error free code
occered-

COMMIT_FORM;
IF: CASE_STATUS. WRIT_OFF = 1 THEN
FORMS_DDL ('UPDATE CASE_INFO SET WRIT_OFF = 1 WHERE CASE_NO =' |: CASE_STATUS.) CASE_NO);
ON THE OTHER
FORMS_DDL ('UPDATE CASE_INFO SET WRIT_OFF = 0 WHEN CASE_NO =' |: CASE_STATUS.) CASE_NO);
END IF;
COMMIT_FORM;


What is wrong with my code. Please help me find the problem. I use form 10g.

Arif
COMMIT_FORM;
IF :CASE_STATUS.WRIT_OFF=1 THEN
UPDATE CASE_INFO SET WRIT_OFF=1 where CASE_NO= :CASE_STATUS.CASE_NO;
ELSE
UPDATE CASE_INFO SET WRIT_OFF=0 where CASE_NO=:CASE_STATUS.CASE_NO;
END IF;
COMMIT;

Forms_ddl builtin is used to launch the ddl through forms. No need to use it for dml.

Tags: Oracle Development

Similar Questions

  • legality of the use of vista software to another computer after upgade to windows vista

    legality of the use of vista software to another computer after upgade from vista to windowslegality the software vista to another computer after upgade to windowslegality vista software vista to another computer after upgade to windows vista

    legality of the use of vista software to another computer after upgade from vista to windowslegality the software vista to another computer after upgade to windowslegality vista software vista to another computer after upgade to windows vista

    Hey rjmhhar

    If you use a license of operating system vista as part of an upgrade, it is related to the new upgrade license

    You can use it NOT then install vista on another computer when it is used in the installation as part of this upgrade

    Walter, the time zone traveller

  • Before file is deleted, the record must be insert into another table

    Hi friends,

    I have to create tabular form to delete some record. Using this tabular form I deleted successfully.
    But I want to when I delete a record before deleting record that he should go to another table.



    How can I do that.




    Ed

    Hello

    You create before you remove the trigger table.
    http://download.Oracle.com/docs/CD/B10500_01/server.920/a96524/c18trigs.htm

    BR, Jari

  • Copy the result of a join to another table

    Hi all

    I want to copy the join of two tables in another table. I tried the following approach, but I have error

           insert into new_copy  values (ID,name,na_name)   
           SELECT
             name
            FROM
              country u
            INNER JOIN
              (
                SELECT
                 na_name
                FROM
                  country2 st
              )
              s
            ON
              u.id = s.ID;
    
    1. insert into new_copy (ID, name, na_name)
    2. SELECT i.id, u.name, s.na_name
    3. COUNTRY u
    4. INNER JOIN s countries2 ON u.id = s.id

    must be done

  • [11g] ORA-22993 when extracted xmltype great values in the outbreak of the BIU as a CLOB in another table

    [I ask nicely for a few comments for this question.

    Someone else can reproduce it with the test below?

    Is my code invalid or false?

    Or what is the problem here?

    -Thank you

    Frank

    ]

    Hello

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Trigger Before Insert or Update to a table, I invoke a PL/SQL package function to check the size of an xmltype column (passing as IN OUT NOCOPY).

    PL/SQL functions retrieves the xmltype. GetClobVal(), check its size, and when it is beyond a limit, he tries to insert the data into another table (GTT - global temporary table).

    Finally, it changes the value of the value of the column of xmltype to the shorter XML (just by referring to the corresponding record in the TWG).

    But the Insert SQL in the TWG operation strike ORA-22993: specified input is greater than the amount actual source.

    I don't know why this happens. In the internet I only find references on importing files in lob/clob.

    Anyone have the same problem?

    I know that you prefer to have a sample program to demonstrate the problem - I'll try to post one, but it will take time.

    But maybe someone can help me based on the information above already.

    -Thanks a lot!

    Best regards

    Frank

    I have reproduced the issue.

    It must be a bug.

  • How to perform an addition of column values in an insert query that would insert in the 3rd column, and the values how to insert into another table.

    I have two tables (2) RESULT TAB (1)

    CREATE TABLE TAB

    (

    NUMBER OF SNO

    A NUMBER,

    B THE NUMBER.

    NUMBER OF THE SUM

    );

    CREATE AN ARRAY OF RESULT

    (

    NUMBER OF SNO

    NUMBER OF THE SUM

    )

    my doubt is:

    (1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.

    SNO   A  SUM           

    1 100 150 250

    2 300 100 400

    I want to like this, it is possible with single insert query?


    (2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?

    in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem

    First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.

    Second, you might solve your problems with bind variable:

    Insert tab

    (sno, a, b, sum)

    values

    (: SNO,: A: B: A + B :))

    You should not use sum as column name because it is a reserved word.

    More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:

    Start

    insert into tab values (: SNO,: A: B: A + B :);)

    insert into result values (: SNO,: A + B :);)

    end;

    If you meet sno from a sequence, you could do something like this:

    Start

    insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.

    insert into result values (: SNO,: A + B :);)

    end;

    Hope that helps,

    dhalek

  • Problem with copying of the contents of one database to another table

    I'm trying to update a table on my machine to test based on data that is located on the production server.
    I already have links to configuration database but whenever I try to do anything with the table I get the following message

    22992 00000 - "cannot use LOB Locators selected from the remote tables.

    So I searched the web and read that I could insert into a table from a database link. So I created a temporary table based on the table on the production server, and then I tried to run this code

    insert into [email protected]
    Select * from [email protected]

    It gave me the above error.

    Any help would be greatly appreciated.

    22992, 00000, "cannot use LOB Locators selected from the remote tables.
    * Cause: A remote LOB column cannot be referenced.
    *: Deletes the reference to the type LOB data in remote tables.

    Push the data instead of the data.

  • Validation form column against the value of another Table

    Hello

    I'm new to this forum, so please bear with me a bit!  I only have a small amount of writing PL/SQL experience, and I've never written Javascript or JQuery before.  I am an Oracle DBA and I coding experience C and PERL, so I have a strong technical background.  But I need some advice on the best way to approach a problem.

    I have an application of data base in Oracle Apex (version 4.2) with a tabular form on a table: Let's say that #1 with the conditions of licence 1 a, 1 b, and1C.  I have to make sure that the value entered in col B is not greater than the value of a column in another table (for example table #2 pass 2 (a).  From a conceptual point of view, the amount of money available is in the #2 table, and my tabular form lines are an act of spending money (such as orders or invoices), so I have to make sure that we spend more that we have.  Who is?

    Does anyone have tips for the best way to do it?  I'm figuring that the biggest problem here is perhaps to account for people who enter multiple lines in the form of tables at the same time, right?  So, if a person is entered 3/invoices, I need a total to ensure that they do not have spend more than we have in the #2 table.

    I really appreciate your help!

    Best regards

    Laurie Baublitz

    Ah, I was not totally with you on this charge then. My validation works overall, but it totals the amount for each line, regardless of the task. Okay - who was not totally my solution but more a demonstration of the technique that you can use to validate your tabular presentation in this way.

    You could solve this issue with a safe collection, or with a table plsql where you add an entry for each task name and keep the amount stored in there.

    Anyway, it would be better for you to spend a little time on playback on the plsql collections or collections apex!

    Remember, this is a sample and you will need to take stock of it. The best solutions are those where you need to experiment with 8)

    DECLARE
      TYPE tt_taskamount IS TABLE OF NUMBER INDEX BY VARCHAR2(20);
      t_taskamount tt_taskamount;
    
      l_task VARCHAR2(20);
      l_amount NUMBER;
      l_max NUMBER;
    BEGIN
      -- F02 is the taskname
      -- F03 is the amount
      -- adapt to your situation!
      FOR i IN 1..apex_application.g_f02.count
      LOOP
        l_task := apex_application.g_f02(i);
        l_amount := apex_application.g_f03(i);
        IF NOT t_taskamount.exists(l_task) THEN
          t_taskamount(l_task) := l_amount;
        ELSE
          t_taskamount(l_task) := t_taskamount(l_task) + l_amount;
        END IF;
    
        -- it's not the best idea to perform a select each time and could be
        -- done better but for the sake of the example it's fine
        -- not too bad either if the rowcount is small.
        SELECT maxamount
          INTO l_max
          FROM table2
         WHERE taskname = l_task;
    
        IF t_taskamount(l_task) > l_max THEN
          -- returning will stop further processing and throw an error message as soon as a budget has been overrun
          -- it might or might not be required behaviour but that's up to you
          RETURN 'The max amount ('||l_max||') for task ' || l_task ||' has been exceeded. Reduce the total amount on associated tasks!';
        END IF;
      END LOOP;
    END;
    
  • update a table, however I would like to save the old news in an another tabl

    Hello all; I have a table called table_one,

    That contains the following information
    carid            place
    Benz            New York
    BMW            London
    This information will usually be updated in the near future, however, I would like a situation where before information is updated, the old information is stored in another table called table_two first. for example, table_one, say that New York is so updated to Toronto, I want

    CARiD place
    Benz New York

    first recorded in table_two before the update is done. How can I do to make it. Thank you

    You can use a trigger to insert the old lines to another table.

    syntax:

    CREATE or REPLACE TRIGGER trigger_name
    BEFORE UPDATE
        ON table_name
        [ FOR EACH ROW ]
    DECLARE
        -- variable declarations
    BEGIN
        -- trigger code
    EXCEPTION
        WHEN ...
        -- exception handling
    END;
    

    for example

    CREATE OR REPLACE TRIGGER emp_before_update
    BEFORE UPDATE ON empployee FOR EACH ROW
    DECLARE
        v_username varchar2(10);
    BEGIN
        insert into employee_backup
         (employee_id,
          first_name,
          last_name)
        values
         (:old.employee_id,
          :old.first_name,
          :old.last_name);
    END;
    
  • BEEP and Siebel: limit the number of records displayed in a table

    Hi all
    I use BEEP with Siebel. For example, my XML has a set of 50 activities. These activities are of a different type and different date. Now, I want to show:

    5 activities the newer type A in a table.
    5 activities the most recent type B in another table.
    5 activities the most recent type C in another table.

    I tried using the position() method, but since I use the same set of activities 3 times it will not work. The reason is that after you sort the activities in descending order of creation date, I could end up having 5 recent activities of type A digit 4, 9, 17, 23 and 31. That's why I can't use <? If: position() < 6? >.

    The 'worst' solution would be to create a link of multiple values in Siebel for each type of activity and prior filtering of activity types in the object link, so I could use the solution above to limit the records per table. But it is really more practical in my opinion.

    All welcome ideas on how to do this inside the model.

    If you couldn't do something similar to this in your model:

    <=5]?>

    If you wish, send me the sample xml data and a RTF file to [email protected] and I can take a look.

    Thank you!

  • Drawbacks to the use of the child tables

    Hi, in Oracle NoSQL-GSG - Tables.pdf page 22: "Note that there is no downside to using children tables [instead of folders] even for the trivial cases."
    But currently, there are some disadvantages disadvantages, as illustrated in this simplified example:

    create a table - name personal
    Add-field - type STRING-identification
    Add-field - type STRING-familyName name
    Add-check-domain - name postalAddress
    Add-field - type STRING-city name
    Add-field - type STRING-name street
    output
    Add-check-domain - name invoiceAddress
    Add-field - type STRING-city name
    Add-field - type STRING-name street
    output
    primary key - id field
    output
    Plan add a table-name Personal-wait

    # In addition, we define the child table having a similar structure to show the differences:
    create a table - name Personal.Address
    Add-field - type STRING-name of the type of
    primary key - field type
    Add-field - type STRING-city name
    Add-field - type STRING-name street
    output
    add name Personal.Address table map - wait

    connect store - name kvstore


    «"set table - name personal - json ' {\"id\":\"1\', \"familyName\":\"Wu\'", \"postalAddress\ ': {\"town\":\"Rio\", \"street\":\"MyWay\ ""} ', \"Address\ ': {\"type\":\"delivery\', \"town\":\"Rio\'", \"street\":\"MyWay\"}}»
    # Please, you could allow "instead of"in the syntax of CLI to avoid ugly \"hiding?"

    get table - personal name - enough
    # Result is:
    {
    « id » : « 1 »,
    "familyName": "Wu."
    'postalAddress': {}
    "City": "Rio."
    "the street": "MyWay".
    },
    'invoiceAddress': null
    }
    # Address data (from child table) are not displayed (but it's a feature!)


    get table - name Personal.Address - enough
    0 rows returned
    # address data was not stored (and no error message was displayed in the command put above).

    "set table - name Personal.Address - json' {\"id\":\"1\", \"type\":\"delivery\"", \"town\":\"Rio\" ", \"street\":\"MyWay\ "}".
    get table - name Personal.Address - enough
    {
    « id » : « 1 »,
    "type':"delivery. "
    "City": "Rio."
    "the street": "MyWay".
    }
    # Good, it is stored, but not 'nested' correctly:


    get table - name personal - child Personal.Address - enough

    # This gives the person and her child in a sequence:
    {
    « id » : « 1 »,
    "familyName": "Wu."
    'postalAddress': {}
    "City": "Rio."
    "the street": "MyWay".
    },
    'invoiceAddress': null
    }
    {
    « id » : « 1 »,
    "type':"delivery. "
    "City": "Rio."
    "the street": "MyWay".
    }

    Kids tables are normal tables that have a name containing a point and that inherit the keys to their anchestors. They have disadvantages compared to the record types.

    At least the input/output JSON data is not as expected.

    Hello

    Child tables exist for two main reasons.

    1. They allow the related data modeling in independent lines, as I mentioned earlier.  In a relational system do you this with another table and a join to get information at the same time.
    2. Data in table, they allow access to the mother and child in an efficient and transactional data.  That you don't get modeling them as independent and make a join.  This is probably the point you've been away.

    Popping up a level of abstraction, Oracle DB NoSQL is a sharded system, designed to provide horizontal scaling with consistent performance.  It does this by placing recordings of the pieces separated according to the brightness of the line key.  All lines with the same brightness key are stored in the physical basis and are therefore available in a transactional manner.

    In a first level table (i.e. one without a parent) the brightness key is either explicitly set or it is precisely its primary key.  The brightness of a child table key is always key brilliance of its parent.  This means that if you have a table person with a primary key of '1' then all its child table lines who share this part of their primary key (e.g. <"1", "work_address"="">, <"1", "home_address"="">, etc.) are accessible to all, in the same transaction - that works for multiGet and updates, which can be done with lists of TableOperation.

    You're trying things with the CLI, which works, but is not the richest way to access the system, and is of course confusing sometimes.

    -Child flag you saw in the CLI is not there to specify the relationship between the table of the child, but rather to indicate that you want to get records from this table as well.  For example, if you have a person parent table and child table address and that you only want the parent lines that you do:

    get table - name person

    If you want to get the lines both person and address you

    get table - name person-child address (or Person.Address, I do not remember offhand)

    To do a specific identity, you do

    "get table - name person - child address - json ' {'id': '1'}"

    Is - this make more sense?

    Kind regards

    George

  • How to set the value of a column in a table according to another column?

    Hello world!

    I use Apex 4.1.
    My question is how can I set the value of a column in a table according to another column?
    I have a table and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    I tried to use javascript as
     $('input[name=f02]').live('change', function(){
    if($(this).val()!='1'){
    $('input[name=f03]').val("test")}
    }); 
    for the development of the column note to test if the value typed in the content of the column is not 1, but this code assigns the value to all the lines and I need to set only the specified line.

    Can someone give me a hint in any way to do this if possible?

    Kind regards
    drama9346

    You will need create a process on your page type PLSQL and develop this process "we demand" of the page. In this process, you can run the PLSQL you need. That is to say to retrieve the note value as described in your PC:

    and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    In this process, you must provide a return value of the call, and you can do this by using htp.p. Example:

    DECLARE
       --putting x01 in a var to simplify
       l_test_var VARCHAR2(200) := apex_application.g_x01;
       l_return VARCHAR2(200);
    BEGIN
       -- a simplistic test
       IF LENGTH(l_test_var) BETWEEN 10 AND 20 THEN
          l_return := 'String is between 10 and 20';
       END IF;
    
       --this will write l_return to the buffer, and the ajax callback will receive this
       htp.p(l_return);
    END;
    

    And the code that I wrote above, which is javascript, would need to go where your current code is that binds to the onchange event. The result should be that, when a change is made to this element, an ajax request is made on the server. When the call is finished, it will be the value returned in the item you want.

  • How to insert data into the table of plain text stored as a CLOB in another table

    Hi people,

    Maybe it's an easy question for someone who is more frequently used files and CLOB.

    I have a table that stores text files in the CLOB column. Files text includes some basic data that I want to load in the other - a text line = a new insert for me. Is there a "trick" how to do it effectively?

    Here is my model:

    Table OS_IMPORT_DOCS, stores the complete files as CLOB
    SQL> desc OS_IMPORT_DOCS
    Name          Type           Nullable Default Comments 
    ------------- -------------- -------- ------- -------- 
    OBJECT_ID     NUMBER                                   
    DATUM_ZMENY   DATE                    sysdate          
    FILE_PATH     VARCHAR2(4000) Y                         
    FILE_NAME     VARCHAR2(4000) Y                         
    FILE_SIZE     NUMBER         Y                         
    LAST_MODIFIED DATE           Y                         
    DOCUMENT      CLOB           Y                         
    STATUS        VARCHAR2(15)   Y        'NEW'  
    Sample data from OS_IMPORT_DOCS
    SQL> select *
      2    from os_import_docs d
      3  order by d.last_modified desc
      4  ;
     
     OBJECT_ID DATUM_ZMENY FILE_PATH                      FILE_NAME       FILE_SIZE  LAST_MODIFIED DOCUMENT    STATUS
    ---------- ----------- ------------------------------ --------------- ---------- ------------- ----------- ---------------
       1815043 13.8.2012 1 d:\data\C120813.DAT            C120813.DAT          16800 13.8.2012 16: <<CLOB>>    NEW
       1815042 13.8.2012 1 d:\data\C120812.DAT            C120812.DAT           3600 12.8.2012 22: <<CLOB>>    NEW
       1815041 13.8.2012 1 d:\data\C120811.DAT            C120811.DAT           1800 11.8.2012 13: <<CLOB>>    NEW
    Example of file CLOB - stored text data (select d.document from os_import_docs d where d.object_id = 1815042 ;)
    061053120820120000AGT000002Osoby                   0000000042301000000017210632
    062322120820120000AGT000002Osoby                   0000000012301000000017197566
    063526120820120001AGT000002Osoby                   0000000012301000000017197566
    064234120820120001AGT000002Osoby                   0000000103301000000162218777
    Above the example text includes "columns" in plain text:
    timestamp - 1-14, SSMIHH24DDMMYYYY position format
    flag - post 15-18
    company code - position 19-27
    etc...

    How can I query data stored within the OS_IMPORT_DOCS. The DOCUMENT column, divide it into columns and insert into another table?
    I have to read this method of 'online' file?


    Thank you very much
    Tomas

    For the first three columns:

    SQL> create type TRecord is object (
      2    ts           timestamp
      3  , flag         varchar2(4)
      4  , company_code varchar2(9)
      5  );
      6  /
    
    Type created
    
    SQL>
    SQL> create type TRecordTable is table of TRecord;
      2  /
    
    Type created
    
    SQL>
    SQL> create or replace function parse_clob (p_doc in clob)
      2  return TRecordTable pipelined
      3  is
      4    lf      number;
      5    eol     varchar2(2) := chr(10);
      6    eollen  number := length(eol);
      7    line    varchar2(32767);
      8    offs    number := 1;
      9  begin
     10    loop
     11      lf := dbms_lob.instr(p_doc, eol, offs);
     12      if lf != 0 then
     13        line := dbms_lob.substr(p_doc, lf - offs + 1 - eollen, offs);
     14        offs := lf + eollen;
     15      else
     16        line := dbms_lob.substr(p_doc, dbms_lob.getlength(p_doc) - offs + 1, offs);
     17      end if;
     18      pipe row (
     19        TRecord(
     20          to_timestamp(substr(line, 1, 14), 'HH24MISSDDMMYYYY')
     21        , substr(line, 15, 4)
     22        , substr(line, 19, 9)
     23        )
     24      );
     25      exit when lf = 0;
     26    end loop;
     27  end;
     28  /
    
    Function created
    
    SQL>
    SQL> select t.*
      2  from os_import_docs d
      3     , table(parse_clob(d.document)) t
      4  where d.object_id = 1815042;
    
    TS                                     FLAG COMPANY_CODE
    -------------------------------------- ---- ------------
    12/08/12 06:10:53,000000               0000 AGT000002
    12/08/12 06:23:22,000000               0000 AGT000002
    12/08/12 06:35:26,000000               0001 AGT000002
    12/08/12 06:42:34,000000               0001 AGT000002
     
    
  • How to update the table by using the value of a column in a table field

    Hi all
    use APEX4.1,
    I have a tabular presentation based on the HOLIDAY table, it contains the following fields,
    Leave_id
    Employee_name
    No_of_days
    Status
    Here's the column LOV updateable status.
    Lov includes 2 values IE APPROVE and REJECT

    and I have another Table called LEAVE_HISTORY, it contains the following fields.
    Emp_name
    status
    Here whenever the ststus is updated (click the button SUBMIT) in tabular form should also be updated in the LEAVE_HISTORY of the SITUATION of the table column.

    I tried the following in the process of "WE SUBMIT AFTER CALCULATIONS AND VALIDATIONS,"
    begin
    update LEAVE_HISTORY set status= status where upper(employee_name)=upper(emp_name);
    end;
    but it is not kept up-to-date,
    When we updated through forms we can use something like this,
    update LEAVE_HISTORY set status= :P200_status where upper(employee_name)=upper(:P_200_emp_name);  <----here we are referring page item i.e (:P_200_emp_name)
    as the code above, how to run the columns in a table?
    Thank you.

    Hi Gurujothi,

    Try this,

    begin
    update LEAVE_HISTORY
    set status= :STATUS
    where upper(Emp_name)=upper(:EMPLOYEE_NAME);
    end;
    

    Brgds,
    Max

  • Insert the result of a query select in another table

    Hello

    I have a strange problem when I try to insert all the results of a query select in another table, using the declaration of the order.

    With the declaration of COMMAND it works fine
    Work:
    ------------------------------
    INSERT INTO ADART01 (SELECT (codart)
    "STOCK". "" CODART_STO ".
    Of
    "DB". ' ' 'ACTIONS');
    ------------------------------

    But if I try to sort the result using the declaration of the ORDER, I have the following error:
    Error: ORA-00907 missing right parenthesis
    ------------------------------
    INSERT INTO ADART01 (SELECT (codart)
    "STOCK". "" CODART_STO ".
    Of
    "DB". "" "ACTIONS"
    ORDER BY
    "STOCK". ("' CODART_STO ASC ');
    ------------------------------

    Any idea?

    Thank you for your help,
    Angel.

    delete "()" to select

    create table test1 (a number, b varchar2(100));
    
    insert into test1
        (a, b)
        select level, 'level ' || level from dual connect by level < 101;
    
    insert into test1
        (a, b)
        select level, 'level ' || level from dual connect by level < 101 order by to_char(sysdate - level, 'D');
    
    select * from test1;
    
    drop table test1;
    

Maybe you are looking for