Which sql processes fast?

I am writing a program that will change the emplids in a database from one value to another.
The way that I am doing it is to get the tables where emplid is a column (and the ones that have a column name ending in ID and checking if they prompt against a table that has emplid)
I am storing the one to new values in a table ep_t_epxh900
So as I process each table from the list above I can do one of these processes
begin-SQL ON-ERROR=UPDATE-ERROR
Update [$Table] t
set t.emplid = (select emplid from PS_EP_epxh900
where old_emplid = t.emplid)
where t.emplid in (select old_emplid from PS_EP_epxh900
where old_emplid = t.emplid)
end-SQL
or
Read through the ep_t_epxh900 one emplid at a time and issue the above update just for one employee.
Caveat, some tables have over 32 million rows.
I will be using the large rollback segment
If I use the latter solution I can issue a commit at the change of employee id. If I use the former I will need to do it at the change of a table.
Which in your opinion is the better solution. I seem to think that the latter is safer, what do you think?

I generally use merge statement for this kind of logic because is easy.
Note: Applicable to Oracle 9i and above
merge  /*+ parallel(t1,6) append */ into t1
using  PS_EP_epxh900 p on t1.emplid=p.old_emplid
when matched then update set t.emplid=p.new_empidOr try this --not testd
UPDATE ( SELECT tgt.emplid       AS  tgt_name
                       , src.new_empid AS src_name
                       ,src.old_empid    AS src_old_namel
              FROM   t1 tgt
                       , PS_EP_epxh900  src
             WHERE  tgt.emplid = src.src_old_namel)
    SET tgt_name = src_name;
Edited by: user627047 on Jul 18, 2012 10:58 AM

