Need Help on Plsql!

Hi,
I am trying to Write a Pl/sql Script for Updating the object Count Status While dropping a user/Schema. i really don't know about the plsql Scripting, i am in learning stage i used below Script
set serveroutput on;
declare
test26 varchar2(100);
begin
for test1 in (select count(*) out from dba_objects where owner='TEST08')
loop
if test1.out <= 0
then
dbms_output.put_line('done');
elsif test1.out >= 0 then
select count(*) out into test26 from dba_objects where owner='TEST08';
dbms_output.put_line(test1.out);
end if;
end loop;
end;
i am getting the Result(Show Only the Current Count Status), but the Problem is , not Continuously updating the result. i need the result for every 15 seconds it should show the Count status of the Schema i.e 1456 after 15second 1359,1247,1001,997,551,201,55,......
Please Advice....
Thanks
Shan

You can use dbms_application_info.set_session_longops (from another session in your case as you are monitoring DDL operations which are visible to other sessions).
Otherwise the long running processes should be "instrumented" to provide progress feedback using dbms_application_info.set_session_longops.
DECLARE
        rindex    BINARY_INTEGER;
        slno      BINARY_INTEGER;
        totalwork number;
        sofar     number;
        obj       BINARY_INTEGER;
        st date;
        et date;
        chkfreq int := 3; ---- How frequently to poll in seconds
BEGIN
rindex := dbms_application_info.set_session_longops_nohint;
sofar := 0;
-- totalwork := 5; ---- determine total work that need to be done
select count(*)
     into totalwork
     from dba_objects
     where owner='TEST08';
WHILE sofar < totalwork LOOP
    st := sysdate;
    et := st + (1/(24*3600)) * chkfreq;
    while (st <= et) loop
        select sysdate into st from dual;
    end loop;
--  sofar := sofar + 1;  ---- check how much work has been done
  select totalwork - count(*)
     into sofar
     from dba_objects
     where owner='TEST08';
  dbms_application_info.set_session_longops(rindex, slno,
    'Operation Somthing', obj, 0, sofar, totalwork, 'table', 'tables');
END LOOP;
END;
/The progress can be monitored using yet another session, using v$session_longops.
select * from v$session_longops where sid = <monitoring sessions SID>;vr,
Sudhakar B.

