Can you reference package variables in a pl/sql object type

I'm trying to create an object type and I would like to use a type from a pacakge definition as one of the parameters for a method in the object. I read that types defined inside a PL/SQL package cannot be used as parameter. Does anyone have a workaround for this?

You could move the type definition out from the package to a schema level object type. Then you should be able to use the schema level object type in both your package and the new object you wish to create.
Below is a short example of what I mean:
-- The way I interpreted your question
CREATE OR REPLACE PACKAGE foo_pkg
AS
TYPE foo_obj IS RECORD (
f1 NUMBER
,f2 VARCHAR2 (10)
in_pkg_foo_obj foo_obj;
END foo_pkg;
SHOW errors
CREATE OR REPLACE TYPE newFooObj IS OBJECT (
f1 NUMBER
,f2 VARCHAR2 (3)
,f3 DATE
,MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
RETURN NUMBER
SHOW errors
CREATE OR REPLACE TYPE BODY newFooObj
AS
MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
RETURN NUMBER
IS
BEGIN
RETURN 1;
END;
END;
SHOW errors
-- Clean up
DROP PACKAGE foo_pkg;
DROP TYPE newFooObj;
-- Now try it with a schema level object type
CREATE OR REPLACE TYPE foo_obj IS OBJECT (
f1 NUMBER
,f2 VARCHAR2 (10)
CREATE OR REPLACE PACKAGE foo_pkg
AS
in_pkg_foo_obj foo_obj;
END foo_pkg;
SHOW errors
CREATE OR REPLACE TYPE newFooObj IS OBJECT (
f1 NUMBER
,f2 VARCHAR2 (3)
,f3 DATE
,MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
RETURN NUMBER
SHOW errors
CREATE OR REPLACE TYPE BODY newFooObj
AS
MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
RETURN NUMBER
IS
BEGIN
RETURN 1;
END;
END;
SHOW errors
DROP PACKAGE foo_pkg;
DROP TYPE newFooObj;
Bob

Similar Messages

  • How can I reference a variable in Regexp

    Hello Friends,
    I have this Regexp, to extract the county code: (971)
    select regexp_replace (regexp_replace('000971-05 7910 - 324324','\D'),'^0*(971)?0?') from dual;It is fine and does the need..
    But, thinking in the future, someone may need to eliminate the country code of (961), so it is better if I put the code in a variable, but
    How can I reference the county code using a variable in Regexp:
    declare
    a varchar2 (15);
    code number := 971;
    begin
    select regexp_replace(regexp_replace('000971 05 7910 - 324324','\D'),'^0*(code)?0?') into a from dual;
    dbms_output.put_line ( a);
    end;but, it does not work ??
    Best Regards,
    Fateh

    venx08 wrote:
    You need to bind the code variable value in the regular expression patternYes, that's the idea, but there is a caveat. You might need to escape every regexp special character that appears in code. If, for example code is 'A*B' you need to transform it into 'A\*B' unless you really want 'A*B' to be interpreted as uppercase A repeated zero or more times followed by uppercase B.
    SY.

  • Result set --- can you reference in two locations (jsp and doVIew())

    I need help figuring out what I am doing wrong.
    In my doView() function I am saving a result set
      NamingEnumeration person = details.executeDetails(fullname);I need to reference this result set from my doView method and inside my jsp page, this is why I have stored this inside a session variable.
    //doView() method
    NamingEnumeration person = details.executeDetails(fullname);
    if(person != null){                           
      while(person.hasMore()){
       SearchResult sr = (SearchResult)person.next();
       Attributes attributes = sr.getAttributes();
       Attribute attr = attributes.get("x500UniqueIdentifier");
       if (attr != null) {
        Object val = attr.get();
        byte[] buf = (byte[])val;
        String number = new String(buf);
        person_number = removeLeadingZeros(number);
    person.close();
    session.setAttribute("person", person, PortletSession.PORTLET_SCOPE);     
    //jsp page
    NamingEnumeration results = (NamingEnumeration)renderRequest.getPortletSession().getAttribute("person");
    <% if(results != null){
          while(results.hasMore()){
            SearchResult sr = (SearchResult)results.next();
            Attributes attributes = sr.getAttributes();
            String fullName = attributes.get("fullName").toString();
            String description = attributes.get("description").toString();
            String title = attributes.get("title").toString();
            String mail = attributes.get("mail").toString();
            String eduPersonPrimaryAffiliation = attributes.get("eduPersonPrimaryAffiliation").toString();
            String telephoneNumber = attributes.get("telephoneNumber").toString();
            String postOfficeBox = attributes.get("postOfficeBox").toString();
            String[] Name = fullName.split(":");
            String[] Desc = description.split(":");
            String[] JobTitle = title.split(":");
            String[] Email = mail.split(":");
            String[] Class = eduPersonPrimaryAffiliation.split(":");
            String[] Phone = telephoneNumber.split(":");
            String[] BoxNo = postOfficeBox.split(":");
            %>
                //....................... Bunch of printing information here        
               }//end while
         }//end if
         else{%>
              <div>No results found.</div>
         <%}
          results.close();
    Can you not reference a result set from both of these locations?
    Thanks.

    Hi Gravy Train,
    I'm curious about why you are using 2 loops.   You mentioned one is for monitoring and one is for DAQ....what do you mean by that?   What is the overall goal of this piece of code.   Also, I noticed that you are not closing the task.   Since this is just a subset, I realize you could be closing it in your actual code, but just in case you're not.....it is very important that you close all tasks when you are down acquiring data.
    Best Regards,
    Starla T  

  • Can you please give me the details of Archiving object for Reservations

    Hi All,
    Could you please give me the details of Archiving object for Reservation documents. If there is no standard object can you please give me the details, for which program we are using.
    Regards,
    Ram

    Hi,
    You do not need to configure the tables to be deleted for any archive object through AOBJ. SAP would have maintained the list of tables from which data will be deleted if you archive a particular object. In case of archiving MM_EKKO, data will be deleted from many other tables apart from EKKO and EKPO. Here is the list of tables from which data will be delete if you archive PO using MM_EKKO.
    A068
    A081
    A082
    A215
    ADR10
    ADR11
    ADR12
    ADR13
    ADR2
    ADR3
    ADR4
    ADR5
    ADR6
    ADR7
    ADR8
    ADR9
    ADRCOMC
    ADRCT
    ADRG
    ADRGP
    ADRT
    ADRU
    ADRV
    ADRVP
    AUSP
    CDCLS
    CDHDR
    CDPOS_STR
    CDPOS_UID
    CMFK
    CMFP
    DJEST
    EIKP
    EIPO
    EKAB
    EKBE
    EKBEH
    EKBZ
    EKBZH
    EKEH
    EKEK
    EKES
    EKET
    EKETH
    EKKN
    EKKO
    EKPA
    EKPO
    EKPV
    EKUB
    EREV
    ESKL
    ESKN
    ESLH
    ESLL
    ESSR
    ESUC
    ESUH
    IBADDR
    IBIB
    IBIBOBS
    IBIBT
    IBIN
    IBINDOMAINS
    IBINOBS
    IBINOWN
    IBINT
    IBINTX
    IBINVALUES
    IBSP
    IBST
    IBSTREF
    IBSYMBOL
    INOB
    JCDO
    JCDS
    JEST
    JSTO
    KAPOL
    KOCLU
    KONH
    KONM
    KONP
    KONW
    KSSK
    MLBE
    MLBECR
    MLWERE
    NAST
    RESB
    STXB
    STXH
    STXL
    WRF_PSCD_DLHD
    WRF_PSCD_DLIT
    WRF_PSCD_DLIT_SH
    Hope this helps
    Cheers!
    Samanjay

  • Can you apply a pathfinder effect to a mesh object

    can you apply a pathfinder effect to a mesh object

    You can apply it, but it might not make too much sense.

  • Can you really update two tables in one SQL statement

    Ok a post in the forum has got me awefully curious:
    Can you update two tables in one update statement i.e something like this
    update table a , b
    set b.<column> = something
    a.<column> = something
    Something to this effect.
    If you are curious to know what post I am talking about it is called "updating a single row"

    No. You can only update one table in one SQL statement.

  • Can you use html text in flash cc html5 project type?

    I'm attempting to dynamically change font color of various words inside a dynamic text field.
    I have tried both these lines of code below. have you dont this can you correct my code please?
    I'm using flash cc and html5 project type. This was possible in previous versions of flash.
    this.Logger.Log_File.htmlText = "<font color='#000000' size='-1'>"+MyGreatNumber+" "+"</font><BR>"+this.Logger.Log_File.htmlText;
    this.Logger.Log_File.htmlText = "<p style="color:#ff0000">"+MyGreatNumber+"</p><br>"+this.Logger.Log_File.htmlText;

    from the easeljs docs: Please note that Text does not support HTML text, and can only display one font style at a time. To use multiple font styles, you will need to create multiple text instances, and position them manually.
    to resolve, edit text in the js file where it's relatively easy to even use rtl text.

  • Hi Can you tell me any datasource whcih has both action type and wagetype.

    Hi
             Can you tell me any datasource or cube or multiprovider whcih has both action type and wagetype.
    Edited by: manukonda anil kumar on Oct 11, 2010 1:45 PM

    hi Manu,
    I think this question has been answered check the below thread.
    Datasource in HR which has both payroll and wagetype.
    Regards
    Kp

  • Can you see what's wrong with my sql clause?

    Select afkogltri sum( afpowemng ) as yqty
        from   ( afpo inner join afko on afpoaufnr = afkoaufnr )
        into   ( d_gltri , d_wemng )
        where  afpo~matnr = wa_pir-matnr
               and year( afko~gltri ) = year( sy-datum )
        group by afko~gltri. 
    The above is my sql clause, when I do a syntax check, it said:"Comma without preceding colon (after SELECT ?)"
    Can you tell me what's wrong with this sql clause?
    Thank you very much!

    Hi,
    Select Bgltri sum( Awemng ) <b>as yqty</b> (????)
    into ( d_gltri , d_wemng )
    from afpo as A inner join afko as B
    on Aaufnr = Baufnr 
    where A~matnr = wa_pir-matnr
    and year( B~gltri ) = year( sy-datum )
    group by B~gltri.
    ENDSELECT.
    eg<b>:... INTO (f1, ..., fn</b>)
    Places the result set in the target area (f1, ..., fn). The fields of the result set are transported to the target fields fi from left to right. INTO (f1, ..., fn) is allowed only if a list with n elements is also specified in the SELECT clause.
    <b>If the result of a selection is a table, the data is retrieved in a processing loop introduced by SELECT and concluded by ENDSELECT. The processing passes through the loop once for each line read. If the result is a single record, the closing ENDSELECT is omitted.</b>
    Example
    Output a list of all airlines (with short description and name):
    TABLES SCARR.
    DATA:  CARRID   LIKE SCARR-CARRID,
           CARRNAME LIKE SCARR-CARRNAME,
    SELECT CARRID CARRNAME
           INTO (CARRID, CARRNAME)
           FROM SCARR.
      WRITE: / CARRID, CARRNAME.
    ENDSELECT
    Thanks & Regards,
    Judith.

  • How can I sort a collection of array with different object types in it ?

    Hi all,
    I have a collection of ArrayList; each array contains, at the first position, the same object type.
    I'd like sorting the collection by the name contained in the object at the first position of each array.
    Any suggestion ?
    Cheers.
    Stefano

    so you have a collection of a collection?
    My guess is that:
    You could subclass the arraylist and override it's compareTo method (I think that it implements comparable already but if not, go ahead and implement that interface).
    Or you could wrap your arraylist in another class that implements comparable.
    The key in my mind is correctly coding your compareTo method to look at the name in the first item of the arraylists. This should be doable and not too difficult.
    Correction: after reviewing the ArrayList api, I see that it doesn't implement the Comparable interface. You will have to make any class that either inherits arraylist or contains arraylist implement the comparable interface.
    One last thing: This question would probably have been better off in the java forum and not the Swing forum since it doesn't really involve Swing.
    Good luck!
    Edited by: petes1234 on Nov 19, 2007 6:17 AM

  • Can you place packages which need eachother in 1 dir?

    Hello I have a question about packages.
    I have 3 java programs.
    prog1 prog2 prog3.
    prog1 needs variables from prog2 and prog3
    prog2 needs variables from prog3
    I saw some examples with packages and they are all in an other directory. Is it possible to place prog2 and 3 in 1 directory so that prog2 can get the variables needed from prog3?
    Now I have
    In prog3
    package program;
    In prog2
    import program.prog3
    programdir/program
       |                       |
    prog1/2        prog3

    I saw some examples with packages and they are all in
    an other directory. Is it possible to place prog2 and
    3 in 1 directory so that prog2 can get the variables
    needed from prog3?Let the directory structure reflect the package structure. javac as well as java
    have convenient flags for that. Here's an example: your main directories look
    like this:c:\java\src
    c:\java\classesSuppose you have three .java sources: prog1.java, prog2.java and prog3.java
    in the packages pack1, pack1.sub, pack2. The sources must be stored like this:c:\java\src\pack1\prog1.java
    c:\java\src\pack1\sub\prog2.java
    c:\java\src\pack2\prog3.javachange directory to c:\java\src, and type the following:javac -cp ..\classes -d ..\classes pack1\prog1.java pack1\sub\prog2.java pack2\prog3.javaThis line will compile all three source files in one sweep. Note the '-d ..\classes'
    flag. This tells the compiler where to store the .class files. The '-cp ..\classes'
    flag tells the compiler where any other .class files can be found.
    When the compiler has finished, your .class files will be stored here:c:\java\classes\pack1\prog1.class
    c:\java\classes\pack1\sub\prog2.class
    c:\java\classes\pack2\progr3.classSuppose the prog1 class contains a main method. You run it like this (you're
    still in c:\java\src as the current directory):java -cp ..\classes pack1.prog1Et voila!
    kind regards,
    Jos

  • When a single-page form expands to more than one page, can you reference the new individual "pages" that have been created by the expanding table?

    Don't think this is possible but would love to be wrong.
    Bullet Points:
    1) In my demo form (simple hierarchy: form1.page1.table1.row1), 8 occurrences  (instance "0" through instance "7") of the repeating row1 can be visible
         before it causes a page break and adds another "page".  No issues there.
    2) I'm thinking about trying to control the end-users navigation abilities to only on-screen "previous page" and "next page" buttons.
         (So no scrolling from page to page; keep them where we want them.) Only way I can see making this work is if the form is designed
         and coded to only allow one page to be visible at a time --- nesting things correctly in a parent object then hide all necessary subforms
         and only make the appropriate subform visible.
    3) But when working with tables,  when occurrence 9 gets added (aka instance 8), it triggers an on screen "Page 2" to be added.
         End user can now scroll between Page 1 and Page 2. 
    4) Once Page 2 has been added, is there a way to reference Page 1 (as we see it on screen) and set it to be hidden?
    5) Is what we are seeing on screen as "Page 1" and "Page 2"  actually this.resolveNode("page1[0]") and this.resolveNode("page1[1]") ?
         Tried messing around with referencing it this way but didn't seem to work.  Maybe I had a typo but if we never set the subform named "page1"
         to allow multiple instances, I'm guessing it's not referenced this way.
    Any thoughts would be great.  Thanks so much to this community.
    Brian

    If you're looking at learning a bit more about database design (looking at your description of what you've done in creating a separate table for each category of item sold sounds like you're approaching it as though it was a flat-file rather than a relational database), there's a few books that I could direct you to:
    Beginning Database Design (ISBN 978-1590597699)
    Database Design for Mere Mortals (ISBN 978-0201694710)
    Databases Demystified (ISBN 978-0072253641)
    Absolute Beginner's Guide to Databases (ISBN 978-0789725691)
    I've also got an older book that's always sitting by my desk called Dreamweaver MX Databases (ISBN 978-0782141481), which I still reference regularly - chapter 3 on coding practices and chapter 5 on database design provide very good overviews of the subject.
    There's also a Database Development for Dummies, but I'm not a huge fan of the series where they're tackling technical subjects.
    Without knowing the data you're modeling, it's quite difficult to make generalisations, but I'd probably be looking at a single table called 'Product' (which contains all the product records), and which had in it a boolean for 'new item' and for 'on sale' (you could then use SQL to filter out new and/or sale items when you create your recordset). I'd then have a look up table called 'Categories' which held the values 'necklace', 'handbag', 'belt', and 'purse' which the Product table could then reference to identify.
    Breaking your data down into a logical structure like this is called 'normalisation' (see http://en.wikipedia.org/wiki/Database_normalization) - although it's a bit technical. There's a simpler practical explanation of a similar query to yours at TechRepublic (http://articles.techrepublic.com.com/5100-10878_11-5288500.html), which uses MS Access, but don't worry about that as it's teaching a concept which is applicable no matter what the database server.

  • I'm using TestStand 1.0.3 and I have a requirement to pass the serial number to a VI from the user prompt in the Labview Operator Interface. Where can I reference this variable ?

    Test Engineering
    Empower RF Systems Inc.

    Runstate.Root.Locals.UUT.SerialNumber
    Check the NI Web site for
    "How do I Access the UUT Serial Number in My Sequence or Test Code?"
    at .....
    RESOURCE LIBRARY>TESTSTAND>SEQUENCE EXECUTION>GENERAL
    It states ...
    At runtime, you can access the UUT serial number using Runstate.Root.Locals.UUT.SerialNumber. The serial number and UUTLoopIndex is a local variable of the default process model. Below is the definition for Runstate.Root. This is copied from Chapter 8 of the TestStand User Manual.
    Runstate.Root:
    Sequence context for the root sequence invocation. If you initiate an execution using a process model entry point, the property is the sequence context for the process model entry point. For example, if you use an entry point from the default TestStand process model, the
    Root property is the sequence context of the Test UUTs or the Single Pass sequence. If you initiate an execution on a sequence without using a process model entry point, the Root property object is the sequence context for the sequence you run.
    When you are editing a sequence, the expression browser does not display the sub-properties of Runstate.Root because these properties are filled in at runtime. They are dynamic properties.

  • Can you access packages or sequences via a database link

    I am trying to access a sequence through a database link.
    Does anyone know if this is possible ?

    Hi,
    Thanks very much and I apology for the lack of information in the post.
    I was trying to select from the sequence using
    select myseq@my_link.nextval
    from dual;
    because of this i started looking at web site documentation and could not find any examples or any references to plsql packages or sequences using database links and the oracle documentation on links only specified selecting from tables or views.
    this lead to my post whereas as you described it is my syntax that is the problem.
    thanks again

  • Can you convert a variable text (spanning multiple rows) but fixed

    Hi all,
    I have a PDF table with 5 columns, couple of title rows at the top and four lines per row table into Excel? I'd want each excel row to have four lines as four combined rows. Think of each column as a date, an ID, a mailing address, an amount and a comment. It looks like a typical form, but on multiple pages (about 27) and I want all the info as an Excel table. Can I convert this PDF doc into Excel?
    Any pointers and/or solutions welcome... Please help.
    Thanks much in advance,
    Nash

    No, there isn't. Pages can't break within a row, only between rows.
    If you not are going to print the document you can change the paper size to something larger/longer. File > Page Setup > Paper Size > Manage custom sizes

Maybe you are looking for

  • How Can I print Oracle Report 9i directly To Printer on the local network?

    Dear All; How Can I print Oracle Report 9i directly To Printer on the local network? or to any other computer ? or to my default printer without prevoiues know the printer name i mean found it in my connected printer? plear help me? Best Wishes

  • Desktop Login Issues - AuthenticationException

    Hi, I've been struggling with this for hours and even searching these forums I can't find any solutions.  Hoping someone can assist me.  I'm a newcomer to Lync, I've set up a Standard Edition Server, published my topology etc. without any problems al

  • How to setup QT Broadcaster on XServe

    Hello friends- I have spent a good portion of my day with a friend trying to configure QT Broadcaster on my XServe so we can serve up some live content on some website we are working on. We have run into some issues trying to get this to work. On the

  • Insert a photo in a popup created by Studio VII Tooltip magic?

    I need to have a pop up that includes a photo and text. I've installed Studio VII's ToolTip Magic. The popups are easy, but how do I get it to insert a photo?

  • Compiling programs using jdk1.6.0

    when i compiled program using "system.out.print.in " , it shows an error that package system does not exist .