How to deal with error ORA-06531 for collection

All,
Can anybody see anything wrong with my code below. As far as I can see everything is in order but I am getting the ORA-06531 error.
Thanks in advance
CREATE OR REPLACE
Type T_PREO_PRIV is Object
PRIVILEGE_ID NUMBER(10),
PRIVILEGE_NAME VARCHAR2(20),
PRIVILEGE_TYPE CHAR(1))
CREATE OR REPLACE
TYPE T_PRIVInfo IS TABLE OF PREORDER.
T_PREO_PRIV
SQL> CREATE OR REPLACE Procedure PREORDER.P_GetUserPrivlegetest(Userid in number, UserPriv out T_PRI
VInfo, status out number)
2 as
3 V_UserPriv T_PRIVInfo;
4 begin
5 select T_PREO_PRIV(preo_priv.privilege_id, PRIVILEGE_NAME, PRIVILEGE_TYPE)
6 BULK COLLECT INTO V_UserPriv
7 from preo_user_role, preo_role_priv, preo_priv
8 where preo_user_role.role_id = preo_role_priv.role_id
9 and preo_role_priv.privilege_id = preo_priv.privilege_id
10 and user_id = Userid;
11
12 V_UserPriv := UserPriv;
13
14 status := 0;
15
16 EXCEPTION
17 WHEN OTHERS THEN
18
19 Status := -1;
20 end;
21 /
Procedure created.
SQL>
SQL> DECLARE
2 profile_info T_PRIVInfo;
3 Status smallint;
4 BEGIN
5
6 --preo_security.P_GetUserPrivlege(42, profile_info, status);
7 P_GetUserPrivlegeTest(42, profile_info, status);
8 dbms_output.put_line('P_GetUserPrivlege '||Status);
9 For i in profile_info.FIRST..profile_info.LAST loop
10
11 dbms_output.put_line('******************************* ');
12 -- dbms_output.put_line('privilege_id '||UserPriv(i).privilege_id);
13 -- dbms_output.put_line('privilege_name '||UserPriv(i).privilege_name);
14 -- dbms_output.put_line('privilege_type '||UserPriv(i).privilege_type);
15 end loop;
16
17 END;
18 /
P_GetUserPrivlege -1
DECLARE
ERROR at line 1:
ORA-06531: Reference to uninitialized collection
ORA-06512: at line 9

As in your other post, you have these reversed. The line that says
V_UserPriv := UserPriv;
should be
UserPriv := V_UserPriv;
There may also be other errors; I didn't check.