Similar Messages

  • SQL that shows which client process is connected to which server process

    Hi,
    I am running database on Linux.
    I have many oraclePROD processes (up to 100). These are dedicated server processes, which are opened by several client processes.
    I want to know which server process is connected to which client process. I see that v$session gives the session# and client process, but does not give information about the related dedicated server process.
    Is there any v$ view that gives this information?
    Thank you.

    user12952237 wrote:
    Hi,
    I am running database on Linux.
    I have many oraclePROD processes (up to 100). These are dedicated server processes, which are opened by several client processes.
    I want to know which server process is connected to which client process. I see that v$session gives the session# and client process, but does not give information about the related dedicated server process.
    Is there any v$ view that gives this information?
    Thank you.
      1* select process from sys.v_$session where username = 'USER1'
    SQL> /
    PROCESS
    29711
    SQL> !ps -ef | grep sqlplus
    bcm      29711  1980  0 08:04 pts/0    00:00:00 sqlplus
    bcm      29761 29711  0 08:07 pts/0    00:00:00 /bin/bash -c ps -ef | grep sqlplus
    bcm      29763 29761  0 08:07 pts/0    00:00:00 grep sqlplus
    SQL>

  • Which Parallel processing is faster?

    There are various ways in which parallel processing can be implemented e.g.
    1. Call function STARTING NEW TASK which uses dialog work process.
    2. Using background RFC (trfc) .. call function IN BACKGROUND TASK AS SEPARATE UNIT
    3. Using submit via jobs
    I want to know which technique is fastest and why?

    soadyp wrote:
    The throughput of the various workprocess is NOT identical.
    > I was a little surprised to discover this.  Is seems the DISP+WORK behaves differently under different workprocess types.
    > Clearly a background process does need/ doesnt support dialog processing and the CLASSIC PBO/PAI process.
    >
    > All I can say, is TEST it on your kernel.
    >
    > We have done testing on this since every millisecond is import to us.
    >
    > Dialog processes are sometimes twice as slow as baclground tasks depending on what is happening.
    > Im talking abap the ABAP execution time here.Not DB, RFC, external call , PURE ABAP execution times.
    >
    > DIALOG was simply slower than Background processes.
    >
    > TRY it:  Build a report. SUBMIT report in background.
    > Run the same abap in dialog.
    > Include GET Runtime statements to measure the execution time microseconds.
    > fill it with  PERFORM X using Y , CALL FUNCTION B or CALL CLASS->Method_M
    > set the clock resolution high, and measure the total execution time.
    >
    > When running HUGE interfaces, processing 10 of millions of steps every day, this is of genuine consideration.
    >
    > ALSO NOTE:
    > The cost of open JOB   submit via job  close should also be measured.
    > If your packets are too small, then background speed is lost to the overhead of submission.
    >
    > The new Background RFC functions should also be tested with the SAME CODE.
    >
    > happy testing
    > Phil
    Dialog might be slower only due to the GUI communication or difference in ABAP source code. In some standard SAP applications there is a different processing depending on SY-BATCH flag.
    Technically, as it was already mentioned several time above, both work processes (dialog and batch) are pretty identical (with slight differences in memory allocation).
    So please don't confuse the community.

  • Is it possible to schedule a Webi report based on another input, i.e. expose a time in which a process was finished.

    These are Webi, user created reports.
    Is it possible to schedule a Webi report based on another input, i.e. expose a time in which a process was finished (this can be obtained via a SQL call, service call, etc).
    The issue is that if a user schedules a report for 9PM but a process to move data, etc has not completed then that forces the user to keep re-freshing the report hoping that the process has been complete.
    Ideally, in the selection UI add to the dropdown for 'when' the option 'Use Process X completion Time' (since it is a daily report).
    Then starting around 9PM check to see if that 'time" value is populated then refresh (run) the report. Or it could just be a flag that the process has finished.
    User's in the webi environment are asking for this, and moving their reprots to BO is not an option. That's why they have the custom webi enviroment.
    Thank you.

    There is no very good way to create a working event based on a file as the file will need to be deleted as soon as the event is triggered. However there are work around which can be done for this. Here is a link which is discussing about the process.. http://scn.sap.com/thread/1677109
    Once you have created a file based even in CMC > Events> System Events and made a work around program to delete the file once the event is trigged all you would need to do in webi is in launchpad just schedule > Events > select the file based event from all available system events. Here is a screenshot how to make a report run based on a event..

  • Alert/Warning messages from PL/SQL process

    Hi all,
    I have a PL/SQL process that I execute from javascript : doSubmit(MY_PROCESS). I want to output an alert box if some errors occurs in the process, for instance : alert('message'). Does anyone know how to do that ?
    Best regards,
    Othman.

    Thanks Andy for the reply.
    My process executes "after submit", so I cannot call directly the javascript as one mentioned. The call to "html_Get" seems to be quite complicated for a simple alert message which is not really a Application process shared component.
    So I'll go for a solution where users won't see error messages ...
    Best regards,
    Othman.

  • Calling JS function in pl/sql process

    Hello!
    I have a js function defined in 'HTML Header' :
    <script language="JavaScript" type="text/javascript">
    function disp_alert()
    alert("Data is invalid! Correct the data and click CONFIRM again.")
    </script>
    I also have a pl/sql process on this page. I want to call disp_alert function in a following way:
    if ... then call function
    else dbms_output.put_line('...');
    end if;
    How can I call this js function in 'if'??
    Tom

    There ARE ways to accomplish something like this, but they're much more complex.
    You must create a JavaScript that uses APEX's built in AJAX components; a form button will call the JavaScript, which will in turn call a PL/SQL procedure saved as an "On Demance Shared Application Process." This procedure can run any checks you like against the DB, and return data to the Javascript to display in an alert.
    You can see an example of this in use at an APEX page I created: http://htmldb.oracle.com/pls/otn/f?p=19864:5
    This isn't the same thing, but is accomplishing what it does through an APEX form, a javascript call on the text field to a PL/SQL Process that returns rows from the database dynamically...thus allowing the client side JavaScript to call server side PL/SQL.

  • PL/SQL process and popup URL

    Hi,
    I have a PL/SQL process which is called on submit but a button. This Pl/SQL creates a file on the web-server and I then want to open this file in a new browser window using the URL path to it. Can this be done from pl/sql or do I need to embed some javascript somewhere in the page. My eg block is :-
    begin
    pack.proc(15);
    owa_util.mime_header('application/vnd.ms-word');
    htp.init ;
    owa_util.redirect_url('http://server:port/my_dir/myfile.doc');
    end;
    The redirect doesnt do anything.
    Thanks for any assistance,
    Brandon

    Hi Teku,
    You just have a look at this thread, where u can find a solution for your problem.
    INSERTING Records into Second table based on First table Primary Key
    hope this helps.
    Bye,
    Srikavi

  • Before header pl/sql process creates blank space at top of page

    Hi,
    I'm finding that w/v 1.6.1 I get a blank space at the top of my page that appears to be somewhat proportional to the amount of code and/or # processes on that page that are before header. moving to after header and before regions also shows this behavior.
    There are no blank line outputs happening in the pl/sql processes, so I've got no idea why htmldb is putting blank space there.
    Anyone seen anything like this? Oracle 9.2.0.7, winxp pro
    Thanks
    matt

    Hi,
    I've had the same problem. I'm assuming that you have a region in the "After Header" position?
    If so, you could add the following in the region's Region Header:
    &lt;div style="display:none"&gt;
    and put this in the Region Footer:
    &lt;/div&gt;
    The region is defined in a table, which by definition is a block object. Block objects always begin on a new line and end with a new line - the above will put the region into a div and then hide the div.
    Regards
    Andy

  • Heavy SQL process

    Hello,
    We wanted to develop a parametrable SQL filter that can make comparison, sorting and updating operations with our RDBMS (Sybase SQL Server 11.9.2.3 connected to Websphere Application Server 3.5.4).
    Since a generic item (it's a product) of our RDMS contains 400 attributes and that we have approximatively 70000 items in our database, performance is quite important for us !
    A typical operation of our software is to compare one product (and his 400 attributes one by one in a discriminate order) for filtering purpose.
    So we got several architecture alternatives :
    - Stay in the Java world and load all needed objects in memory (using for exemple a relationnal/object mapping framework like Castor) and then compare them... but it's too bad in term of performance !
    - Delocalize compare methods in the SQL world by using JDBC Query or JDBC call to stored procedure...
    Does anybody known the best way to deal with this sort of heavy SQL process in the Java World ?
    All samples, documentations, filtering or compare algorithms are welcome !
    Thanks a lot
    Ghislain Sillaume

    If you mean that the Java/CASTOR option would be to pull in a large number of the products into memory, map them into object to do a comparison, then that would be unwise at best. If you only need to pull in a few of the products, that may be sufficiently fast (as fast or faster than doing it in the DB.
    It seems to me that a technique based on writing stored procedures to do your comparisons would be your best bet, assuming that a few sufficiently paramaterized stored procs would suffice. This, coupled with adequate indexes and well design queries should perform quite well. If you need to then pull the product definitions into a Java program, you can use an OR mapper or hand coding to do it quite easily once you figured out what the results should be...
    Chuck

  • Which SQL query performance is better

    Putting this in a new thread so that i dont confuse and mix the query with my similiar threads.
    Based on all of your suggestions for the below query,i finally came up with 2 RESOLUTIONS possible for it.
    So,which would be the best in PERFORMANCE from the 2 resolutions i pasted below?I mean which will PERFORM FASTER and is more effecient.
    ***The original QUERY is at the bottom.
    Resolution 1:-/***Divided into 2 sep. queries and using UNION ALL ****/ Is UNION ALL costly?
    SELECT null, null, null, null, null,null, null, null, null,
    null,null, null, null, null, null,null,null, count(*) as total_results
    FROM
    test_person p,
    test_contact c1,
    test_org_person porg
    WHERE p.CLM_ID ='11' and
    p.person_id = c1.ref_id(+)
    AND p.person_id = porg.o_person_id
    and porg.O_ORG_ID ='11'
    UNION ALL
    SELECT lastname, firstname,person_id, middlename,socsecnumber,
    birthday, U_NAME,
    U_ID,
    PERSON_XML_DATA,
    BUSPHONE,
    EMLNAME,
    ORG_NAME,
    EMPID,
    EMPSTATUS,
    DEPARTMENT,
    org_relationship,
    enterprise_name,
    null
    FROM
    SELECT
    beta.*, rownum as alpha
    FROM
    SELECT
    p.lastname, p.firstname, p.person_id, p.middlename, p.socsecnumber,
    to_char(p.birthday,'mm-dd-yyyy') as birthday, p.username as U_NAME,
    p.clm_id as U_ID,
    p.PERSON_XML_DATA.extract('/').getStringVal() AS PERSON_XML_DATA,
    c1.CONTACT_DATA.extract('//phone[1]/number/text()').getStringVal() AS BUSPHONE,
    c1.CONTACT_DATA.extract('//email[2]/address/text()').getStringVal() AS EMLNAME,
    c1.CONTACT_DATA.extract('//company/text()').getStringVal() AS ORG_NAME,
    porg.emplid as EMPID, porg.empl_status as EMPSTATUS, porg.DEPARTMENT,
    porg.org_relationship,
    porg.enterprise_name
    FROM
    test_person p,
    test_contact c1,
    test_org_person porg
    WHERE p.CLM_ID ='11' and
    p.person_id = c1.ref_id(+)
    AND p.person_id = porg.o_person_id
    and porg.O_ORG_ID ='11'
    ORDER BY
    upper(p.lastname), upper(p.firstname)
    ) beta
    WHERE
    alpha BETWEEN 1 AND 100
    Resolution 2:-
    /****here,the INNER most count query is removed ****/
    select *
    FROM
    SELECT
    beta.*, rownum as alpha
    FROM
    SELECT
    p.lastname, p.firstname, p.person_id, p.middlename, p.socsecnumber,
    to_char(p.birthday,'mm-dd-yyyy') as birthday, p.username as U_NAME,
    p.clm_id as U_ID,
    p.PERSON_XML_DATA.extract('/').getStringVal() AS PERSON_XML_DATA,
    c1.CONTACT_DATA.extract('//phone[1]/number/text()').getStringVal() AS BUSPHONE,
    c1.CONTACT_DATA.extract('//email[2]/address/text()').getStringVal() AS EMLNAME,
    c1.CONTACT_DATA.extract('//company/text()').getStringVal() AS ORG_NAME,
    porg.emplid as EMPID, porg.empl_status as EMPSTATUS, porg.DEPARTMENT,
    porg.org_relationship,
    porg.enterprise_name,
    COUNT(*) OVER () cnt -----This is the function
    FROM
    test_person p,
    test_contact c1,
    test_org_person porg
    WHERE p.CLM_ID ='11' and
    p.person_id = c1.ref_id(+)
    AND p.person_id = porg.o_person_id
    and porg.O_ORG_ID ='11'
    ORDER BY upper(p.lastname), upper(p.firstname)
    ) beta
    WHERE
    alpha BETWEEN 1 AND 100
    ORIGINAL QUERY
    SELECT
    FROM
    SELECT
    beta.*, rownum as alpha
    FROM
    SELECT
    p.lastname, p.firstname, porg.DEPARTMENT,
    porg.org_relationship,
    porg.enterprise_name,
    SELECT
    count(*)
    FROM
    test_person p, test_contact c1, test_org_person porg
    WHERE
    p.p_id = c1.ref_id(+)
    AND p.p_id = porg.o_p_id
    $where_clause$
    ) AS results
    FROM
    test_person p, test_contact c1, test_org_person porg
    WHERE
    p.p_id = c1.ref_id(+)
    AND p.p_id = porg.o_p_id
    $where_clause$
    ORDER BY
    upper(p.lastname), upper(p.firstname)
    ) beta
    WHERE
    alpha BETWEEN #startRec# AND #endRec#

    I have now run the explain plans and put them below seperately for each SQL.The SQL queries for each of the items are posted in the 1st post of this thread.
    ***The original QUERY is at the bottom.
    Resolution 1:-/***Divided into 2 sep. queries and using UNION ALL ****/ Is UNION ALL costly?
    EXPLAIN PLANS SECTION
    1- Original
    Plan hash value: 1981931315
    | Id  | Operation                           | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                    |                    | 22859 |   187M|       | 26722  (81)| 00:05:21 |
    |   1 |  UNION-ALL                          |                    |       |       |       |            |          |
    |   2 |   SORT AGGREGATE                    |                    |     1 |    68 |       |            |          |
    |   3 |    MERGE JOIN OUTER                 |                    | 22858 |  1517K|       |  5290   (1)| 00:01:04 |
    |   4 |     MERGE JOIN                      |                    | 22858 |   982K|       |  4304   (1)| 00:00:52 |
    |*  5 |      INDEX RANGE SCAN               | test_org_person_I3 | 24155 |   542K|       |   363   (1)| 00:00:05 |
    |*  6 |      SORT JOIN                      |                    | 22858 |   468K|  1448K|  3941   (1)| 00:00:48 |
    |*  7 |       TABLE ACCESS FULL             | test_PERSON        | 22858 |   468K|       |  3716   (1)| 00:00:45 |
    |*  8 |     SORT JOIN                       |                    | 68472 |  1604K|  4312K|   985   (2)| 00:00:12 |
    |   9 |      INDEX FAST FULL SCAN           | test_CONTACT_FK1   | 68472 |  1604K|       |   113   (1)| 00:00:02 |
    |* 10 |   VIEW                              |                    | 22858 |   187M|       | 21433   (1)| 00:04:18 |
    |  11 |    COUNT                            |                    |       |       |       |            |          |
    |  12 |     VIEW                            |                    | 22858 |   187M|       | 21433   (1)| 00:04:18 |
    |  13 |      SORT ORDER BY                  |                    | 22858 |  6875K|    14M| 21433   (1)| 00:04:18 |
    |  14 |       MERGE JOIN OUTER              |                    | 22858 |  6875K|       | 18304   (1)| 00:03:40 |
    |  15 |        MERGE JOIN                   |                    | 22858 |  4397K|       | 11337   (1)| 00:02:17 |
    |  16 |         SORT JOIN                   |                    | 22858 |  3013K|  7192K|  5148   (1)| 00:01:02 |
    |* 17 |          TABLE ACCESS FULL          | test_PERSON        | 22858 |  3013K|       |  3716   (1)| 00:00:45 |
    |* 18 |         SORT JOIN                   |                    | 24155 |  1462K|  3800K|  6189   (1)| 00:01:15 |
    |  19 |          TABLE ACCESS BY INDEX ROWID| test_ORG_PERSON    | 24155 |  1462K|       |  5535   (1)| 00:01:07 |
    |* 20 |           INDEX RANGE SCAN          | test_ORG_PERSON_FK1| 24155 |       |       |   102   (1)| 00:00:02 |
    |* 21 |        SORT JOIN                    |                    | 68472 |  7422K|    15M|  6968   (1)| 00:01:24 |
    |  22 |         TABLE ACCESS FULL           | test_CONTACT       | 68472 |  7422K|       |  2895   (1)| 00:00:35 |
    Predicate Information (identified by operation id):
       5 - access("PORG"."O_ORG_ID"='11')
       6 - access("P"."PERSON_ID"="PORG"."O_PERSON_ID")
           filter("P"."PERSON_ID"="PORG"."O_PERSON_ID")
       7 - filter("P"."CLM_ID"='11')
       8 - access("P"."PERSON_ID"="C1"."REF_ID"(+))
           filter("P"."PERSON_ID"="C1"."REF_ID"(+))
      10 - filter("ALPHA"<=25 AND "ALPHA">=1)
      17 - filter("P"."CLM_ID"='11')
      18 - access("P"."PERSON_ID"="PORG"."O_PERSON_ID")
           filter("P"."PERSON_ID"="PORG"."O_PERSON_ID")
      20 - access("PORG"."O_ORG_ID"='11')
      21 - access("P"."PERSON_ID"="C1"."REF_ID"(+))
           filter("P"."PERSON_ID"="C1"."REF_ID"(+))
    -------------------------------------------------------------------------------terprise_name
    Resolution 2:-
    EXPLAIN PLANS SECTION
    1- Original
    Plan hash value: 1720299348
    | Id  | Operation                          | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                   |                    | 23518 |    13M|       | 11545   (1)| 00:02:19 |
    |*  1 |  VIEW                              |                    | 23518 |    13M|       | 11545   (1)| 00:02:19 |
    |   2 |   COUNT                            |                    |       |       |       |            |          |
    |   3 |    VIEW                            |                    | 23518 |    13M|       | 11545   (1)| 00:02:19 |
    |   4 |     WINDOW SORT                    |                    | 23518 |  3536K|       | 11545   (1)| 00:02:19 |
    |   5 |      MERGE JOIN OUTER              |                    | 23518 |  3536K|       | 11545   (1)| 00:02:19 |
    |   6 |       MERGE JOIN                   |                    | 23518 |  2985K|       | 10587   (1)| 00:02:08 |
    |   7 |        SORT JOIN                   |                    | 23518 |  1561K|  4104K|  4397   (1)| 00:00:53 |
    |*  8 |         TABLE ACCESS FULL          | test_PERSON        | 23518 |  1561K|       |  3716   (1)| 00:00:45 |
    |*  9 |        SORT JOIN                   |                    | 24155 |  1462K|  3800K|  6189   (1)| 00:01:15 |
    |  10 |         TABLE ACCESS BY INDEX ROWID| test_ORG_PERSON    | 24155 |  1462K|       |  5535   (1)| 00:01:07 |
    |* 11 |          INDEX RANGE SCAN          | test_ORG_PERSON_FK1| 24155 |       |       |   102   (1)| 00:00:02 |
    |* 12 |       SORT JOIN                    |                    | 66873 |  1567K|  4216K|   958   (2)| 00:00:12 |
    |  13 |        INDEX FAST FULL SCAN        | test_CONTACT_FK1   | 66873 |  1567K|       |   110   (1)| 00:00:02 |
    Predicate Information (identified by operation id):
       1 - filter("ALPHA"<=25 AND "ALPHA">=1)
       8 - filter("P"."CLM_ID"='11')
       9 - access("P"."PERSON_ID"="PORG"."O_PERSON_ID")
           filter("P"."PERSON_ID"="PORG"."O_PERSON_ID")
      11 - access("PORG"."O_ORG_ID"='11')
      12 - access("P"."PERSON_ID"="C1"."REF_ID"(+))
           filter("P"."PERSON_ID"="C1"."REF_ID"(+))
    ORIGINAL QUERY
    EXPLAIN PLANS SECTION
    1- Original
    Plan hash value: 319284042
    | Id  | Operation                          | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                   |                    | 22858 |   187M|       | 21433   (1)| 00:04:18 |
    |*  1 |  VIEW                              |                    | 22858 |   187M|       | 21433   (1)| 00:04:18 |
    |   2 |   COUNT                            |                    |       |       |       |            |          |
    |   3 |    VIEW                            |                    | 22858 |   187M|       | 21433   (1)| 00:04:18 |
    |   4 |     SORT ORDER BY                  |                    | 22858 |  6875K|    14M| 21433   (1)| 00:04:18 |
    |   5 |      MERGE JOIN OUTER              |                    | 22858 |  6875K|       | 18304   (1)| 00:03:40 |
    |   6 |       MERGE JOIN                   |                    | 22858 |  4397K|       | 11337   (1)| 00:02:17 |
    |   7 |        SORT JOIN                   |                    | 22858 |  3013K|  7192K|  5148   (1)| 00:01:02 |
    |*  8 |         TABLE ACCESS FULL          | test_PERSON        | 22858 |  3013K|       |  3716   (1)| 00:00:45 |
    |*  9 |        SORT JOIN                   |                    | 24155 |  1462K|  3800K|  6189   (1)| 00:01:15 |
    |  10 |         TABLE ACCESS BY INDEX ROWID| test_ORG_PERSON    | 24155 |  1462K|       |  5535   (1)| 00:01:07 |
    |* 11 |          INDEX RANGE SCAN          | test_ORG_PERSON_FK1| 24155 |       |       |   102   (1)| 00:00:02 |
    |* 12 |       SORT JOIN                    |                    | 68472 |  7422K|    15M|  6968   (1)| 00:01:24 |
    |  13 |        TABLE ACCESS FULL           | test_CONTACT       | 68472 |  7422K|       |  2895   (1)| 00:00:35 |
    Predicate Information (identified by operation id):
       1 - filter("ALPHA"<=25 AND "ALPHA">=1)
       8 - filter("P"."CLM_ID"='1862')
       9 - access("P"."PERSON_ID"="PORG"."O_PERSON_ID")
           filter("P"."PERSON_ID"="PORG"."O_PERSON_ID")
      11 - access("PORG"."O_ORG_ID"='1862')
      12 - access("P"."PERSON_ID"="C1"."REF_ID"(+))
           filter("P"."PERSON_ID"="C1"."REF_ID"(+))
    -------------------------------------------------------------------------------Edited by: user10817659 on Feb 19, 2009 11:47 PM
    Edited by: user10817659 on Feb 21, 2009 12:23 AM

  • Javascript in pl/sql process block

    Hi,
    Can someone please tell me why this code is not working.....
    I have put this in my pl/sql process....
    htp.p('<script language=javascript>');
    htp.p('var r=confirm("This is a duplicate record , do you want to proceed?");');
    htp.p('if (r==true)');
    htp.p('{document.wwv_flow.submit();}');
    htp.p('else{ }');
    htp.p('</script>');
    Please help
    thanks and regards,
    deepa

    What you need, in your case, is the reverse approach
    – calling PL/SQL from JavaScript code – which is
    possible, using AJAX...
    It seems like what you are trying to do is a
    validation process. Pressing the button should fire a
    JavaScript code, which in turn will fire an on-demand
    PL/SQL procedure, and according to the returned
    results will display a confirm dialog boxHi Arie,
    This is exactly what I am struggling to do, but I don't think is working...is there a good example somewhere, with good documentation saying what goes where? I've tried looking at Carl's On-Demand page example and I just can't tell if I'm following it correctly.
    Based on what is entered in P4_PROJECT_NUM, I need to verify that the value isn't already in the database when the user tabs out of the field.
    My javascript for page 4 (in HTML Header):
    function checkCO()
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=validate_value',4);
    get.add('ID', $x('P4_PROJECT_NUM').value)
    gReturn = get.get();
    if(gReturn) // if function return true
    alert($x('P4_PROJECT_NUM').value + ' already exists in database.');
    get = null;
    //-->
    </script>
    My onDemand process, from the Application Processes:
    declare
    v_count number;
    cursor cr_check_co is
    select count(*)
    from usd_changeorders
    where chg_ref_num = v('ID');
    begin
    open cr_check_co;
    fetch cr_check_co into v_count;
    close cr_check_co;
    if (nvl(v_count, 0) = 0) then
    return true;
    else
    return false;
    end if;
    end;
    I am calling the javascript from the onBlur event of the field I want verified.
    I am getting an alert, but it is displaying every time, whether the value is valid or not.
    Can you tell me what I am doing wrong?
    Thanks!!
    Janel

  • PL/SQL process returning message with more than 4000 chars

    In our apex application we are using a pl/sql process returning a message.
    This message should be shown to the user.
    Our problem is now, that the application items in APEX seem to be limited to 4000 chars and the message can be longer.
    We are also not able to use a collection, because we can't print the content of a collection in the "Process Success Message".
    Here is the content of a page process which is running on page load after header:
    Name - Type:     PL/SQL anonymous block
    Source - Process: :AI_TEST := p0001_pkg.get_text;
    Messages - Process Success Message: &AI_TEST.
    Image from process [https://twitter.com/OliverLemm/status/324058809138032640/photo/1/large]
    If the page is called the result is this error message:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Technical Info (only visible for developers)
    is_internal_error: false
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    component.type: APEX_APPLICATION_PAGE_PROCESS
    component.id: 16433072916569237418
    component.name: get_text
    error_backtrace:
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 100
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 141
    Edited by: Oliver L on 16.04.2013 09:17

    no an item like P0_TEST on page 0 / global page also does not help.
    But the error is not the application item / page item it's the problem that the "Process Success Message" can't handle more than 4000 chars.
    I tried to paste a string into the process success message, but the error "Error processing row. ORA-01461: can bind a LONG value only for insert into a LONG column" occured even when i filled the textarea and saved the process.
    So there's no problem with the application item or page item.
    Edited by: Oliver L on 16.04.2013 10:00

  • How to display confirm message in APEX pl/sql process

    I have a pl/sql process that selects success messages from a database table. These messages need to be displayed to the user and confirmed (only one button, to acknowledge/dismiss the mssage) along the way.
    Is there a way to do this within the process? I see lots of examples in the Forum of doing this in javascript (which I know very little about) but suspect there must be a simple way to do this in my pl/sql process.
    Help?
    Thanks,
    Carol

    Hi Carol,
    You can put you success messages inside page items or application items (when pages are rendered or processed...).
    Then using :
    1) javascript can display these values
    2) rendering the page can display these values
    Hope this help
    Louis-Guillaume
    Homepage : http://www.insum.ca
    InSum Solutions' blog : http://insum-apex.blogspot.com

  • How to make detection and acquasition processes faster on 6602 board ?

    Hi to everybody,
    Currently I am using a NI 6602 board. And I am designing my project using VC++ in .NET framework(1.1) .
    In my application, I have to wait a digital signal(triggering signal) to go high level to start my acquasition.
    At first, I tried to check continuously that incoming digital signal in a seperate thread using ReadSingleSampleSingleLine() fxn (polling). In my application there aren't so much threads , just 3-4 threads, and this thread has the highest priority.
    But I recognised that I am missing some acquasition data after I detect the trigger signal.
    In more detail the case is: when the trigger signal arrives, I have to capture an incoming byte(which is available on another 8 digital input lines for just 5-6 microseconds).
    And the problem is : I can detect the trigger signal by polling but I am missing the incoming byte. I am trying to detect the incoming byte using ReadSingleSamplePortByte() function again by polling. The incoming byte disappears before I manage to read it.
    My fist question:
    1. Is there anything that you can suggest to make my detection and acquasition process faster?
    I tried to use digital edge triggering and change detection events hoping to faster my process. But I got an exception about my board does not support that kind of triggering.
    My second question:
    2. Is there any way to use digital edge triggering or change detection events in 6602 board?
    This is the first time I am using an NI board.
    I noticed that 6602 is specialized on timer counter concepts, not on digital I/O concepts. But I don't have a chance to use any other board right now and I have to manage my application using 6602.
    any help is welcomed.
    thanks in advance.
    koray.

    In a more readable form:
    Hi to everybody,
    Currently I am using a NI 6602 board. And I am designing my project using VC++ in .NET framework(1.1) .
    In my application, I have to wait a digital signal(triggering signal) to go high level to start my acquasition.
    At first, I tried to check continuously that incoming digital signal in a seperate thread using ReadSingleSampleSingleLine() fxn (polling). In my application there aren't so much threads , just 3-4 threads, and this thread has the highest priority. But I recognised that I am missing some acquasition data after I detect the trigger signal.
    In more detail the case is: when the trigger signal arrives, I have to capture an incoming byte(which is available on another 8 digital input lines for just 5-6 microseconds).
    And the problem is : I can detect the trigger signal by polling but I am missing the incoming byte. I am trying to detect the incoming byte using ReadSingleSamplePortByte() function again by polling. The incoming byte disappears before I manage to read it.
    My fist question:
    1. Is there anything that you can suggest to make my detection and acquasition process faster?
    I tried to use digital edge triggering and change detection events hoping to faster my process. But I got an exception about my board does not support that kind of triggering.
    My second question:
    2. Is there any way to use digital edge triggering or change detection events in 6602 board?
    This is the first time I am using an NI board. I noticed that 6602 is specialized on timer counter concepts, not on digital I/O concepts. But I don't have a chance to use any other board right now and I have to manage my application using 6602.
    any help is welcomed.
    thanks in advance.
    koray.

  • Updated to LR 5.4, images now importing extremely slow. After importing and rendering images are still very slow to go through and develop. No issues in LR 5.3 which was very fast.

    After importing and rendering images are still very slow to go through and develop. No issues in LR 5.3 which was very fast. Canon,Nikon, Leica and Fuji files all rendering slow. iMac 2.9 ghz 16gb RAM OSX 10.8.5. Catalogs and images are kept on external drives. Drives running fine. Really need a fix on this since I'm norally imported and processing at least 4,000 images per LR Catalog. Is there way to revert back to 5.3? I can't use 5.4 is its current state. Thanks.

    Download LR 5.3 and install it
    By the way, lots of people have this complaint about LR 5.4, and the advice I give is to use LR 5.3 unless you need one of the new camera models supported by LR 5.4