Similar Messages

  • Ugent: I need help with plsql:

    Some body helps me to do the following updated using plsql:
    I have two tables, xx_firm and xx_contact, related by “firm_seq”; one to many.
    The xx.contact has the following fields:
    cntc_firm_seq
    cntc_title_desc
    cntc_aap_contact
    were firm_seq (from xx_firm) is equal to cntc_firm_seq. Meaning that a firm can have one or many contacts, but one of this contacts must be storage the value “765”.
    I need able to update the field “cntc_title_desc” to 765 only if not of its contacts have that value.
    Thanks,

    there is an error in my sql and hope you may be able to spot it:
    update xx_contact c
    set cntc_title_desc='756'
    where cntc_firm_seq =(select f.firm_seq --was c.firm_seq
    from xx_firm f
    where f.firm_seq = c.cntc_firm_seq
    and c.cntc_title_desc <> '765';

  • Need help in plsql cursor

    Hi All,
    I need to insert values into a table A of similar structure of other table B.(both havin same no of colums and same type).
    Im using a cursor to fetch the values from the table B and in loop im fetching the values from the cursor to the temporary variable of the same type as the table B and im trying to insert values into table A using the following statement
    insert into table A values(temp variable);
    when i tried executing the procedure it is showing an error "Not enough values".
    I not clear whether we can use the insert statement as above or is there any other way to achieve the same.
    Please help.
    Regards,
    Mohan

    You can use an INSERCT..SELECT instead of a PL/SQL procedure:
    Insert into TableA(col1, col2, col3)
    select column1, column2,column3
      from tableB;But if you do need (want) use PL/SQL write it this way:
    declare
    cursor cb is
    select select column1, column2,column3
      from tableB;
    begin
      for recB in cb loop
         Insert into TableA(col1, col2, col3)
            values (recB.column1,recB.column2,recB.column3);
      end loop;
    end;Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/10/crittografia-in-plsql-utilizzando-dbms_crypto/]

  • Need help in Plsql for Oracle Reports

    Hi i need urgent requirement for this, Kindly guide me. Since i couldnt do.
    Main Table:
    For example: Conside this table: (Card_no, month and year are unique constraint)
    Card_No Name Amount_1 Amount _2 Total Month Year
    1 Justin 50 1000 1050 Jan 2011
    1 Justin 100 500 600 Feb 2011
    2 Charles 50 100 150 Jan 2011
    1 Justin 100 50 150 Jan 2012
    1 Justin 50 1000 1050 Feb 2012
    1 Justin 100 500 600 Mar 2012
    2 Charles 50 100 150 Jan 2012
    1 Justin 100 50 150 Jan 2012
    Now i need Reports like this:
    1. When i select Year as 2012 and select amount1, i need report like this
    Card_No Name Jan Feb Mar Apr May June . . . . Dec Total
    1 Justin 100 50 100 0 0 0 . . . 0 250
    2 Charles 50 0 0 0 0 0 . . . 0 50
    2. If i select many years and select amount1, i need report like this
    Card_No Name Year Jan Feb Mar Apr May June . . . . Dec Total
    1 Justin 2012 100 50 100 0 0 0 . . . 0 250
    1 Justin 2011 50 100 0 0 0 0 0 150
    2 Charles 2012 50 0 0 0 0 0 . . . 0 50
    2 Charles 2011 50 0 0 0 0 0 . . . 0 50
    These are the two requirements
    Kindly guide me and many more suggestion also will be helpful
    Thanks in advance

    Actually you need to use matrix report in you report style to meet your requirement
    however please try below file if you use oracle 10g (I am not much sure as it was checked long time back)
    https://docs.google.com/file/d/0B6k7l8hLvpK2UnJwUDFRR1N5d2s/edit
    Best of luck
    Edited by: AppsLearner on Aug 3, 2012 12:49 AM

  • Need help rewriting PLSQL as EVALUATE function

    Hello all,
    I've trying to convert some PLSQL (from Discoverer) into a column in Answers and I can't seem to get the formula correct.
    The original formula:
    MIN(Processed_Date) OVER(PARTITION BY Business_Area, Product, Serial_No)
    I assume this needs to be done in an EVALUATE function but I can't work out the correct syntax.
    This formula:
    EVALUATE('MIN(%1) OVER(PARTITION BY %2, %3, %4)', Processed_Date, Business_Area, Product, Serial_No)
    Generated this error:
    [nQSError: 10058] A general error has occurred. [nQSError: 22027] Union of non-compatible types. (HY000)
    I'm not sure what's causing the error and I've tried explicitly casting all the column, but still get errors.
    I'm open to any suggestions.
    Thanks.
    Edited by: jasonr on Dec 14, 2010 9:54 AM

    Jasonr,
    highlighted in bold is the change
    try this EVALUATE('MIN(%1) OVER(PARTITION BY %2, %3, %4)' AS DATE, Processed_Date, Business_Area, Product, Serial_No)
    do update if it resolved your issue.
    -bifacts
    http://www.obinotes.com
    J
    Edited by: bifacts on Dec 14, 2010 9:52 PM

  • Preparing for 1Z0-007 exam .. Need Help !!

    I have ORACLE documentation (material) but there is a lot of them here; I have the following files and I don't know which one to use for the 1Z0-007 exam:
    Introduction to Oracle9i SQL - Volume I.pdf
    Introduction to Oracle9i SQL - Volume II.pdf
    Introduction to Oracle9i SQL - Volume III.pdf
    and I also have
    Introduction to Oracle9i PLSQL - Volume I.pdf
    Introduction to Oracle9i PLSQL - Volume II.pdf
    Introduction to Oracle9i PLSQL - Volume III.pdf
    and I'm not sure is it enough to use the SQL ones only I mean the "Introduction to Oracle9i SQL - Volume I, II and III" or I have to go through the whole documentation ?!!
    Need help please !!
    Thank you in advance

    HI
    I am also trying to appear the same exam
    can you kindly sent your resources to me
    plz
    Introduction to Oracle9i SQL - Volume I.pdf
    Introduction to Oracle9i SQL - Volume II.pdf
    Introduction to Oracle9i SQL - Volume III.pdf
    and I also have
    Introduction to Oracle9i PLSQL - Volume I.pdf
    Introduction to Oracle9i PLSQL - Volume II.pdf
    Introduction to Oracle9i PLSQL - Volume III.pdf
    thanks in advance
    my email id is [email protected]

  • Need help understanding syntax

    Hi,
    I need some help to understand the following syntax .
    PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean); What is this PPARAMImpl?
    I know "am " is a variable . And with pageContext.getApplicationModule(webBean) we are trying to get the AM name for that page, then why do we need to add (PPARAMImpl) before pageContext.getApplicationModule(webBean) ?
    For example in plsql , apps.testpkg.mainproc(param1,param2)
    means
    schema.packagename.procedurename(parameter1,parameter2).
    So can you explain "PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean)" in that manner?
    pageContext.getParameter(EVENT_PARAM))
    What is this ?
    What are the possible values for EVENT_PARAM ? And by the way , I need help on setting a default value for one of my search parameters in a search region .
    Correct me If I am wrong, this is what I thought
    1. EOImpl has setters and getters for that attribute. So call the setter method in controller and set the value , if this is right then I don't know how to right the code ,can you give me some sample code ?
    or
    2. get the view object name and then set the value for that . like viewobject.setattribute('att name',att value'),if this is right then I don't know how to right the code ,can you give me some sample code ?
    Thanks
    Sri.

    Hi,
    No. These are not equal.
    pageContext.getApplicationModule(webBean) return AM of type OAApplicationModule.
    It would be fine if your variable am, is of type OAApplicationModule:
    OAApplicationModule am = pageContext.getApplicationModule(webBean) // this would be fine.
    But as you are using of type PPRAMImpl, you must have to type-cast that externally using:
    PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean);
    If you are still not clear, then refer any java book or google for internal & external type-casting in java.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help to develop Pythagoras theorem-

    Hi i need help to develop proofs 2,3,4
    of pythagoras theorems in java as demonstrations
    These are applets can anyone help me with it or give me an idea of how to go about developing it -
    the site is the following
    http://www.uni-koeln.de/ew-fak/Mathe/Projekte/VisuPro/pythagoras/pythagoras.html
    then double click on the screen to make it start

    Pardon my ASCII art, but I've always liked the following, simple, geometric proof:
         a                   b
    ---------------------------------------+
    |       |                                |
    a|   I   |              II                |
    |       |                                |
    ---------------------------------------+
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    b|  IV   |              III               |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    ---------------------------------------+It almost goes without saying that I+II+III+IV == (a+b)^2, and II == IV == a*b,
    I == a*a and III == b*b, showing that (a+b)^2 == a^2+a*b+a*b+b^2.
    I hope the following sketch makes sense, stand back, ASCII art alert again:     a                   b
    ---------------------------------------+
    |               .             VI         |
    |     .                 .                |a
    | V                               .      |
    |                                        +
    |                                        |
    |   .                                    |
    b|                                     .  |
    |                                        |
    |                  IX                    |
    | .                                      |
    |                                    .   |b
    |                                        |
    +                                        |
    |      .                                 |
    a|               .                  . VII |
    |  VIII                   .              |
    ---------------------------------------+
                     a                    bThe total area equals (a+b)^2 again and equals the sum of the smaller areas:
    (a+b)^2 == V+VI+VII+VIII+IX. Let area IX be c^2 for whatever c may be.
    V+VII == VI+VIII == a*b, so a^2+b^2+2*ab= c^2+2*a*b; IOW a^2+b^2 == c^2
    Given this fundamental result, the others can easily be derived from this one,
    or did I answer a question you didn't ask?
    kind regards,
    Jos

  • I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    What file format did you export it to?

  • Need help to open audios attached in a PDF file

    Hello
    I just need help. I have ordered a reviewer online that has audios and texts in a pdf file. I was told to download the latest adobe reader on my computer. I have done the same thing on my ipad mini. I am not so technical with regards to these things. Therefore I need help. I can access the audios on my computer but not on my ipad.
    I want to listen to audios with scripts or texts on them so i can listen to them when i am on the go. I was also informed that these files should work in any device. How come the audios doesnt work on my ipad.
    Please help me on what to do.
    Thanks

    Audio and video are not currently support on Adobe Reader. :-<
    You need to buy a PDF reader that supports them. My suggestion is PDF Expert from Readdle ($US 9.99)

  • Need help to open and look for file by name

    Hi,
            Im needing help to open a folder and look for a file (.txt) on this directory by his name ... The user ll type the partial name of file , and i need look for this file on the folder , and delete it ....
    How can i look for the file by his name ?
    Thx =)

    Hi ,
        Sry ,, let me explain again ... I ll set the name of the files in the follow order ... Name_Serial_date_chanel.sxc ..
    The user ll type the serial that he wants delete ...
    I already figured out what i need guys .. thx for the help ^^
    I used List Directory on advanced IO , to list all .. the Name is the same for all ... then i used Name_ concateneted with Serial(typed)* .. this command serial* ll list all serials equal the typed , in my case , ll exist only one , cuz its a count this serial .Then i pass the path to the delete , and its done !
    Thx ^^

  • I need help, my ipod touch is not recognized by windows as a harddisk

    i need help, my ipod touch is not recognized by windows like a memory card or a harddisk.
    i would like to transfer the files from pc to my ipod touch without useing itunes.
    as i see theres some people here that theires ipod touch are recongnzed as a digitl camra, mine is reconzied as nothing, some help plz.
    Message was edited by: B0Om

    B0Om wrote:
    ok but i still dont understed, only my itnes recongnize my ipod, when i go to " my cumputer, it dosent show up there, not even as a digital camra
    Your Touch is working correctly. Currently, without unsupported third party hacks, the Touch has NO disc mode. It will only show up in iTunes.
    how do i put programes and games in my ipod touch
    Right now, you don't. The SDK is scheduled to be released in Feburary. Then developers will be able to write programs that will be loadable.

  • Weird error message need help..

    SO.. i havent updated my itunes in a while because i keep getting this weird message.. it comes up when im almost done installing the newest/newer versions of itunes. it says
    "the feature you are trying to use is on a network resource that is unavailable" "click ok to try again or enter an alternate path to a folder containing the installation package 'iTunes.msi' in the box below"
    now when ever i choose a file from the browse box it replies with this message "the file 'xxx' is not a valid installation package for the product iTunes. try to find the installation package iTunes.msi in a folder from which you can install iTunes."
    no idea need help thanks
    ~~~lake
    Message was edited by: DarkxFlamexCaster
    Message was edited by: DarkxFlamexCaster

    +it comes up when im almost done installing the newest/newer versions of itunes. it says+ +"the feature you are trying to use is on a network resource that is unavailable" "click ok to try again or enter an alternate path to a folder containing the installation package 'iTunes.msi' in the box below"+
    With that one, let's try the following procedure.
    First, head into your Add/Remove programs and uninstall your QuickTime. If it goes, good. If it doesn't, we'll just attend to it when we attend to iTunes.
    Next, download and install the Windows Installer CleanUp utility:
    Description of the Windows Installer CleanUp Utility
    Now launch Windows Installer CleanUp ("Start > All Programs > Windows Install Clean Up"), find any iTunes and/or QuickTime entries in the list of programs in CleanUp, select those entries, and click “remove”.
    Next, we'll manually remove any leftover iTunes or QuickTime program files:
    (1) Open Local Disk (C:) in Computer or whichever disk programs are installed on.
    (2) Open the Program Files folder.
    (3) Right-click the iTunes folder and select Delete and choose Yes when asked to confirm the deletion.
    (4) Right-click the QuickTime folder and select Delete and choose Yes when asked to confirm the deletion. (Note: This folder may have already been deleted if QuickTime was successfully removed using Add/Remove Programs earlier.)
    (5) Delete the QuickTime and QuicktimeVR files located in the C:\Windows\system32\ folder. Click Continue if Windows needs confirmation or permission to continue. (Note: These files may have already been deleted if QuickTime was successfully removed using Add/Remove Programs earlier.)
    (6) Right-click on the Recycle Bin and on the shortcut menu, click Empty Recycle Bin.
    (7) Restart your computer.
    Now try another iTunes install. Does it go through properly now?

  • I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    Hold down the Option key while you boot your Mac. Then, it should show you a selection of devices. Click your flash drive and it will boot from that.

  • Need help adobe bridge cc output module

    I need help. I have an assignment I'm held up on completing because the adobe cc bridge does not have the output modue I need. I followed the adobe instructions page to the letter. I copied and pasted the output module folder to the adobe bridge cc extensions folder in programs/commonfiles/adobe. The only thing is the instructions then say to paste the workspace file into the workspace folder located below the bridge extensions folder. I don't have a workspaces folder there or anywhere. I even tried must making one and adding the file to it, but no go. can someone PLEASE help me with this?    I have an assignment due like now that requires the use of the output modue.thanks!

    oh,my system is windows 8.1. sorry, lol.

Maybe you are looking for

  • OUTGOING MAIL PROBLEMS ON IPAD AND ACBOOK PRO

    Whenever I send emails through my business mails to yahoo, gmail and other mail clients from my iPad and macbook pro, it is rejected by the server. My business mail is hosted by siteground.com. When sending the same mails on non apple devices, it goe

  • Withholding Tax details

    Hi All, I am an ABAPper and am new to the FI module; so need guidance from you experts. We are printing payment document and need the Gross Amount, Withholding Tax amount and the Net Amount on the payment document. This is required as per the country

  • How do I save "Sent" messages when sending from the ipad

    How do I save "Sent" messages when sending from the ipad2?

  • How to debug Adobe Forms

    Hi, Can any one tell me, how do i debug Adobe Forms ? Thanks, Chandra

  • Sharing on a Windows Vista

    Sorry if this is the wrong place. But i'm trying to share screens on my windows vista os at home. Does(sp) anyone have an idea