DML's in form

hi,
i want to use dynamic dml's in forms, using forms 6i
forms_ddl(stmt) does not works(i dont know why)
i cannot use execute immediate because of lower forms pl/sql engine,
some one suggested me to use the name_in buit in but i dont what's the exact syntax
For e.g i have to use update stmt
UPDATE NAME_IN(:BLOCK.TAB_NAME) SET NAME_IN(:BLAOCK.SET_CLAUSE) WHERE NAME_IN(:BLOCK.WHERE_CLAUSE)
the above is throwing some syntax error,,,dont know what to do,,completely stuck,,plz help

No i was not doing that, I checked the syntax 2-3 times.but it was not doing
it, did u tried urself? is it parsing the statement?I'm not sure if that was sarcasm, but I didn't mean that exact statement, just one that will be costly if it is ever run.
What I was trying to point out is that if you have a procedure on the database then you are in a less secure position than if the process is run within forms. For example, the procedure is likely to be in a schema that has privs to update many tables, and it may need definer rights to run in the way you want. This means it can also be run in ways you don't intend if someone is able to access the database from a command prompt.

Similar Messages

  • NO dml Master / detail form/report

    If I wanted to create a form or report that would only display one master record and its children records on one page. What would be the best way to do this?
    The page would not support dml. Only display the data in a master/detail fashion. I tried creating a form thru the wizard but I dont need dml.
    I tried creating a report but all the data is horizental and would prefer more of a form type of layout.
    A simple illustration follows below. Above the line is the data from the master table. Below the line are the childern.
    Columa pk
    Columb columc columnd
    column pk columndesc columna fk
    column pk columndesc columna fk

    Me too facing the some problem can some one pls help

  • DML properties in form

    Hi,
    I have a trigger at the level DB which give me the seq for a PK.
    I used FORM and have, in the block property, set the DML returning value = YES.
    As explained by ORACLE, it allows to fire the trigger when I comit my record and then give me the seq.
    But I have no result!
    Could you help me please.
    Regards
    Thierry

    I didn't tried to re-query.
    Of course it's a required item and I want the automatic seq. But when I save, I have a message like 'required item not filled'.
    When I introduce a number (1 for exemple), I save and the trigger at the level DB fired and I can see the number of the seq in the item and it replace the 1 (if the nexval is 29, I receive 29). It's 29 I need, but if I don't introduce a number, the trigger doesn't fired.
    regards

  • Perform DML on the pieces of the column in Forms

    Hi,
    I am looking for a solution for the interesting puzzle.
    In DB I have column that in the front end will be represented by the pieces of it.
    Users used to see this column like 3 virtual columns .So I will have on the form 3 text items that will be represent 1 column from DB.Like "Column" in Db = substr(col,1,4),
    substr(col,5,7), substr(col,13,7) .
    And I will need to do DML thru the form.
    Putting substr in props of the item is working for the query only.Now I need insert, update, delete.
    I got working "delete", got working "insert".
    Any suggstions for the "update"?

    This is not possible with the current release of Ultra Search. We are adding it in the current release (Ultra Search 9.0.2)
    that will be shipped with both the database (9i Release 2) and the Oracle Application Server Release 9.0.2.
    --Stefan Buchta, Ultra Search PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Update a view in oracle forms

    Hi.
    I have a block based on a view ( this view is based on two tables). How do I update the base tables when the record based on this view is updated in the form?
    Thanks

    one way is to control the transaction by using database trigger " instead of "
    on the view.
    If a view is inherently updatable and has INSTEAD OF triggers, the triggers take preference. In other words, Oracle fires the triggers instead of performing DML on the view.
    second way is to execute a DML from the forms manually by intersepting the default functionality of on-insert, on-update trigger and so on..... to perform transaction on the table.
    But i'll recommend using the INSTEAD of triggers, see documentation for more help and examples.

  • Change table usage in a form

    Hello,
    I've been working on a project for a few months now, and in charge of building Forms.
    Just recently we upgraded our Designer 6.0 to Developer Suite 10g (Designer 9.0.4.5.6).
    In their infinite wisdom, the architects have chosen to rename some of the applications and following CDM-standards, all table definitions will have to be renamed also.
    As I am not keen on having to change all table usages in my forms manually, I would like to know if there is a way to do it in Designer itself.
    I know this wasn't possible in the older Designer version, so before I handled something like that in Forms Builder. But now another demand of the project is, to be able to have 100% generation for all forms, so that's not an option anymore.
    So, do I face a lot of work or can anyone give me something I can try?

    Hi,
    I'm sorry to say that maybe you have a lot of effort to pay.
    However, I think you have a tricky way that can help you solve your problem, but not considered a good solution. You can do remaping by overriding the default DML functionality of Form. In detail, you can override ON-INSERT,ON-UPDATE,ON-DELETE,ON-LOCK and ON-FETCH to replace the default SQL statements that Forms Builder automatically generates.
    In this case you just add these triggers to your changed modules, and that's all.
    Regards

  • Form on SQL with report

    I had created a form on table with report. When the user clicks on the link image on the report, it query up the data on the form. It does all of the DML on the form behind the scenes. Now I have to do the same thing, but the form needs to be based on SQL Query instead. What do I have to do to have the link from the report automatically call of the data in the form?

    The easiest way is to create a view with an INSTEAD OF trigger which does the insert/update/delete into the underlaying tables.
    That will allow you to use all the processes the wizard creates for you and without having to write any code in APEX.
    Patrick
    My APEX Blog: http://www.inside-oracle-apex.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://apexplugin.sourceforge.net/ New!

  • Transaction Process in oracle forms

    Hello Experts,            
                          I am new in Oracle forms and reports.I am using oracle forms 11g with weblogic server 10.3.5 at windows 7 platform.
    I have 3 tables: Table A,table B,table C. there are some insert commands for table B and table C in a button say SAVE in oracle form.I have also an update command for Table A.
    Button SAVE has code : insert into Table B; insert into Table C; update table A; If updating into table A is successful then all changes would be commited. If update command for Table A is unsuccessful Then all changes in database would be rollbacked. For this I have tried to use transaction but there is no support for autonomous transaction in oracle froms as my search. please help me how to do this. Thank You regards aaditya.

    Why are you manually writing the DML statements to insert and update your tables?  Did you use the Forms DataBlock Wizard when you created your datablocks?  If not, I recommend you use the Wizard.  Oracle Forms is tightly integrated with the Oracle database.  This means Forms will perform a lot of the things you would normally have to write yourself; such as the SQL Statements to display data (SELECT), add new records (INSERT) or modify (UPDATE) and delete (DELETE) a record.
    If you need to perform a ROLLBACK, understand that when you clear a block and don't save, Forms will automatically perform a ROLLBACK and release any locks it may have placed on a table/row.  Additionally, if you need to explicitly perform a rollback, you can do this when you call the CLEAR_FORM() built by passing "FULL_ROLLBACK" to the "rollback_mode" parameter.  For example: CLEAR_FORM(NO_VALIDATE, FULL_ROLLBACK);
    If you must perform an Autonomous Transaction from Forms, the best and really only way to do this would be to create a Database Procedure that invokes the AUTONOMOUS TRANSACTIONS PRAGMA then call this procedure from your Form.
    If you absolutely must write your own DML in your Form, then you can check the FORMS_SUCCESS system variable to see if the previous command executed successfully. Using Priyasagi's example, modify the code as follows:
    DECLARE
      n_success NUMBER := 0;
    BEGIN
    insert into table_b
    IF ( FORMS_SUCCESS) THEN
      n_success := n_success + 1;
    END IF;
    insert into table_c
    IF (FORMS_SUCCESS) THEN
      n_success := n_success +1;
    END IF;
    update table_a
    IF (FORMS_SUCCESS) THEN
      n_success := n_success +1;
    END IF;
    IF ( n_success =3 ) THEN
    commit;
    ELSE
      CLEAR_FORM(NO_VALIDATE, FULL_ROLLBACK);
    END IF:
    Craig...

  • Forms Hang on saving a record.

    Dear All Experts,
    We have OAS 10g 10.1.2.0.2 and Orcle DB 9i on seprated win server 2003.
    A couple of users suddenly face a Forms Hang problem while they try to save the record. it's not occuring on all time but when it occurs they have to re-login.
    On the login again it works filne.
    Would you please guide us to resolve this problem.
    Thanks & Regards
    Eidy

    Thats a little complicated.
    In general there are two possibilities to do:
    1. Replace the ""standard" DML-operations of forms by your own operations. This is done by using the ON-INSERT, ON-UPDATE and ON-DELETE-triggers in forms, so its a client-side operation.
    2. Base the block on a view instead of a table, let forms do its standard DML-operations and do your own operations on INSTEAD-OF-triggers on the view, this is the server-side operation.
    Personally, i prefer the second option, for it keeps the business-logic in the database and the client-side "thin".
    Implementing the first method:
    Forms marks as record for the next DML when you change any relevant item. A relevant item in this sense is one of the basetable-items, or a non-databaseitem, which in turn changes a databaseitem. You can also set the property "Lock Record" on a non-database-item to "Yes" (thats what you have to do). If a record is marked that way, forms automatically tries to lock the record. So you would also have to create an ON-LOCK-trigger on the block and do your own lock in it. And last, put your DML-operations inside the ON-UPDATE, ON-INSERT and ON-DELETE-triggers

  • Using forms_ddl in forms

    hi all
    we want to use FORMS_DDL for executing each n every DDL and DML commands in forms.
    is it true that forms_ddl decrease the processing time??
    kindly help
    thanks

    Forms_ddl() is generally used to provide DDL commands. DML can be simply done in a PL/SQL block.
    Francois

  • About the Rollback..

    Hey guys,
    I did have a different understanding of the problem persisting with rollback yesterday..It's not actually used for deadlocking in this scenario..
    the code goes like this..
    procedure..
    begin
    call to Package.Insert procedure..
    if flag = 'Y'(output from insert procedure)
    then
    commit;
    else
    message('xyz');
    ROLLBACK;
    end if;
    end;
    If the o/p from flag is negative then it displays a msg telling duplicate records
    and should rollback the transaction in the database..
    But in 10G AS , there is rollback happening at the database end, but the forms screen is cleared as 'Rollback' is acting like a CLEAR_FORM..
    Any alternatives?!!
    Thanks in advance.

    The package should handle its own transactions rather than expect the calling program to roll back, so put the rollback in the procedure. Commits should almost always be done by calling programs though. If you want to roll back dml in a form then use a savepoint.
    I would use an exception rather than passing back a flag.

  • STORED PROCEDURE & DATABASE TRIGGER

    제품 : FORMS
    작성날짜 : 1995-11-07
    * STORED PROCEDURE
    1. Oracle Forms 4.5에서는 PL/SQL Code를 Server-Side에 저장하거나 Forms 내 Trigger, Procedure로 갖을 수도 있다.
    다음과 같은 경우 Procedure를 Database Server에 저장하는 방법을 선택하는
    것이 좋다.
    - Procedure가 Standard한 기능을 제공하여 다른 Tool이 공유할 수 있을 때.
    - Procedure가 중요한 DML 기능을 가질 경우.
    - Oracle Forms 4.5에서는 PL/SQL의 Version을 1.1까지 지원하므로, PL/SQL
    Version 2.X 의 기능이 필요한 경우.
    2. Stored Procedure의 제한사항
    (1) Server가 7.0 이상이어야 한다.
    (2) Pass되는 Variable은 2000 Byte이하이어야 한다.
    - 2000이 넘으면 Truncate가 되고, PL/SQL에서 Value_Error Exception이
    발생한다.
    (3) Menu PL/SQL에서는 Stored Procedure와 Function을 부를 수 없다.
    (4) Stored Subprogram의 정의가 바뀐 경우, Forms를 다시 Server와 Connect
    하기 전에는 영향을 주지 않는다.
    3. Oracle 7 Server 에서 제공하는 Standard Package들
    - dbms_alert
    - dbms_ddl
    - dbms_describe
    - dbms_lock
    - dbms_mail
    - dbms_output
    - dbms_pipe
    - dbms_session
    - dbms_snapshot
    - dbms_standard
    - dbms_transaction
    - dbms_utility
    < Oracle7 Developers Guide 참조>
    4. Calling Stored Procedures
    (1) Database Procedure는 Server-Side PL/SQL Engine에 의해 실행되도록
    Design된 PL/SQL Block이다.
    (2) Stored Procedure를 Call하기 위해서는 EXECUTE Privilege가 필요하다.
    (3) Server-Side Procedure와 Forms에서의 PL/SQL의 중요한 차이점은
    Server-Side 에서는 Forms의 Bind Variable (:Block_Name.Item_Name 등)
    을 인식하지 못한다는 것이다.
    (4) Parameter/Return이 가능한 Data Type
    - VARCHAR2 : Maximum of Varchar2(2000)
    - NUMBER
    - DATE
    - BOOLEAN
    제한사항
    - TABLE%ROWTYPE, TABLE.COLUMN%ROWTYPE으로 정의된 것은 Reference가
    안된다.
    - Unsupported Parameter나 Return Value를 사용하면 다음의 Error가
    발생한다.
    * PL/SQL error 313 at line xxx, column yyy 'PROCNAME'
    not declared in this scope.
    * PL/SQL error 201 at line xxx, column yyy identifier 'FUNCTNAME'
    must be declared.
    (5) Formal Parameter의 Default Value
    - Defulat Value는 제공하지 않는다.
    - User가 임의로 줄 수 있다.
    - Procedure Private_Test(a in VARCHAR2 := 'Hello' b in
    VARCHAR2 := 'There') IS
    BEGIN
    Dbms_Output.Put_Line(a);
    Dbms_Output.Put_Line(b);
    END;
    (6) 다른 User의 Stored Subprogram이나 Remote Database를 Call하려면
    - User Name이나 Database Link명을 숨기기 위하여 Synonym을 생성하여야
    한다.
    - CREATE SYNONYM lib_hr_syn FOR libowner.lib_hr;
    - Program에서 Call할 때에는 ss_num ;= lib_hr_syn.get_ssn(:EMP.EMPNO);
    5. PL/SQL Compiler가 해당 Procedure를 찾는 순서
    (1) Current PL/SQL Block 내에 정의되어 있는가?
    (2) Standard PL/SQL Command인가?
    (3) Oracle Forms 내의 Built-in Procedure 혹은 Function인가?
    (4) User_Named Procedure 혹은 Function인가?
    (5) Server-side에 정의된 DBMS_STANDARD Package인가?
    (6) Current user가 Server-Side의 어떤 Procedure나 Function을 Access
    하는가?
    * 이상의 질문에 대하여 전부 'NO'라는 대답이 나오면 Compiler는 다음과 같은
    Error Message를 준다.
    - PL/SQL error 313 at line xxx, column yyy 'PROCNAME' not declared in
    this scope.
    - PL/SQL error 201 at line xxx, column yyy identifier 'FUNCTNAME'
    must be declared.
    * DATABASE TRIGGER
    1. Database Trigger는 Forms에서의 Trigger와 개념적으로 거의 동일하다.
    차이점은 Trigger가 Fire되는 원인을 제공하는 사건과 후속코드가 실행되는
    장소가 틀린 것이다.
    2. Database Trigger는 Table과 연관된 PL/SQL Block들이다. Table에 대한
    UPDATE, INSERT, DELETE 등의 행위에 의해 Fire된다.
    3. Error 발생 시에는 RAISE_APPLICATION_ERROR Built-In Procedure를 사용하
    여 Error를 표시한다.
    RAISE_APPLICATION_ERROR Procedure에서는 Error Number가 20000 - 20999의
    Range를 가진다.
    4. Creating & Editing Database Triggers
    아래와 같은 적절한 권한이 주어진다면 Forms Designer Mode에서 Database
    Trigger를 직접 Create, Edit, Compile, Browse 할 수 있다.
    - Execute Privilege, Create Privilege, Compile Privilege,
    Drop Privilege
    * Create하려면
    - Navigator에서 Database Objects와 Table Nodes를 Expand한다.
    - 원하는 Table을 선택하고 Expand한다.
    - Triggers Nodes를 선택하고 Menu Bar의 Navigator*Create를 선택한다.
    - Database Trigger Editor에서 작성, compile한다.
    * Edit 하려면
    - Navigator에서 Database Objects와 Table Nodes를 Expand한다.
    - 원하는 Table을 선택하고 Expand한다.
    - 원하는 Trigger에서 Double-Click하면 Editor가 나타난다.
    - Database Trigger Editor에서 변경, compile한다.

    not possible via forms
    you can debug it on SQL Developer by using manual INSERT Updates commands

  • Virtual columns support in oracle 11g

    Hi
    I created a table with virtual columns using SQL as the APEX GUI didn't support it and I couldn't see the data dictionary of the table in object browser.
    Some strange error about my user not having any privileges on the current scheme was displayed also when I tried to view the data. Dropped the table and all is normal again now, was looking forward to using the new 11g feature.
    When will virtual columns be supported by APEX?
    Regards
    Adam

    Adam,
    >> and I couldn't see the data dictionary of the table in object browser.
    That's not my experience. I created a table in SQL Commands using:
    CREATE TABLE employees (
      id          NUMBER,
      first_name  VARCHAR2(10),
      last_name   VARCHAR2(10),
      salary      NUMBER(9,2),
      comm1       NUMBER(3),
      comm2       NUMBER(3),
      salary1     AS (ROUND(salary*(1+comm1/100),2)),
      salary2     NUMBER GENERATED ALWAYS AS (ROUND(salary*(1+comm2/100),2)) VIRTUAL,
      CONSTRAINT employees_pk PRIMARY KEY (id)
    );I was then able to browse the definition and view the data in Object Browser just fine.
    >> Some strange error about my user not having any privileges on the current scheme was displayed also when I tried to view the data.
    I couldn't reproduce this problem.
    >> When will virtual columns be supported by APEX?
    I created an application with an Interactive Report on the above table. On the resultant form, I had to change the item type of the virtual columns to Display Only. After that, DML on the form worked just great.
    Joel

  • When and where to use Dbms_Error_Code, Error_Code and SqlCode.

    I have gone thru some docs and books on dev to understand error messages in Developer. After reading i am more confused reg the difference between
    Dbms_Error_Code, Error_Code and SqlCode.
    Can any one tell me concisely the difference and the situation where these are used.
    This is my understanding so far.....
    DBMS_ERROR_CODE and DBMS_ERROR_TEXT return the last Oracle Server error code and message due to an implicit DML within form application.
    SQLCODE and SQLERRM return the last Oracle Server error code and message due to an explicit DML within a form application.
    So why use ERROR_CODE at all?
    Below is an extract from the Oracle help Docs...
    When an implicit DML raises an error, it is handled with an ON-ERROR trigger using the ERROR_CODE function. This function contains the last Oracle Form error code. These errors are prefixed with FRM-.
    Okay but why not just use DBMS_ERROR_CODE instead of ERROR_CODE?
    Example: /*
    ** Built-in: DBMS_ERROR_CODE,DBMS_ERROR_TEXT
    ** Example: Reword certain Oracle Forms error messages by
    ** evaluating the DBMS error code that caused them
    ** Trigger: On-Error
    DECLARE
    errcode NUMBER := ERROR_CODE;
    dbmserrcode NUMBER;
    dbmserrtext VARCHAR2(200);
    BEGIN
    IF errcode = 40508 THEN
    ** Oracle Forms had a problem INSERTing, so
    ** look at the Database error which
    ** caused the problem.
    dbmserrcode := DBMS_ERROR_CODE;
    dbmserrtext := DBMS_ERROR_TEXT;
    IF dbmserrcode = -1438 THEN
    ** ORA-01438 is "value too large for column"
    Message('Your number is too large. Try again.');
    ELSIF dbmserrcode = -1400 THEN
    ** ORA-01400 is "Mandatory column is NULL"
    Message('You forgot to provide a value. Try again.');
    ELSE
    ** Printout a generic message with the database
    ** error string in it.
    Message('Insert failed because of '||dbmserrtext);
    END IF;
    END IF;
    END;Regards
    Gus

    Sorry Steve as wonderful as your code example may be you are putting the cart before the horse as far as the purpose of this thread goes. I don't need guidance on HOW to use certain error functions at least not until i know WHEN i should use them and thats why i started this thread. There are 3 different sets of Oracle functions below for use in forms but not enough guidance in the docs as to when to use them for the newcomer to forms. All i need is a simple definition as to when these functions should be used appropriately in forms. The rest I will find out for myself when i start using forms properly (including the use of your wonderful code). At the moment i just want to pass the Forms exam and to have a better understanding of what i am doing.
    DBMS_ERROR_CODE & DBMS_ERROR_TEXT
    SQLCODE & SQLERRM
    ERROR_CODE & ERROR_TEXT
    I've got one person saying this....
    DBMS_ERROR_TEXT and DBMS_ERROR_CODE built-ins are intended to be used in a form-level ON-ERROR trigger.
    SQLCODE and SQLERRM functions are intended to be used in a WHEN OTHERS exception handler.
    and another saying ...
    Use error_code to handle Forms error
    Use dbms_error_code to handle database error
    .. then i've got your code which predominantly uses ERROR_CODE.
    Then the STS test papers say this...
    When an implicit DML raises an error, it is handled with an ON-ERROR trigger using the ERROR_CODE function. This function contains the last Oracle Form error code. These errors are prefixed with FRM-.
    Example:
    IF ERROR_CODE = 40508 THEN
      MESSAGE ('Invalid insert');
      RAISE FORM_TRIGGER_FAILURE;
    END IF;DBMS_ERROR_CODE and DBMS_ERROR_TEXT return the last Oracle Server error code and message due to an implicit DML within form application. These errors are prefixed with ORA-.
    SQLCODE and SQLERRM return the last Oracle Server error code and message due to an explicit DML within a form application. These functions must be used in the exception handler of the program unit that issues the DML command.
    A little Confusing to say the least!!!
    Okay, so is this correct...
    SQLCODE and SQLERRM are used with explicit DML within a form application and are used in the exception handler of the program unit that issues the DML command.
    When an implicit DML raises an error, it is handled with an ON-ERROR trigger using the ERROR_CODE function. These errors are prefixed with FRM-.
    DBMS_ERROR_CODE and DBMS_ERROR_TEXT are also used with implicit DML within form application. These errors are prefixed with ORA-.
    So why use DBMS_ERROR_CODE and DBMS_ERROR_TEXT if ERROR_CODE and ERROR_TEXT are to be used in ON-ERROR triggers and if an implicit DML error arises then whats the difference between ERROR_CODE FRM- errors and DBMS_ERROR_CODE ORA- errors? Apart from one being a form error and the other being a server error, what different things do they tell us? If an implicit DML error ocurrs would this generate ORA- and FRM- errors at the same time.
    Cheers
    Gus
    Message was edited by:
    gusora

  • DML issue in Oracle forms

    Hi,
    I have seen sometimes the queries which work in oracle sql*plus and Pl/Sql Developer,they dont work in Oracle forms, for example following query works in
    Pl/sql developer,but not in oracle forms
    select *
    from tablea
    where name in (variable)
    so if variable contains 'AA','BB'
    and records are there in table ,it will not fetch any records,whether variable is with quotes or not .........
    whenever there is a dml statement involving variables ..behavior is somewhat different ....so to get that done ....i normally transfer them to database procedure or function .....then it works fine ..
    Is it known bug or what.
    Regards,
    SS

    You can use a FORMS_DDL or EXECUTE IMMEDIATE
    select_dml := ' select * from tablea where name in ('||:variable||')';
    FORMS_DDL ( select_dml);if variable contains 'AA','BB'

Maybe you are looking for

  • Reciever JMS Adpater Error

    Hi Experts, I am getting following error in Reciever JMS adapter: I am using transport protocol is Acces JMS provider with JNDI Channel error occurred; detailed error description: com.sap.aii.adapter.jms.api.connector.ConnectorException: Error creati

  • How do u get movies on your ipod?

    how do u get movies on your ipod? i hav a 30 gb video ipod, so i can, but i cant figure out how. i've tried looking it up but it says nothing. pls help

  • Select avg salary from two depts, to compare??

    Greetings.. Need some help with a query.. Want to select the average salary of one dept, call it dept 400, compared to the avg salary of all other depts. Also want the count of employees in dept 400 vs the number of employees in all other depts.. and

  • TS1424 i bought some music and now it wont play

    i bought some music and it wont play

  • Papi WS not working

    Hi, I'm using OBPM 10.3.2 on WLS 10.3.3. When I try to deploy the PAPI WS ear I get an error like: weblogic.wsee.ws.init.WsDeploymentException: The WebLogic Server 9.x-style policy is not supported in JAX-WS web services. So according to this thread