Writing own dml statements in jdeveloper

i need to write my own dml statement in a jdevelopers application. like on saving a purchase form i would like to update stock table as well. Some one told me to write code in DoDML procedure but how ? i mean what statement should i write there ?

lot of possibilities but easy way is to call PL/SQL code i guess you are coming from FORMS background so it would be easy and understandable for you
You can expose PL/SQL package as web-services also you can call stored procedures and functions in ADF
here is the example http://baigsorcl.blogspot.com/2010/05/calling-plsql-procedure-and-function-in.html
doDML() will work at entity level you can call your PL/SQL at doDML as well or as call its method binding

Similar Messages

  • Will Materialized view log reduces the performance of DML statements on the master table

    Hi all,
    I need to refresh a on demand fast refresh Materialized view in Oracle 11GR2. For this purpose I created a Materialized view log on the table (Non partitioned) in which records will be inserted @ rate of 5000/day as follows.
    CREATE MATERIALIZED VIEW LOG ON NOTES NOLOGGING WITH PRIMARY KEY INCLUDING NEW VALUES;
    This table already has 20L records and adding this Mview log will reduce the DML performance on the table ?
    Please guide me on this.

    Having the base table maintain a materialised view log will have an impact on the speed of DML statements - they are doing extra work, which will take extra time. A more sensible question would be to ask whether it will have a significant impact, to which the answer is almost certainly "no".
    5000 records inserted a day is nothing. Adding a view log to the heap really shouldn't cause any trouble at all - but ultimately only your own testing can establish that.

  • Inserting your own sql-statements in JSP

    How do I use my own sql-statements in JSP combined with the ones
    generated by JDeveloper?
    It seems to me that the following sentences are the ones
    generating the sql for inserting in a database:
    <jbo:DataSource id="ds" appid="MimPKG.MimPKGModule"
    viewobject="BidragView"/>
    <jbo:Row id="newRow" datasource="ds" action="Create">
    <jbo:SetAttribute dataitem="*"/>
    </jbo:Row>
    I would like to have more control and therefore I need to make
    my own sql-statements.
    Is that possible?
    Thanks
    Leise

    You can use ExecuteSQL data tag to do so. It allows you to
    include your own query like insert, update etc.

  • HR Schema DDL and DML Statements

    Dear all,
    I want all tables and datas for practicing purpose.(HR Schema)
    In Oracle site where can I get these DDL and DML Statements.
    Can Any one post all statements..
    Thanks in advance.

    Unlocking the Sample Tables
    The Human Resources (HR) Sample Schema is installed as part of the default Oracle Database installation. The HR account is locked by default.
    You need to unlock the HR account before you can use the HR sample schema. To unlock the HR account, log in as the SYSTEM user and enter the following command, where your_password is the password you want to define for the user HR:
    ALTER USER HR IDENTIFIED BY your_password ACCOUNT UNLOCK;
    For further information about unlocking the HR account, see the Oracle Database Sample Schemas guide. The HR user is primarily to enable you to access the HR sample schema and is necessary to enable you to run the examples in this guide.
    Each table in the database is "owned" by a particular user. You may wish to have your own copies of the sample tables to use as you try the examples in this guide. To get your own copies of the HR tables, see your DBA or see the Oracle Database Sample Schemas guide, or you can create the HR tables with the script HR_MAIN.SQL which is located in the following directory on UNIX:
    $ORACLE_HOME/DEMO/SCHEMA/HUMAN_RESOURCES/HR_MAIN.SQL
    And on the following directory on Windows:
    %ORACLE_HOME%\DEMO\SCHEMA\HUMAN_RESOURCES\HR_MAIN.SQL
    To create the HR tables from command-line SQL*Plus, do the following:
    1.
    Ask your DBA for your Oracle Database account username and password.
    2.
    Login to SQL*Plus.
    3.
    On UNIX, enter the following command at the SQL*Plus prompt:
    SQL> @?/DEMO/SCHEMA/HUMAN_RESOURCES/HR_MAIN.SQL
    On Windows, enter the following command at the SQL*Plus prompt:
    SQL> @?\DEMO\SCHEMA\HUMAN_RESOURCES\HR_MAIN.SQL
    To remove the sample tables, perform the same steps but substitute HR_DROP.SQL for HR_MAIN.SQL.
    Regards
    Asif Kabir

  • DML statements in Function

    Hi,
    I have small question
    Why we should not written DML statements in Function ?
    Can any one explain that
    Thanks...

    971822 wrote:
    Hi,
    I have small question
    Why we should not written DML statements in Function ?
    Can any one explain thatThe answer is: "it depends".
    Functions are used for many many different purposes, and it is the purpose that determines whether it's a good idea to write DML statements in a function.
    As already mentioned, there are the purity rules, that basically say "if you're going to be calling the function from queries etc. then it cannot do DML, otherwise you'll get an exception"
    But there are also functions that are intended to be used within PL/SQL code for other purposes. It may be that you need something that updates some data and returns a result from that updated data, or it returns how much data was effected, in which case it's perfectly ok to have a function do some DML.
    As long as the code is well modularised and makes sense for the purpose for which it is intended, then you are doing the right thing. Where it goes wrong is when people lack design in their applications, and try to write 'generic' functions to be used in PL/SQL or SQL, or fail to modularise code so a function is doing the task of several things based on some parameters etc. when really each task should seperated to it's own functions/procedures etc.
    So we cannot just say that we "should not" write DML inside functions; but we can say that there are design considerations (or lack of) when it would be bad practice to do so.

  • DML statements notification

    Hello,
    I have about 300 tables in my database, which is in oracle 9i. If any DML statements are done on these tables, I need a notification like, inserts a row to a notification table or creates a notification file. Writting trigger on all these tables is not possible. Is there are any other ways??

    Writing triggers on each table should be possible if not practical. You discarded that idea so we'll explore another.
    You might be able to create a system level trigger on the schema(s) in question. Check the Oracle documentation to see if the system trigger events support DML activity; they do support DDL activity.

  • If we use DML statement in function then that function can be used inside s

    if we use DML statement in function then that function can be used inside select query or any DML query?

    select f from t2;I think you meant to query t1.
    It works if the function is an autonomous transaction:
    create or replace function f return number
    is
    PRAGMA AUTONOMOUS_TRANSACTION;
    begin
        update t1 set c=2;
        commit;
        return 1;
    end;
    select f from t1But as Billy said why would you want to do DML this way. And this is not the way autonomous procedures should be used either.
    An an answer to an interview question though nothing wrong with it.

  • How To Build Your Own Audit Rules in Jdeveloper 11.1.2.0.0 ?.

    Hi All,
    I am using Jdeveloper 11.1.2.0.0. I followed below link:
       http://www.oracle.com/technetwork/developer-tools/jdev/index-098707.html#01But in this link ,they are explained about how to creating our own audit rule in Jdeveloper 10g.
    How to create our own audit rule in Jdeveloper 11.1.2.0.0 ?.
    As per my old link,
    Jdeveloper 11.1.2.0.0 Aduit rules problem.unable to add more rules and change that warning message.
    As per the below link,
    Third party extension in Jdeveloper 11.1.2.0.0unable to use any third party (PMD) plugin.
    Any idea ?.
    Thanks Advance.
    Regards,
    Vass Lee

    Hi..
    Check followings
    http://andrejusb.blogspot.com/2010/03/red-samurai-tool-jdeveloper-11g.html
    http://blogs.oracle.com/jdevextensions/entry/don_t_fear_the_audit

  • Problem in writing a Read Statement

    Hi,
    In my Table control I have a POSITION button which is used to find the record in the table.
    I have written the following code.
      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
    *   NO_VALUE_CHECK        = ' '
          popup_title           = 'Find the record'
    *   START_COLUMN          = '5'
    *   START_ROW             = '5'
    * IMPORTING
    *   RETURNCODE            =
        TABLES
          fields                = lt_tab
    EXCEPTIONS
       error_in_fields       = 1
       OTHERS                = 2
    I have five primary keys in my table, so that in the pop up I am getting all the five fields.
    The user will enter any of the five fields , I want to write a read statement based on the fields entered by the user.
    Could anybody help in writing the Read  statement.
    Or could any one help me in writing out the FIND functionality for a table control
    Regards
    Edited by: SAP LEARNER on Jun 15, 2010 1:40 PM

    Hi,
    I do not know what fields will be filled up.
    as there are 5 PK fields so 5! chances will be there for the where condition in the READ statement.
    How can I do it.
    I tried in the following way.
    I created a structure with the primary key fields and I filled the structure with the user filled values.
    Then I used it in the read statement as below, but it did not work.
        LOOP AT lt_tab .
          IF lt_tab-fieldname = 'SOCIEDAD'.
            lw_pk-sociedad = lt_tab-value.
          ENDIF.
          IF lt_tab-fieldname = 'NATURAL_YEAR'.
            lw_pk-natural_year = lt_tab-value.
          ENDIF.
          IF lt_tab-fieldname = 'CICLO_DE_VENTAS'.
            lw_pk-ciclo_de_ventas = lt_tab-value.
          ENDIF.
          IF lt_tab-fieldname = 'MODEL_VERSION'.
            lw_pk-model_version = lt_tab-value.
          ENDIF.
        ENDLOOP.
        DATA:lw_yrwbw010 TYPE ty_yrwbw010.
        READ TABLE t_yrwbw010 INTO lw_yrwbw010 WITH KEY lw_pk.
         IF sy-subrc = 0.
          table-top_line = sy-tabix.
         ENDIF.
      ENDIF.
    @Rob Burbank
    Could you please help me !! I could not find that in F1 help.
    @ Keshav.T         
    Could you please elaborate it please

  • PLS-00435: DML statement without BULK In-BIND cannot be used

    My requirement
    I am dynamically creating a staging table my_stg, and then populate it. Seems simple, but not sure why i get this error,
    create table gtest4(myid varchar2(10), mykey varchar2(10));
    create table gtest5(myid varchar2(10), mykey varchar2(10));
    insert into gtest4 values(1,3);
    insert into gtest4 values(2,7);
    insert into gtest5 values(5,3);
    insert into gtest5 values (1,7);
    commit;
    /* Formatted on 2012/01/27 17:52 (Formatter Plus v4.8.8) */
    CREATE OR REPLACE PROCEDURE px
    IS
    TYPE rectype IS RECORD (
    myid VARCHAR2 (100),
    mykey VARCHAR2 (100)
    TYPE tabtype IS TABLE OF rectype
    INDEX BY BINARY_INTEGER;
    rec tabtype;
    cur sys_refcursor;
    BEGIN
    EXECUTE IMMEDIATE 'create table my_stg(myid varchar2(100), mykey varchar2(100)) ';
    OPEN cur FOR 'select a.myid, b.mykey
    from gtest4 a, gtest5 b
    where a.mykey = b.mykey';
    LOOP
    FETCH cur
    BULK COLLECT INTO rec LIMIT 500;
    FORALL i IN 1 .. rec.COUNT
    EXECUTE IMMEDIATE 'insert into my_stg(myid, mykey) values (rec(i).myid,
    rec(i).mykey)';
    EXIT WHEN cur%NOTFOUND;
    END LOOP;
    END;
    I compile the above proc, and get
    PLS-00435: DML statement without BULK In-BIND cannot be used
    the reason I do insert in execute immediate is because the table my_stg does not exist, it is created on the fly

    I tried the below, used plsql table variables instead of record type
    CREATE OR REPLACE PROCEDURE px
    IS
    TYPE rectype IS RECORD (
    myid VARCHAR2 (100),
    mykey VARCHAR2 (100)
    TYPE tabtype1 IS TABLE OF varchar2(100)
    INDEX BY BINARY_INTEGER;
    TYPE tabtype2 IS TABLE OF varchar2(100)
    INDEX BY BINARY_INTEGER;
    rec1 tabtype1;
    rec2 tabtype2;
    cur sys_refcursor;
    BEGIN
    EXECUTE IMMEDIATE 'create table my_stg(myid varchar2(100), mykey varchar2(100)) ';
    OPEN cur FOR 'select a.myid, b.mykey
    from gtest4 a, gtest5 b
    where a.mykey = b.mykey';
    LOOP
    FETCH cur
    BULK COLLECT INTO rec1, rec2 LIMIT 500;
    FORALL i IN 1 .. rec.COUNT
    execute immediate 'insert into my_stg(myid, mykey) values (:1,:2)
    using rec1(i).myid, rec2(i).mykey;
    EXIT WHEN cur%NOTFOUND;
    END LOOP;
    END;
    I get error
    PLS-00103: Encountered the symbol "insert into my_stg(myi
    mykey) values (:1,:2)
    using rec1(i).myi" when expecting one of the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable>
    count current exists max min prior sql stddev sum varianc
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal
    Please help

  • Can we do Dml statements on materialize views

    I want to know can we do Dml statements on materialize views .If yes, how

    Can you? Maybe. Depends on how you created the materialized view. Should you? Maybe. Are you running a multi-master environment? Or are you using materialized views for one-way replication? If you are doing one-way replication, do you want your DML changes to be retained beyond the next refresh of the materialized view?
    Justin

  • Golden Gate - DML statements are not replicated to target database

    Hi,
    Testing Environment
    Source:
    OS: RHEL 4.6, Database: 11gR2, Golden Gate 10.4, ASM
    extract ext1
    connection to database
    userid ggate, password qwerty
    hostname and port for trail
    rmthost win2003, mgrport 7800
    path and name for trial
    rmttrail C:\app\admin\GOLDENGATE\dirdat\lt
    EXTTRAIL /u01/oracle/goldengate/dirdat/lt
    --TRANLOGOPTIONS ASMUSER SYS@ASM, ASMPASSWORD sys ALTARCHIVELOGDEST /u03/app/arch/ORCL/archivelog
    --DDL support
    ddl include mapped objname sender.*;
    --DML
    table sender.*;
    Target:
    OS: Windows 2003, Database: 11gR2, Golden Gate 10.4
    --replicate group
    replicat rep1
    --source and target defintions
    ASSUMETARGETDEFS
    --target database login
    userid ggate, password ggate
    --file for discared transaction
    discardfile C:\app\admin\GOLDENGATE\discard\rep1_disc.txt, append, megabytes 10
    --ddl support
    DDL
    --specifying table mapping
    map sender.* ,target receiver.* ;
    I've Successfully setup Oracle Golden Gate test environment as above.
    DDL statements are replicating successfully to target database.
    while DML statements are not being replicated to target database.
    Pl. try to solve the problem
    Regards,
    Edited by: Vihang Astik on Jul 2, 2010 2:33 PM

    Almost ok but how you will handle the overlapping (transactions captured by expdp & captured by Extract too) of transactions for the new table ?
    Metalink doc ID 1332674.1 has the complete steps. Follow the "without HANDLECOLLISIONS" approach.

  • How to monitor DML statements

    Hi pals,
    I want to know how i can monitor DML statements, i can able to monitor select statments but don't DML statements, is there any way or script in following format:
    Executer,Statement,%Completed,%left,Exec_Time,Time_left
    Where
    Executer is a user who runs the statement
    Statement which statement runs
    %completed how much DML operation completed
    %left how much DML operation left
    Exec_Time elapsed time
    time_left how much time remaining in complete operation
    I really apperciate you pals if you can give me some idea how this can be possible??
    Thanks in advance
    Hassan Khan

    Hi,
    These info can be found in V$SESSION_LOGOPS. But the view isn't populated for every query and sometimes it's a bit weird (I actually had queries that ouput 290% of "work" - parallel query side effect). Also notice that this is for long ops, and not everything will be reported there.
    HTH,
    Yoann.

  • How to Split ddl or dml statement

    Hi guys,
    i'm using oracle 11.2
    i've the following question.
    i've a string that can contains multiple ddl or dml statement and i need to split them in more statement.
    i.e. i can have a string like the below and i need 2 string each one with a statement:
    insert into TEST_KIT_USER1.table1 values (1,'a');
    insert into TEST_KIT_USER1.table1 values (2,'b');
    otherwise i can have a string like the below and i need 2 string each one with a statement:
    create table TEST_KIT_USER1.table2
    name char(10),
    surname CHAR(10 BYTE)
    create table TEST_KIT_USER1.table3
    id number,
    description CHAR(10 BYTE)
    is there a simple way to do this?

    Have you tried using iMovie?
    I know that iMovie HD '06 can do this, I'm not sure if '08 can.
    If you have iLife '08, you can download iMovie HD '06 from apple's site here.
    Good luck!

  • Constructing Database Update DML Statements

    This is a very common problem I am sure but want to know how others handle it. I am creating a web application via Servlets and JSPs. I am working with Oracle 10g.
    Here's the problem/question.
    When I present an html form to a user to update an existing record, how do I know what has changed in the record to create the dml statement? I could just update the entire record with the values supplied via the POST data on submit but that does not seem right since maybe only 1 out of 10 fields actually changed. This would also write needless audit and logging information to the database. I have thought about comparing the Request parameters sent with the post with the original java bean used to populate the form in the first place by adding it back to the request as an attribute. Is this the only way to do it or is there a better way?
    Thanks everyone,
    -Brian

    What database drivers are you using? I recall there being some bug in
    sp2 that caused delayed transaction commits for a very specific
    combination of transaction settings and database drivers.
    I think it was third-party type II Oracle drivers and local
    transactions, but I'm not sure.
    In any case, I'd contact support as there is a patch available.
    David
    Gurjit wrote:
    Hi all,
    I have posted something of this sort earlier too. The problem is that
    the database is not reflecting what has been updated using queries from the
    application.
    THe structure of the application is as follows.
    DB = Oracel 8.1.6
    Web Server = iPlanet 4.0
    App Server = iPlanet 6.0 sp2
    The database is connected to via the EJB's. No Database transactions are
    being used except for Bean transactions which are container managed. The
    setAutoCommit flag is set to true. Each query is a transaction. The jsp's
    call these ejb's through wrapper classes. As stated earlier the database
    updates (Inserts, update, delete statements) are not getting reflected in
    the database immediately. The updates happen after a gap of about 7-10
    minutes. Why is this sort of behaviour coming up. This is almost like batch
    updates happening on the database. Is there a setting in IPlanet for
    removing this kind of problem.
    Regards,
    Gurjit