Similar Messages

  • How to deal with "Error 1001. The specified service already exists" when install a service using installer package?

    Hi everybody,
    I wrote a "Class Library" project which is a service using Visual Stodio 2008 recently, then tried to use a Visual Studio 2008
    Setup Project to install it.
    Here is what I did for the "Class Library":
    1. Finish the program.cs, Service.cs
    2. Add Installer
    3. Change the serviceInstaller so that "StartType" to be Aotumatic
    4. Change the ServiceProcessInstaller2 so that "Account" to be LocalSystem
    5.
    6. Click in F5 (Start Debugging)
    Here is what I did for the Setup Project:
    1. Add the exe file built from the "Class Library" project to the Application Folder
    2. On the Custom Action Editor, add the exe file from 1 to Install and Commit
    3. Change the property of the project so that "RemovePreviousVersion" to be true
    4. Click on F6(Build Solution)
    Then I tried to run the msi file from the built of the Setup Project. Because I modified the two projects serveral times, I uninstalled the Class Library using "Control Panel->Add or Remove Programs" before I reinstall. Two things I notived:
    1. After unstall, the registry was not cleaned up about the installed program
    2. After several rounds install/uninstall, I got "Error 1001. The specified service already exists"
    My questions are:
    1. How to cleanup the registry when uninstall a program?
    2. How to deal with the "Error 1001. The specified service already exists"?
    3. Did I do anytbing wrong with the "Class Library" or the "Setup Project"?
    Thanks a lot!
    Helen

    Hi Simon, not a problem!
    I spent some more time on this and here are few more notes:
    it is called Major Upgrade, when you are installing new version of the product upon a previous one and
    MSI supports 2 strategies:
    Strategy 1. Install a new version and uninstall previous one. (Install a new version right upon previously installed version (file merging is performed based on dll version number) and the delete previously
    installed files)
    Strategy 2. Uninstall previous version and install a new one (Delete all previous files and install from scratch new files.)
    From the first look it seems that 1st strategy is weird and buggy. But, remember, MSI is great because it's transactional!!! That means that if once some of the phases (Installation, Uninstallation, Rollback, Comit) fails, your machine
    will be reverted to the previous state and it'll be still functional. 
    Let's consider both strategies:
    Consider you have installed product_v1.msi and you want to install product_v2.msi.
    Strategy 1
    1. MSI engine copies files from Product_v1 directory to TEMP directory
    2. MSI engine merges files based on the assembly version (between v1 and v2)
    3. Once merging is completed successfully it removes files in TEMP (RemoveExistingProducts  action triggers it) and you got product_v2 installed, otherwise if it fails MSI engine revert machine to V1 and copies previous files from TEMP.
    Strategy 2
    1. MSI engine tottaly removes all files from v1.
    2. MSI engine installs v2 files and if something goes wrong you cannot revert back, because RemoveExistingProducts  allready worked out and MSI doesn't have files to revert machine back
    I recommend to everybody to use Strategy 1 and leverage MSI transaction functionality. And you can set this strategies by defining sequence of RemoveExistingProducts action. See more info
    here.  So, I think it's not even a bug in VS as I said in the upper post it is default recommened behaviour.
    AND, you got "Error 1001. The specified service already exists"
    because if we follow Strategy 1 MSI engine tries to install Windows Service on top of the existing service and OF COURSE it fails MSI engine (StopServices, DeleteServices actions are executed before actual
    installation and  they look at ServiceControl table). In order to stop service first and delete them you have to fill ServiceContol table of the MSI (and then StopServices, DeleteServices actions will recognize what to they have to stop
    and delete), like this:
    *clip*clip*clip*
    ' see http://msdn.microsoft.com/en-us/library/windows/desktop/aa371634(v=vs.85).aspx for more info
    ' Update the Service Entry to stop and delete service while uninstalling
    query = "INSERT INTO ServiceControl (ServiceControl, Name, Event, Arguments, Wait, Component_) VALUES ('MAD_Service', 'Service name', '160', '', '1', '"
    + componentName + "')"
    Set view = database.OpenView(query)
    : CheckError
    view.Execute : CheckError
    ' Update the Service Entry to stop and delete service while installing
    query = "INSERT INTO ServiceControl (ServiceControl, Name, Event, Arguments, Wait, Component_) VALUES ('MAD2_Service', 'Service name', '10', '', '1', '"
    + componentName + "')"
    Set view = database.OpenView(query)
    : CheckError
    view.Execute : CheckError
    *clip*clip*clip*
    We can uninstall service first by following Strategy 2, but then we lose transactional support.
    So, Simon did I encourage you to change your code a bit?:)
    And, btw, if you don't want to change the strategy, please don't rely on SequenceID in MSI table, it can be change, you have to get the at the runtime.
    Hope it will help to everybody!
    See also more advanced explanation of how MSI works
    here.
    Truly yours, Marat

  • How to deal with--errors occurred, no packages were upgraded

    This has only occurred to me once before, I think.
    I was running a pacman -Syu today and it was trying to upgrade kernel2612-cko2-swsusp2 with the new kernel26cko package. The old cko was installed by grabbing the pkgbuild, making and then installing. Pacman automatically picked up that there was a new version to supercede it.
    Yet, I get a ton of "exists in filesystem" errors, which ends with "errors occurred, no packages were upgraded."
    Now, I've been searching about the best way to deal with such situations. The common approach from previous posts is to force it, with the -f argument. Typically, there is a clause though, that you should only force when the files are owned by a package that pacman knows of. That is, if pacman -Qo [file] doesn't return anything, you are safe to force.
    But, in this instance, the offending files are owned, and pacman knows about it. So, what's the way forward? Removing the old package manually? Manually re/moving the conflicting files?
    Cheers

    i think there may be a problem in the sane package from testing. i installed smaller chunks of kde (kde-common, kdebase, kdeadmin, etc.) and they all went fine, but when i tried to install kdegraphics, it gave me the error
    [root@arch jerry]# pacman -S kdegraphics
    Targets: libungif-4.1.3-2 imlib-1.9.15-2 libgphoto2-2.1.6-2 libieee1284-0.2.10-2
    sane-1.0.16-2 fribidi-0.10.5-2 gimp-print-4.2.7-3 ghostscript-7.07.1-5
    t1lib-5.1.0-1 kdegraphics-3.4.2-3
    Total Package Size: 23.6 MB
    Proceed with upgrade? [Y/n]
    checking package integrity... done.
    loading package data... done.
    checking for file conflicts...
    error: the following file conflicts were found:
    sane: /usr/var: exists in filesystem
    errors occurred, no packages were upgraded.
    should this be filed as a bug report? i did a fresh install and did not have kde installed to begin with, but im pretty sure this happened also when trying to upgrade

  • How to deal with error 749,746,848?

    tterrors.log report list error and tt can't start,
    02:17:34.84 Warn: : 168320: Warn 749: TT0749: Invalid log block found at location 18373.914341888 -- details: log block has incorrect lfn/lbn (actual: 18373.55806, expected: 18373/55807) -- file "logblk.c", lineno 1772, procedure "sbLogBlkValidate"
    02:17:34.84 Err : : 168320: Err 746: TT0746: Extra log files found after end of log (1 files, starting with 18374) -- file "logbuf.c", lineno 14343, procedure "sbLogBufLogTailSanitize"
    02:17:34.84 Err : : 168320: Err 848: TT0848: Recovery failed on 1 set(s) of data store files; the TimesTen user error log has more information -- file "db.c", lineno 9968, procedure "sbDbConnect"
    my question is can i truncate the log and let tt start no recover,how to do with it ?thanks.

    These are serious errors which are beyond the scope of the forum to investigate. Please can you log a service request with Support so they can be investigated in depth.

  • Loading external swf, how to deal with errors within the loaded swf?

    I have a Flex app that basically lets you browse a bunch of thumbnails that represent swf files, when you click a thumbnail it opens a window that loads the actual swf into an image control. The problem I have is that these swfs can be uploaded by our clients, so they may have actionscript errors being thrown, etc. We can't really predict what they may do. Is there a way I can load these swf in such a way as to ignore any errors that the loaded swf may generate within itself.
    For example, one such swf reads some text from a text file to display, but when they are viewing it in this manner the file isn't there so a stream error is generated. My parent Flex app doesn't care about this error and I don't want to see it thrown up in an actionscript error box (I have debug verison loaded on my PC obviously) or interfere with the parent app in any way.
    Would application domains help at all? Would it make a difference if I loaded the swf into a separate domain? Or is there some way I can generically trap any error coming from the loaded swf and just ignore them?
    Any help appreciated.
    Thanks,
    Marcus

    There is no way to catch errors thrown at random times.  Remember that most folks have the release player which does not show error dialogs.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Can anyone tell me how to deal with a forgotten password

    Can anyone tell me how to deal with a forgotten password

    Password for what?
    Itunes account?
    Passcode on the ipad?
    iPad 2 User Guide (For iOS 4.3 Software)

  • When opening aperture I get Warning that says There was an error opening the database for the library "~/Desktop/Feb 12, 2011.aplibrary".  I'm concerned that my pictures may be lost.  Does anyone know how to deal with this Warning?

    When opening Aperture I get Warning that says "There was an error opening the database for the library “~/Desktop/Feb 12, 2011.aplibrary.”  That's it. The program does not open at all.  I'm concerned that my pictures may be lost.  Does anyone know how to deal with this Warning? 

    Might just need to rebuild the library...see this link:
    Aperture 3: Troubleshooting Basics

  • While installing latest version of iTunes error "This iTunes installer is intended for 32-bit versions of Windows. Please download and install the 64-bit iTunes installer instead" how to deal with it ?

    While installing latest version of iTunes error "This iTunes installer is intended for 32-bit versions of Windows. Please download and install the 64-bit iTunes installer instead" how to deal with it ?

    Doublechecking. What's the filename of the installer you've been downloading? (The 32-bit installer is called iTunesSetup.exe, and the 64-bit installer is called iTunes64Setup.exe.)

  • TS1539 How do we deal with Error 50 when downloading a movie rental then stopped with error 50 and when I try to resume the downld, it doesn't do it?

    How do we deal with Error 50 when downloading a movie rental then stopped with error 50 and when I try to resume the downld, it doesn't do it?

    Yeah this "fix" is bunk. The movie is downloading just fine, but the extra features is the one giving me this error code. It is NOT my firewall. If it was, then both files wouldn't download. Plus, I already have the firewall "issue" tacked down and fixed. Have had it fixed for months now. No, this is due to the "new" itunes version 11 software. The only conclusion to fix this issue is UPgrading from 11 back to 10.7 which is what I am going to do. This is completely ridiculous! Come on, Apple, get itunes working once and for all, and fire the people responsible for itunes 11, just like you did to the guy who was responsible for apple maps. Thankfully Google came back to the rescue with google maps app.

  • How do you deal with error message when downloading movie on iPad?  It was 75% complete.

    How do you deal with error message when downloading movie on iPad2.  Movie was 75% complete. 

    I was using wifi.  It shows as a purchase on iTunes but it does not show up on iTunes for download.  I keep getting the download error with our a number attached on the iPad.  Very frustrating.   Apple has been of no help at all. 

  • How to deal with credentials for external applications using a Java Client/

    Hi Guys,
    This is the case. I am integrating an external application with an ADF Application. I have implemented some programmatic ViewObjects that are being filled up by a REST Java Client Wrapper. Everything is working fine but the issue is that the credentials the wrapper is using are hard coded inside the java class. I am thinking to ask for the credentials at the beginning of my taskflow and then store them somewhere and use them then to create my client wrapper (passing them in the constructor).
    However, I don't know if my approach is good and I would like you to share your experiences or how to deal with this.
    Regards

    You can use Credential Store Framework to store the credentials securely in the weblogic server instead of hardcoding in the java class.
    The Credential Store Framework:
    - enables you to manage credentials securely
    - provides an API for storage, retrieval, and maintenance of credentials in different back-end repositories
    Check the documentation on CSF API -
    http://docs.oracle.com/cd/E29505_01/core.1111/e10043/devcsf.htm
    Major Steps -
    1. Create a credential map and key in em console to store the password (http://docs.oracle.com/cd/E25054_01/core.1111/e10043/csfadmin.htm)
    2. Use CSF API to retrieve the stored password
    3. In jazn-data.xml give permissions to access CSF key and map

  • How to deal with file(for example .xml)? what format of dir should be?

    I'd like to operate the file in disk, and want to use relative directory?
    How to deal with file dir? what format of dir should be?

    Hi Kamlesh,
    Thanks for your response.
    Actually, In the "Process External Bank Statement" window, i see that there are few entries which is for the previous year and which has not been reconciled. I have never worked practically on BRS and hence, i am scared to make any changes in the clients database without being confident on what i am doing. I need to reconcile for one of their Bank a/c for the month of April '08. I have the copy of the statements for the month ending 31st Mar 08 and 30th Apr 08. The closing balances are as below:
    31/03/08 - 2300000.00
    30/04/08 - 3100000.00
    Now my OB for Bank a/c for April '08 in SAP is 2300000.00 Dr.
    When i go to External Bank Reconciliation - Selection Criteria Screen (Manual Reconciliation), here are the detail that i enter:
    Last Balance: INR -7,000,000.00000 (Grayed out by the system)
    Ending Balance: INR -3,100,000.00000 (Entered by me)
    End Date: 30/04/08 (Entered by me)
    "Reconciliation Bank Statement" Screen opens up and shows the below balances in the screen:
    Cleared Book Balance: INR -7,000,000.00000
    Statement Ending Balance: INR -3,100,000.00000
    Difference: INR 3,800,000.00000
    As per the Bank statement, i have found all the transactions listed out here for the month of Apr '08 but, i also found that the open transactions for the previous month from April '08 have been lying in "Process External Bank Statement" window.
    Could you please help me solve my issue as to what needs to be done or could you also get me some links from where i can get few documents for processing External Bank Reconciliations?
    That will be of a great help for me. I need steps as to what needs to be done first and then the next so that i can arrive at the correct closing balance for the month April '08.
    Thanks in Advance....
    Regards,
    Kaushal

  • How to deal with validation errors from DAO layer.

    I have been pondering on how to deal with validation errors from DAO layer.
    Lets say you have a DAO that can save a car object. A car has a year, make, model, vin and so on. During the save operation of this DAO, it validates the car attributes to see if they pass some business rules. If it does not it throws some validation exception that contains all the validation errors. These validation errors know nothing about jsf or my components it just knows what attributes on the object are invalid and why.
    If I just want to show those errors at the top of the page that would be no problem I could just create some FacesMessage objects and add them to the FacesContext messages. But if the DAO layer is telling me that the make attribute is invalid it would be nice to map it to the make field on the screen. I am wondering if any of you have tackled this problem or have some ideas on how to tackle it?
    Brian

    Let it throw an exception with a self explaining message, then catch it and embed that message in a FacesMessage.
    Or let it throw more specific exception types (InvalidCarMakeException extends CarDAOException and so on) and let JSF handle it with own FacesMessage message.

  • Mm issue:-how to deal with  gds sent for repairs and again issued for consm

    The main problem is that if something come for repairing it increase the stock for one period and decrease the R and M for that period. And when after 4 months when goods are received after repairing it disturbs the R and M expense in another period.  And this also disturbs the valuation of the material.
    Any one can suggest how to deal with the repairs done to materials without affecting the valuation price of  original material.
    my points is how everyone in india is dealing with goods sent for repairs outside their company.
    what all entries are generated from first receipt of goods in company till  good sent for consumption after received from vendor who repaired the goods.
    all a/c and mm entries

    what we have decided that we would have 2 valuation type
    1. sap-domestic :- normal stock
    2. sap-use/repair :- repaired items.
    All the goods should be received using sap-domestic valuation. from here goods are sent to shop floor. when ever repair is required goods are received in stock thru sap-use-repair at value zero and not moving price specific to sap-use/repair valuation.
    so till goods that require repair and that already repaired are kept in stock, they are kept at 2 different values one is zero and other is moving price specific to valuation type sap-use/repair.
    now goods are sent for repair at zero value but when these goods are received after repair then value of repair will affect the moving price of valution sap-use/rep.
    so this will solve our problem that goods should be received from shop floor to stock for repair at value zero.
    how can we achieve this that goods received from shop floor to stock for repair is received at zero value and not moving price specific to valuation sap-use/rep. where we will have do setting in this vaution type or wherever required.
    pls send some suggestions on it

  • How to deal with 0...n or 1...n mappings?

    Hi all,
    I'm relatively new to BPM. I've already made several processes that are working fine. However, I'm now stuck because, for the life of me, I'm not able to understand how to deal with data mappings of nodes of a cardinality greater than 1...1.
    I'm used to dealing with 0...n inputs of Web Services in Webdynpro Java and CAF Application services, using java code... but I just don't get how to deal with these in a BPM data mapping scenario.
    Let's say you have a Web Service whose input is a node called "Employee", where you can add n Employee objects, like this:
       Employee (0...n)
          FirstName: String
          LastName: String
    How do you:
    1- map a 0...n context node from a Web Dynpro or Web Service output, already containing several employees, into this Employee 0...n WS input node?
    2- map a 0...n context node from a Web Dynpro or Web Service output, containing NO employees, into this Employee 0...n WS input node, without getting an error and the BPM crashing because it says the employee element is not found?
    Hopefully someone can help me with this, because I'm about to go the way of calling the web service n times, one employee at a time, instead of one time with a Employee object with n registries in it.
    Thanks!

    Hi Abhijeet,
    i think i should have mentioned this earlier. My Employee node is inside another node.  So, the actual input structure of the WS is this:
    InputValues (1...1)
       Employees (0..n)
          FirstName: String
          LastName: String
    This scenario works OK in BPM when mapping a 0..n node using deep copy as Jocelyn explained, but I still doesn't work if I want to pass an empty (not null) Employees array.
    If I go to the WS Navigator and run this WS with the following parameters, it runs ok (I get an output message saying no employee was selected, which is how it should work):
    InputValues -  "Is null" checkbox not activated.
       Employees - "Skip" checkbox not activated
          FirstName - "Skip" checkbox activated
          LastName - "Skip" checkbox activated
    However, if instead of activating the checkbox of, say, "FirstName", I enter a "" value, I get an error from the WS saying that's not a vaild first name, which is also how it should work.
    In java code, I would just pass an empty InputValues object to the WS, but I'm not sure how to do this in a BPM without it being considered null, and without having to set on of its String-child values to "".
    Do you know how to achieve this?

Maybe you are looking for