DML Procedures

Hi All,
1) whether lite suppprts pl/sql procedures since some docs says it only support java procedures
2) Document of win32 has some examples about dml procedures which talks about dynamic sql statements
so can some one put some light on this
3) where shld package to be created in mobile schema or application schema?
Thanks in advance
Sekhar

Sekhar,
1). OLite does not support PL/SQL only Java Stored Procedures.
2). There are implementations of PL/SQL and stored procedures on the server side for conflict resolution.
3). The Package is creaed on the backend Oracle instance.
Phil

Similar Messages

  • About creating an AJAX page with DML procedures  using dynamic actions

    About creating an AJAX page with DML procedures in APEX using dynamic actions. Help with limitations.
    I want to share my experience, creating AJAX procedures in APEX 4.0.
    LIMITATIONS
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??
    Here are the steps to create an AJAX Updatable Form using the sample table DEPTS. You can see the demo here: [http://apex.oracle.com/pls/apex/f?p=15488:1]
    1)     Create a blank page
    2)     Add a Report Region for departments (It shows the columns deptno, dname and loc).
    3)     Add an HTML Region and create the elements to edit a Department.
    a.     P1_DEPTNO (Hidden to store PK)
    b.     P1_DNAME (Text Field)
    c.     P1_LOC (Text Field)
    4)     You also have to create a hidden element called P1_ACTION. This will help to trigger dynamic actions to perform DMLs.
    5)     Open Page Attributes and in the HTML Header Section include the following code.
    <script>
         function doSelect(pId){
              $x_Value(‘P1_DEPTNO’,pId);
              $x_Value(‘P1_ACTION’,’SELECT’);
    </script>
    6)     Modify the column DEPTNO in the report, to add column link. In the link text you can use #DEPTNO# , in target you must select ‘URL ‘ and in the URL field write javascript:doSelect(#DEPTNO#);
    7)     Create the following Buttons in the Form Region.
    CANCEL     Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CANCEL’);
    NEW          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’NEW’);
    SAVE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’UPDATE’);
    CREATE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CREATE’);
    8)     Create the following Dynamic Action to Select a Department
    Name:     Select Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     SELECT
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    SELECT dname, loc
    INTO :P1_DNAME, :P1_LOC
    FROM dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    The first limitation, the value of page elements don’t do refresh so I added the following true actions to the dynamic action AFTER Execute PL/SQL Code.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    9)     Create the following Dynamic Action to Update a Department
    Name:     Update Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    UPDATE dept SET
    dname = :P1_DNAME,
    loc = :P1_LOC
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    10)     Create the following Dynamic Action to Create a Department
    Name:     Create Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    INSERT INTO dept(deptno,dname,loc)
    VALUES (:P1_DEPTNO,:P1_DNAME,:P1_LOC);
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Function Body
    PL/SQL Function Body:     
    DECLARE
    v_pk NUMBER;
    BEGIN
    SELECT DEPT_SEQ.nextval INTO v_pk FROM DUAL;; -- or any other existing sequence
    RETURN v_pk;
    END;
    Page Items to submit:     P1_DEPTNO
    Affected Elements: Item P1_DEPTNO
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    11)     Create the following Dynamic Action to delete a department
    Name:     Delete Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     DELETE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    DELETE dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions AFTER the Execute PL/SQL Code true Action.
    Action:     Refresh
    Affected Elements: Region Departments
    Action:     Clear
    Unmark ‘Fire on page load’
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC
    12)     Finally Create the following Dynamic Action for the NEW event
    Name:     New Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     NEW
    Action:     Clear
    Unmark *‘Fire on page load’*
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC

    I need some help to solve this issues
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??

  • Best approach for performing DMLs using stored procedures

    Hi,
    I have a really general question and would like to hear your say about this.
    I want my application to manipulate or read data using stored procedures (or packages in that manner) and not directly using queries against the DB.
    Let's say I have a table with many columns:
    create table test (pkid number(10),col1 varchar2(30), col2 number(10), col3 date,...);For such a DML procedure, is it best to do something like
    procedure do_update(i_pkid IN number,i_col1 IN varchar2, i_col2 IN number, i_col3 IN date,...) as
    begin
       update test
       set col1=i_col1,
            col2=i_col2,
            col3=i_col3...
       where pkid=i_pkid;
       commit;
    end;Or do a selective update, meaning update only a certain column every time, given only 1 column actually changes? (and how to do that - separate procedures for each column? [columns can be nulls])
    Also, is it better to work with test.col1%type instead of specifying the data type in the procedure?
    And one last question - If I have a table with 100 columns and I don't want to create a procedure with 100 parameters - the best approach would be to use a record?
    I just need to be set on the way I start implementing things in order to do it well from the start.
    Many thanks.
    Edited by: Pyrocks on Nov 17, 2010 1:58 PM

    Pyrocks wrote:
    One last clarification (although it may be more related to c/c++ developers - maybe one of you will know):
    We are working with C++ and VB against a SQLServer and my part is to translate all the existing procedures to Oracle in order to migrate the application to work with Oracle DB.
    The existing procedures use an IN parameter for each column in the table and I would really like to use rowtype like you mentioned.
    Since I'm not a c/c++/vb developer - is there an easy way of working with such types, or even User-Defined Types, from c/c++/vb (as in passing a rowtype record from c++ to a SP ?)
    I'm not looking for the actual way - just want to know how hard it would be and how much code needs to be changed in order to be able to convince the developers that this is the RIGHT way to work.
    PS. none of our developers have experience with ORACLE so they wouldn't know the answer...Not actually an Oracle server-side (SQL language or PL/SQL language) question - but a client one. And it has been a long time since I wrote a fat client using C/C++ or Delphi.
    The OCI (<i>Oracle Call Interface</i>) supports advance (user defined) SQL data types. Has since Oracle 8i. So in that respect, yes the client can support custom SQL data types.
    How well it does depends entirely on that client language's features wrt OCI integration. For example, Delphi 4 was release around Oracle 8i and supported custom SQL types. I would expect that most languages today (like Java and C#) will provide support for it.
    As for usiong +%ROWTYPE+ - this is a PL/SQL clause as far as I know. Unsure whether it is supported by the OCI. What could support it is a pre-compiler like Pro*C. These enable you to mix pseudo SQL source code with client language source code. The pre-compilation step then replaces the pseudo SQL code with native client language calls to the OCI. The code is then compiled by that client language's compiler. Pre-compilers can pull all kinds of interesting "tricks" with their pseudo SQL code support.
    The best would be to consult the applicable client language's manuals that describe the interface it supports (via OCI) to Oracle.

  • Interfacing JAVA and OLAP DML

    I am not able to get the patch no 2323002 for WinXP/NT/2000. Our project requires to tap the data stored in the cube for analysis and reporting .We plan to use OLAP-DML as a work about.
    Can we write OLAP-DML procedures to reply to the dynamic queries of the users and display ther results in JAVA i.e. interface it with JAVA? Also pls tell me how to create stored procedures. i am a new comer to OLAP. Pls help me out.
    thanx in advance
    Prahalad

    Hi,
    You should post this to the OLAP forum.
    Thanks, Mark

  • Dml_data_target_type with procedures

    when i have a datablock based on a stored procedure and i want to see what the type is of the block(dml_data_target_type) then i get the value NONE.
    code:
    get_block_property(block_id,dml_data_target_type) => NONE
    but should be procedure
    what is the problem?

    did you set that property at design time? you suppose to do so if you have dml procedures on that block.

  • Oracle xe newbie trying to create a stored procedure.

    hi there.
    i just installed oracle xe and have created a table with over 100 fields. (they all need to be there, can't make it smaller).
    i've also created an audit table that keeps track of who signed in and the fields that they've changed.
    i was thinking of creating triggers that will keep track of this information and write it out to the audit table.
    in order to accomplish the above, i'm assuming that it's best to create stored procedures that will do the update/insert/deletes to the main data table. is that correct?
    since i have my main table already created, is there any easy way to create a stored proc from it? i'd like to be able to resuse the fields names etc without having to retype everything in.
    i apologize if my question is poorly worded or very basic!
    any assistance would be appreciated.

    Hi,
    If you're always going to do DML (INSERT, UPDATE and DELETE) using your own procedures, then you doin't absolutely need a trigger. Either one can INSERT into the audit table.
    Unless you have other reasons for wanting to use DML procedures, it's probably simpler to use only a trigger.
    I don't know of any built-in tools that write procedures for you.
    You can get a list of columns from
    SELECT  column_name
    FROM    user_tab_cols
    WHERE   table_name   = 'TABLE_X';and use a text editor to do what you need to. You might adapt the query above to do some (if not all) of the editing for you.
    For example, if you want the list indented, with a comma after each column name:
    SELECT  '        ' || column_name || ','
    FROM    user_tab_cols
    WHERE   table_name   = 'TABLE_X';

  • Execute any procedure???

    Inorder to execute the job at the allotted time the user need to be able to create a procedure and execute it.
    but is execute any procedure privilege required to enable scheduling???
    what could be the reason??
    this allow the user to run procedures created by other users, right?

    Hi Visakh
    From my own notes here is what I have:
    Setting up Workbook Scheduling
    ==============================
    The workbook scheduling feature in Discoverer uses native features in the Oracle DBMS, and is therefore only available when running against the Oracle database. This feature uses the same highly scalable and reliable processing procedures within the kernel, since the summary management capability and the setup for both features is similar. These procedures use standard packages in the DBMS called DBMS_JOB.
    To enable the processing procedures for workbook scheduling in Discoverer, follow these steps:
    A. Grant Schedule Workbook Privilege to the user.
    B. Confirm that DBMS_JOBS has been installed.
    C. Specify result set storage.
    D. Set the time period at which the process kicks in.
    These procedures are described in the following sections:
    A.  Grant Schedule Workbook Privilege to the User
    The user must be granted the Schedule Workbooks privilege in the Privileges dialog. Connect to the Administration Edition, and grant the Schedule Workbooks privilege in Tools | Privileges dialog.
    B.   Confirming that DBMS_JOBS is Installed
    1. Log onto SQL*Plus as the Administrator, and execute the following SQL statement:
    SQL> select * from all_objects where object_name='DBMS_JOB' and object_type = 'PACKAGE';
    2. If you get no rows returned you need to install this package. Your DBA will know how to do it.
    C.  Specifying Result Set Storage
    When a scheduled workbook is run, the results are stored in database tables within the database. The resulting data created as part of the workbook scheduling process may be stored in one of two areas: the user's own schema or a centralized schema.
    User's Schema
    In order to enable workbook scheduling in the user's own database schema, the user requires the following database privileges:
    Create Procedure - needed to create the job
    Create Table - needed to create tenporary holding table(s) for the results, each run of the same scheduled worksheet produces a new temporary table - see general notes at end for more help
    Create View - needed to pull the results from the database
    You will also need these three grants:
    SELECT ON SYS.V_$PARAMETER;
    EXECUTE ON SYS.DBMS_JOB; won't be able to execute the job without this
    UNLIMITED TABLESPACE; needed to stop user's schema running out of space while creating the table(s) of results. Discoverer does not leave it to the DBA to set artificial limits. The only way it knows for certain that it will have enough is to have this privilese.
    As you can see, execute any procedure is not needed.
    When the schedule is first created a view is created. This allows Discoverer to run that view at the scheduled time using whatever conditions and parameters you have set. The results are populated into the table when the query is run. If you subsequently have multiple sets of results you will see them named T1, T2 and so on.
    To grant these privileges, do the following:
    1. Log onto SQL*Plus or SQLDBA as the Database Administrator.
    2. Type the following:
    SQL> Grant CREATE PROCEDURE to <USER>;
    SQL> Grant CREATE TABLE to <USER>;
    SQL> Grant CREATE VIEW to <USER>;
    where <USER> is the userid of the person who is to be allowed to schedule workbooks.
    These privileges must be granted directly to the user and not to a database role.
    Advantages: A database limit can be specified on the maximum amount of data a user can store in the database. If the result set is stored under the user's schema, then you keep control over the maximum amount of space one individual user can fill with result sets. If the user creates a scheduled workbook that fills that space, it affects only his/her own scheduled workbook.
    Disadvantage: The user is required to have the above privileges in the database.
    Repository User's Schema
    In order to enable workbook scheduling using a centralized repository user's schema, the SQL script batchusr.sql must be run in SQL*Plus or SQLDBA as a database administrator (such as, SYSTEM). This script creates a new user that is granted the above privileges.
    In addition, the administrator of the EUL must change the user so that the Repository User property is pointing to the repository user's schema just created. The centralized repository user's schema may be customized by the database administrator for space management purposes and underlying data access.
    NOTE: SELECT ANY TABLE access is given by the script batchusr.sql, but this may be limited provided the repository user's schema is granted access to the underlying data that will be accessed for workbook scheduling.
    The repository user created will not be able to directly schedule a workbook through the User Edition.
    Advantages: Each user does not need DML procedures to run scheduled workbooks.
    Disadvantages: One user can potentially run a scheduled workbook that fills the available result set space, preventing other scheduled workbooks from running until it is cleared.
    D.  Setting the Start Time for Workbook Processing
    The workbook processes run within the database on the server, and are controlled by parameters in the initialization file of the Oracle DBMS - the INIT<SID>.ORA file.
    To limit the number of processing requests that can run simultaneously:
    The parameter job_queue_processes specifies the number of concurrent processes to use to process DBMS_JOB. It controls the number of processing requests that can be handled simultaneously. The default value is zero, which means processing requests will not be created. You should set it to a minimum of 2 or more if you have any other applications that use DBMS_JOB.
    You need more than one job queue process, because if one job fails for any reason, it may keep getting re-submitted, and thus, prevent everything else in the queue from being completed. If you want to have 10 simultaneous processing requests handled, then you will need to set this to 10.
    The INIT<SID>.ORA parameter job_queue_interval is the time in seconds that controls how often the job processes wake up to process pending jobs. The default is 60, which is quite frequent. What you set this to depends on how frequently you want the process to wake up and serve the requests that have been made. Oracle recommends that you update the 60 seconds default to at least 10 minutes (a value of 600).
    NOTE: This parameter also affects summary management.
    To enable these parameters:
    1. Locate the INIT<SID>.ORA file.
    For example, on Personal Oracle7 the INIT<SID>.ORA file is held in <ORACLE_HOME>\database. Its default name is INITORCL.ORA where ORCL is the <SID> name.
    2. Enter 2 lines into the file. For example:
    job_queue_processes = 2
    job_queue_interval = 600 (equivalent to 10 minutes)
    GENERAL NOTES:
    The summary management and workbook scheduling features both use this scheduling capability within the Oracle DBMS. The interval you specify and the number of concurrent requests affect both features.
    The results from the worksheet are held in a temporary table until you remove the results or you delete the scheduled workbook.
    Tables look like this: EUL5_B060914015847Q1R1
    Views look like this: EUL5_B060914015847Q1V1
    These temporary tables are stored within the schema of the user who owns the workbook - not within the standard EUL schema. The format of the table is as follows:
    EUL5_B060914015847Q1R1 which can be broken into six separate pieces.
    These pieces are as follows:
    EUL5_ B YYMMDD HHMISS Q9 R9, where
    EUL5_ is a fixed name
    B means Batch and is a constant
    YYMMDD is the date that the worksheet was run,
    HHMISS is the time when the worksheet was run, the time is in the 24 hour clock format,
    Q9 means this is the letter Q followed by a number - E.g. Q1, which signifies the query number. I believe Oracle have some plans to allow multiple queries but for now this is always Q1,
    R9 means this is the letter R followed by a number - E.g. R1, R2 and so on. This is the run number.
    Using the above logic therefore, this is a valid example:
    EUL5_B090914015847Q1R1
    This means this is result set number 1 for query 1, run at 1:58:46 AM on 14th September 2009.
    So if you can figure out which worksheet was scheduled and when it was run you can build a view that sits on top of the latest table to give you the latest results. Something else which adds interest here is that the column names within the table do not match the column names as in your original query. The scheduled results column names use generic names such as BRVC1, BRVC2, BRD1, BRD2, BRN1 and BRN2.
    These are codes and can be interpreted as follows:
    BRCV1 and BRCV2 mean Batch Result Var Char 1 and 2,
    BRD1 and BED2 mean Batch Result Date 1 and 2,
    BRN1 and BEN2 mean Batch Result Number 1 and 2
    Best wishes
    Michael

  • Commit inside the procedure..

    Hi,
    I have a 3 procedure, which conatain the INSERT, MERGE and then UPDATE.
    I need to put a COMMIT, inside the every procedure. if i leave the commit, when it will be committed.
    Please explain.
    -Sathya

    > I have a 3 procedure, which conatain the INSERT,
    MERGE and then UPDATE.
    need to put a COMMIT, inside the every procedure. if
    i leave the commit, when it will be committed.
    Generally, we can use commit at the end of the procedure and before the exception segment starts. But, since you are calling three procedures - you have to evalaute the bussiness logic of your coding. If it is stated that combination of these three procedure ultimately considered as one work. To establish that - you have to use commit inside the main block from where these three procedure is called.
    Ex:
    Procedure aaa()
       procedure x1( );  --performs some dml
       procedure x2( ); -- again perform some dml
       procedure x3( ); -- perform some final dml
      commit;   -- here you should use the commit
    exception
      when others then
         rollback;The reason is, if there is any exception between the three procedure - all the transactions will be rolled back - thus achieving it as logical unit work.
    Hope this will clear your doubt.
    Regards.
    Satyaki De.

  • Best Practice for Package Implementation of Data Manipulation

    Hi,
    Would like to ask which is better implementation for data manipulation (insert, update, delete) stored procedure for a single table.
    To create a single procedure with input parameter for the action such as 1 for insert, 2 for update and so on
    or
    to create separate procedures for each like procedure pInsData for insert, pUpdData for update...

    Hi,
    Whenever you create a procedure it resides as a seperate object in database.
    In my opinion its better to create a single procedure which takes care of all DML concern to a table, rather than creating different procedures for each DML.
    If your number of DML are more and interrelated then its better to create a package and put all related DML procedures in the package concern to one transaction or table. This is because whenever you will call a package entire package will be placed in the memory for a particular session. So if you create different procedures for DML then you need to call the procedures each time you want it to be executed.
    Twinkle

  • Datablock not assosicated with the database on forms 10G is giving me an er

    Hi All,
    I have a simple form (D/2000 10G)
    I would like to create simple datablock which not assosicated with the database, The text-items will be populated by triggers on validate
    Save should trigger stored procedure with DML commands.
    The form is working great, but when when I press "Save", I get "FRM-40401 No changes to save error"
    How can I do it ?
    Adi.
    Message was edited by:
    user566257

    You can do it without creating a new button.
    If you want to use the default 'Save' button, just create a KEY-COMMIT trigger on form level and from this trigger call your procedure.
    You can also include a message to inform the user that the record(s) has been saved. either within your DML procedure or the trigger code.
    Regards,
    Tony Garabedian

  • Oracle Portal, OWA_UTIL.redirect_url and Max Length URL

    I have a question relating to the max length of a URL that can be used within Internet Explorer 5.5 and Oracle Portal (3.0.9.8.5) On IAS 9i version 1.0.2.2.2
    My portal page submits to a procedure that carries out some basic DML and then uses the OWA_UTIL.redirect_url api to go to a different page.
    When I am in the DML procedure, I build up several string "name/pair" values that concatenate onto my redirect url.
    i.e.
    str1 := 'p_test=1&p_test=2&p_test=3&p_test=4';
    str2 := '&p_loc=USA&p_loc=GB&p_loc=NZ';
    url := 'http://my_procedure?' || str1 || str2;
    OWA_UTIL.redirect_url (url);
    The problem I am having is that in some cases the length of the URL that i produce exceeds the max length permitted by Microsoft I.E 5.5 (2048 characters) and hence my redirect fails.
    I understand that if i were to submit the name/pair values through the header then I could have as many as necessary and have read somewhere that it is possible while using the OWA_UTIL.redirect_url api to write values into the header and then close it.
    If this is possible could someone please explain how giving an example. If not is there a workaround to this problem?
    Regards
    Duncan

    I believe that this API actually writes a redirect request into
    the header of the HTTP request. For this redirect to work, the
    body of the HTTP request needs to be empty (i.e. you can't have
    any HTML being sent in the request).
    The OWA_UTIL packages actually provide some leeway here because
    it usually reorganizes requests. That gives you some
    flexibility with what you can include, but I believe that you're
    running into a limitation imposed by the HTTP specifications.

  • Data subsetting depending on connected user

    hi there.
    It is possible to define parameters in the where clause when defining a publication item. This parameter is resolved at runtime which provides the possiblity to send just a subset of the data of the given publication item back to the remote client.
    In my case the subset is driven by the connected user. How can I configure this requirement. Do I need to define a own MyCompose class or even an own queue for this purpose?
    thx for any hints.
    j.

    Here is a section on shared maps from the documentation. You accomplish your task by assigning the user to a group.
    It is very common for publications to contain publication items that are used specifically for lookup purposes. That is, a publication item that creates a read-only snapshot. The server may change these snapshots, but the client would never update them directly. Furthermore, many users often share the data in this type of snapshot. For example, there could be a publication item called zip_codes, which is subscribed to by all Mobile users.
    The main function of Shared Maps is to improve scalability for this type of publication item by allowing users to share record state information and reduce the size of the resulting replication map tables. By default, if you have a non-updatable publication item, it defaults to using shared maps.
    Note:
    Shared Maps can also be used with updatable snapshots if the developer is willing to implement their own conflict detection and resolution logic; however, normally shared maps are only for non-updatable snapshots.
    Shared maps shrink the size of map tables for large lookup publication items and reduce the MGP compose time. Lookup publication items contain read-only data that is not updatable on the clients and that is shared by multiple subscribed clients. When multiple users share the same data, their query subsetting parameters are usually identical.
    For example, a query could be the following:
    SELECT * FROM WHERE EMP WHERE DEPTNO = :dept_id
    In the preceding example, all users that share data from the same department have the same value for dept_id. The default sharing method is based on subscription parameter values.
    In the following example, the query is:
    SELECT * FROM WHERE EMP WHERE DEPTNO = ( SELECT DEPTNO FROM EMP WHERE EMPNO = :emp_id )
    In this example, users from the same departments still share data. Their subsetting parameters are not equal, because each user has a unique emp_id. To support the sharing of data for these types of queries (as illustrated by the example), a grouping function can be specified. The grouping function returns a unique group id based on the client id.
    There is also another possible use for shared maps. It is possible to use shared maps for shared updatable publication items. However, this type of usage requires implementation of a custom dml procedure that handles conflict resolution.

  • Conflicts resolution methods in Oracle Lite

    Can anyone please provide the answers of the following questions?
    1_What Methods are used for Conflict detection and resolution for concurrent updates by multiple clients in Oracle lite databases?
    2_ Is there any method that extract semantic relation from the concurrent update transactions and create a global update schedule?
    3_ Does oracle lite use conflict avoidance mechanism?
    4_ What replication method is used by Oracle Lite Database?

    In terms of conflict resolution with oracle lite, which end do you mean? conflict resolution in the client database (ie: oracle lite) or on the server side when processing client uploads (this is just a standard oracle database), also not sure what you are trying to achieve
    *1_What Methods are used for Conflict detection and resolution for concurrent updates by multiple clients in Oracle lite databases?*
    I assume in the following that you are talking about dealing with uploads
    Depending on how the publication items are defined, the process is quite different.
    a) fast refresh publication items
    When the client synchronises, the upload data is uploaded as a packed binary file which is then unpacked and inserted into in queue tables in the mobileadmin repsitory (table names begin CFM$ followed by the publication item name). This is the only action that happens during the actual sync process.
    A second and independent process, not linked to the actual synchronisation - the MGP process, runs on the mobile server, and this has three phases - apply, process logs and compose that run one after the other. You can set the MGP to only do the apply phase, or all three.
    during the apply phase the data in the in queue tables for a particular user/transaction will be applied to the server database. Normally the MGP process is set to have three threads (this can be changed, but three is the default), and therefore three client uploads will be processed in parallel, but each of these threads is independant of the others and therefore should be seen as seperate transactions.
    It should be noted that even if you have 50 or 100 users synchronising concurrently, only three upload sets will be processed at any one time, and almost certainly a period of time after the synchronisation has completed (may be many hours depending on the MGP cycle time)
    As each of the apply threads is a seperate transaction, there is no concept of concurrency built in, and the only conflict resolution by default is based on the server wins/client wins setting of the publication item. where multiple users are updating the the same server record with 'client wins', the first user will update the data, and then the next user will update the data (just a repeat of the previous one). NOTE also that in the case of an update, ALL columns in the record are updated, there is no column level update.
    There are customisation options available to provide finer grained control over the apply process, look at the PLSQL callback packages registered against each publication item for beforeapply, afterapply, beforetranapply and aftertranapply, Apply DML procedures against the publication items and also the CUSTOMIZE package at the MGP level
    b) complete refresh publication items
    where the publication as a whole has a mixture of fast and complete refresh publication items, these normally work in the same way as the fast refresh described above. Where however you just have complete refresh items the data MAY be written directly to the server table on upload
    c) queue based publication items
    These work in realtime, rather than with a delay for the MGP process to pick up the data.
    When the user synchronises, the uploaded data is is written to the in queue tables in the same way, but when this is completed, a package (defined as part of the publication definition) is called, and the procedure upload_complete is run passing in the user and transaction identifiers. This package needs to be hand crafted, but you have full control over what and how all of the uploaded data is processed, but again this is a single transaction for that user. If you want to look at other sessions running, you need to find a way to implement this.
    *2_ Is there any method that extract semantic relation from the concurrent update transactions and create a global update schedule?*
    As noted above, the uploads may be processed in parallel, but they are seperate transactions, so no built ins
    *3_ Does oracle lite use conflict avoidance mechanism?*
    Only the basic oracle stuff, unless you use the customisation options to write your own
    *4_ What replication method is used by Oracle Lite Database?*
    The different types of publication items select data from the server database for download in different ways
    a) fast refresh
    change logging tables and triggers are created in the server database. These are scanned during the MGP process logs phase to determine what changes have happened since the last MGP compose, and what publication items they affect. The MGP compose then runs and this uses the same three threads to process the users in alphabetical order using the change keys to populate data in out queue tables (prefixed CMP$) in the repository. These have the PK values for the data, plus a transaction types (insert/update/delete). All the MGP process does is populate these out queue tables.
    When the user synchronises, the data in the out queue tables is used as a key list to extract the data from the actual server tables into a packed binary file, and this is sent to the client.
    b) complete refresh
    there is no pre-preparation in this case, the data is streamed directly from the server database into the packed binary download file
    c) queue based items
    in real time when the user is synchronising after the apply has been done by the uploade_complete procedure, a second procedure download_init is called. Within this you have to code the data extract, and MUST populate tables (you also need to create them) CTM$<publication item name> these are effectively out queue tables, but contain all of the data, not just the PK values. At the end of the procedure, the data is streamed from these into the binary file for download.
    Depending on the definition of your apublication, you could have one or more of the above types (VERY bad idea to mix queue based and fast refresh unless you are very sure about what you are doing) and therefore there may be a mix of different actions happening at different times
    In conclusion i would say that try and send seperate data to clients so that they do not interfere with each other, and for inserts use uniqueue keys or sequences. If you MUST send the same data to different clients for update, then the queue based approach provides the best control, but as it is real time is not as scalable for large data sets.

  • Insert Problem Ajax

    Hello,
    I have the following problem:
    I want to create a form to insert something into the database. Everything worked fine.
    Then I changed the source of one item from "Database Column" to "SQL Query (single return)" to provide a dynamic value.
    Now when I try to insert data I always get the exception that the value of the changed item is null but the value isn't null.
    Maybe the mapping of the item and the database isn't working because the item is not a database column anymore.
    How can I get this working?
    Thank you for your solutions :)

    Hi 982994,
    If you're using Automatic Row Processing (DML) the column must be defined as database.
    You can create your own DML procedures to handle data or to use dynamic actions for dynamic value (whatever does it mean in your example) or to create hidden database item and populate it with your "dynamic value item" on submit.
    Btw, where's AJAX here?
    Br,
    Marko Goricki
    http://apexbyg.blogspot.com/
    Edited by: Marko Goricki on Jan 21, 2013 9:04 AM

  • Adding a Process to Logout

    Hi,
    I've read several threads on logout and how it works. I've found that it typically launces page 101, and calls a routine associated with your authenication scheme. I've also found that to add a process to logout I need to add a branch that executes a PL/SQL procedure with &LOGOUT_URL. (don't forget the period)as the target. (I could have some of this wrong. If so, I apologize.)
    I kinda understand all that, but not well enough to implement what I need to.
    I have an application that authenicates to Oracle. This is in the Logout URL of the authenication scheme:
    wwv_flow_custom_auth_std.logout?p_this_flow=&APP_ID.&p_next_flow_page_sess=&APP_ID.:1
    Does &LOGOUT_URL. automatically launch the wwv_flow.... process? Is that what it does?
    I need to run a SQL that sets several fields in a table to NULL when a person clicks logout.
    Where do I put that SQL? And, how do I get it to execute?
    I must be missing something. Logout isn't a button, so how do I get things to execute when it is clicked? And, how do I run the SQL without interfering with the Logout URL or the page 101 launching?
    In case you haven't already noticed, I'm confused. Err... and have a lot of questions. Sorry. :-)
    Any help is appreciated.
    Thanks, Tony

    Tony,
    It's all very simple, really. The built-in item LOGOUT_URL gives you access to the logout URL attribute of the current authentication scheme. In referencing it as &LOGOUT_URL. or v('LOGOUT_URL'), or as a bind variable, the resulting attribute will have had basic substitutions performed on it first, e.g., for &APP_ID. and &APP_SESSION., facilitating its typical use as the target of a Navigation Bar Entry. As you found, the standard logout URL (before substitutions) looks like:  wwv_flow_custom_auth_std.logout?p_this_flow=&APP_ID.&p_next_flow_page_sess=&APP_ID.:1If you hover over this link in your application, you'll see that it's a full URL (host:port/pls/DAD/...) with substitutions completed and that the result of using the link is to execute the wwv_flow_custom_auth_std.logout procedure through modplsql.
    Let's review the standard machinery:
    What does the logout procedure do?
    ...Not much: 1) unsets your application's session cookie (actually sets it to '-1') and 2) redirects to the after-logout page.
    How does it know what cookie to unset?
    ...The cookie name is also an attribute of the curent application's authentication scheme so it looks it up.
    How does it know what the current application is since the logout procedure is not run in a "page request context"?
    ...The current application ID is a input parameter to the logout procedure (&p_this_flow=&APP_ID.).
    How does it know what page to show after logout?
    ...That's the other input to the logout procedure (&p_next_flow_page_sess=&APP_ID:1 where the application and page to redirect to are both given).
    But it looks like it goes to page 101 (login page) after logout.
    ...Yes, but the instructions were to redirect to page 1 after logout and if page 1 requires authentication, you have to login first. After login, you'll go to page 1.
    Now Tony, what you want to do is execute some DML during the logout operation. A good way to do that is to change the logout URL in the authentication scheme to simply be a URL to a page in your application, say page 99:   f?p=&APP_ID.:99:&APP_SESSION.On page 99 create a before-header process to call your DML procedure (or do the DML in the page process directly). Then create a second process on the page (also an on-load vs. an after-submit process) that does:  apex_application.g_unrecoverable_error := true;
      wwv_flow_custom_auth_std.logout(
        p_this_flow=>:APP_ID,
        p_next_flow_page_sess=>:APP_ID ||':1');Scott

Maybe you are looking for