Maybe you are looking for

  • Unable to start replicat process

    Hi, We have configured goldengate between two oracle system for uni directional replication, it's running for few hours after that in target side the replicat process is abended with below error message, 2012-08-02 10:12:07 WARNING OGG-01004 Aborted

  • Creating spot color in Illustrator CS4 js

    Hi, I need to create spot color in Illustrator CS4 with js, with assigned name and color values. Here what I have: myColor = myDoc.spots.add({name:"FOIL", colorValue:[10, 0, 100, 0]}); But it comes out as process instead of spot and the color is not

  • PO Interface

    Hi All, In PO_HEADERS_INTERFACE table a purchase order is available. After i run the Import Standard PO concurrent the PO doesnt move to the base table in oracle apps 12.1. In PO_INTERFACE_ERRORS table the error is shown as INTERFACE_TYPE PO_DOCS_OPE

  • Business Tier / Web Services / Web Services Proxy does not exists

    Hi, from the documentation: 'To call a web service from an application module, you perform three steps: 1. Create a web service proxy class for the web service. 2. Create an instance of the web service proxy class in your application module. 3. Invok

  • Preferences in ITUNES freezes

    I am trying to change my preference in ITUNES and no matter what tab I click on, when I change the preference and click OK it freezes. Does anybody know why? Thanks