Maybe you are looking for

  • Descriptions are not being exported even though option is ticked

    This is a new problem for me.  Not sure when it cropped up, but possibly in the last iPhoto update? When I export a photo from my library and tick the 'Titles and Keywords' box, the description field is not copied into the IPTC caption field as it us

  • Free Keynote templates

    Free Keynote templates can be found at the following url: http://etc.usf.edu/presentations/ David Moore eMac/MacBook Pro/   Mac OS X (10.4.9)  

  • Image darkening on export

    Since upgrading to Aperture 3.1.2 and Mac OS 10.6.7 I have noticed that when I export an image to my external editor (Pixelmator) or my plug-in (Silver Efex Pro 2) the image opens in the programme considerably darker than in Aperture. I correct this

  • Unable to use allocate B1 Starter Pack license

    Hello Experts, I need to test the Starter Package (or B1 Starter Pack license) but I have trouble to switch to the B1 Starter Pack user license. In my testing environment, I am currently running 8.8 with the Professional user license. So far, I did;

  • ADF Faces & BC: Remove unwanted 'model' dir from viewcontroller project

    Hi all, I would like to know how to remove the 'model' directory from our ViewController project. Steps to see this config: 1. right click on your "ViewController" project from the application navigator pane 2. Select 'Project Content' 3. Select 'Mod