Return variable from Function

I have a function that if I write-host the variable $RDPUser from within the function it returns true, however I can't seem to get the variable to be seen outside the function, even if I make it global
Function global:RDP (){
$WorkstationName = Get-Content env:ComputerName
    # Run the qwinsta.exe and parse the output
    $queryResults = (qwinsta /server:$WorkstationName | foreach { (($_.trim() -replace "\s+",","))} | ConvertFrom-Csv)  
    # Pull the session information from each instance
    ForEach ($queryResult in $queryResults) {
        $RDPUser = $queryResult.USERNAME
        $sessionType = $queryResult.SESSIONNAME
        # We only want to display where a "person" is logged in. Otherwise unused sessions show up as USERNAME as a number
        If (($RDPUser -match "[a-z]") -and ($RDPUser -ne $NULL)) {  
            # When running interactively, uncomment the Write-Host line below to show the output to screen
             $LoggedOnUser = $RDPUser
         $RDPHost
            #$SessionList = $SessionList + "`n`n" + $ServerName + " logged in by " + $RDPUser + " on " + $sessionType
#Get Current Time
$time2 = Get-Date
#Get Logged-On User Details
$user = Get-WmiObject Win32_Computersystem -ComputerName "."
#Get Time User Logged On
$time1 = Get-EventLog -LogName System -InstanceId 7001 -Newest 1
#Set Variables for SQL
$LogonDateTime = get-date -Format "MMM dd yyyy HH:mm:ss"
$WorkstationName = Get-Content env:ComputerName
$LoggedOnUser = $user.UserName
$TimeToLogon = $time2.TimeOfDay.TotalSeconds - $time1.TimeGenerated.TimeOfDay.TotalSeconds
$logonType = "Logon"
#If workstation = QATest Set $result
if ($workstationName -eq "QAtest") {$result = RDP ; $LoggedOnUser = $result}
write-host $LogonDateTime
write-host $WorkstationName
write-host $LoggedOnUser
write-host $TimeToLogon
write-host $logonType
Alter De Ruine

For some reason I needed my If statement inside the function:
Function RDP (){
$WorkstationName = Get-Content env:ComputerName
    # Run the qwinsta.exe and parse the output
    $queryResults = (qwinsta /server:$WorkstationName | foreach { (($_.trim() -replace "\s+",","))} | ConvertFrom-Csv)  
    # Pull the session information from each instance
    ForEach ($queryResult in $queryResults) {
       $script:RDPUser = $queryResult.USERNAME
        $sessionType = $queryResult.SESSIONNAME
        # We only want to display where a "person" is logged in. Otherwise unused sessions show up as USERNAME as a number
        If (($RDPUser -match "[a-z]") -and ($RDPUser -ne $NULL)) {  
            # When running interactively, uncomment the Write-Host line below to show the output to screen
         $RDPUser
            #$SessionList = $SessionList + "`n`n" + $ServerName + " logged in by " + $RDPUser + " on " + $sessionType
if ($workstationName -eq "QAV-RDHOST") {$script:LoggedOnUser = $RDPUser}
#Get Current Time
$time2 = Get-Date
#Get Logged-On User Details
$user = Get-WmiObject Win32_Computersystem -ComputerName "."
#Get Time User Logged On
$time1 = Get-EventLog -LogName System -InstanceId 7001 -Newest 1
#Set Variables for SQL
$LogonDateTime = get-date -Format "MMM dd yyyy HH:mm:ss"
$WorkstationName = Get-Content env:ComputerName
$LoggedOnUser = $user.UserName
$TimeToLogon = $time2.TimeOfDay.TotalSeconds - $time1.TimeGenerated.TimeOfDay.TotalSeconds
$logonType = "Logon"
#Call function RDP
RDP
Alter De Ruine

Similar Messages

  • DB adapter not returning return variable from database function

    Hi,
    We are calling a function using db adapter from our BPEL Process. It worked fine in 10.1.3.3.
    after we migrated to 10.1.3.4 MLR# 8 , we are not able to see the return variable which function is returing.
    Function is working fine when executed standalone. Its returing the variable. But we are not able to see that variable in bpel process invoke response variable. This is causing issue.
    Any idea what causing the issue.
    Thanks

    Check your XSD to see if it is qualified (elementFormDefault="qualified") or unqualified. The XSDs were unqualified in 10.1.3.3. They became qualified in 10.1.3.4. If you have an unqualified XSD and you're using a 10.1.3.4 runtime you will likely have namespace issues that cause problems with the generated XML. The solution is to regenerate your XSD so that it becomes qualified.

  • How to get the returned value from Functions with Callable statement?

    I was glad to find that stored procedures can be invoke with Java class code by the object of Callable statement like :
    String stmt = "BEGIN departments_pkg.do_select(?,?,?); END;";
    and getting the output variables by
    populateAttribute(DEPARTMENTNAME,st.getString(2),true,false);
    But i would like to get values returned from FUNCTION other than stored procedure, how can i achieve it? Thanks a lot!

    Here is  my code
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1202.
      MODULE subscreen_find.
      CALL SUBSCREEN SUBSEARCH INCLUDING sy-cprog dynnr.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_1202.
      CALL SUBSCREEN SUBSEARCH.
    MODULE subscreen_find.
      case sy-ucomm.
        when 'SELECTED'.             "fcode
          case 'ZSKILL_SEARCH'.     "data element
            when '01'.                       " value range
              dynnr = 0110.
            when '02'.
              dynnr = 0111.
          endcase.
      endcase.
    ENDMODULE.
    kindly tell me what is wrong
    Edited by: Raji Thomas on Feb 8, 2010 10:20 AM

  • Returning arrays from function

    Hi all,
    Can u please guide me in how to return an array from function .
    Is it possible or not ??
    If it is possible please tell me how to declare the function(prototype) that returns string array
    and how to return the string array..
    Thanks in Advance

    Hi all,
    Can u please guide me in how to return an array from
    function .
    Is it possible or not ??
    If it is possible please tell me how to declare the
    function(prototype) that returns string array
    and how to return the string array..
    Thanks in Advance
    public String [] methodReturnsAnArray()
    }

  • Newbie: Return variable from class?

    I'm calling a class to verify some data. The verification is quite complicated so the class will use a JFrame to make things clearer and will popup some additional dialogs. What I can't work out is the syntax for returning a variable from the class.
    I'm using the constructor to build and show the JFrame with the data to be verified and then triggering off a JButton to start the verification. If all is OK then the class would return a result.
    What I would like is to call either the Constructor or a Method in the class to show the JFrame, and to get that to return a value to me when a JButton is clicked. Does anyone have any code samples of something like this, or could point me in the right direction? It feels messed up right now.

    The simplest way is to use JDialog with setModal(true). Write your subclass of it and include a result field, typically a boolean that determines whether you exited via "OK" or "Cancel". The handlers for the buttons set this field appropriately, then you do "show" on the dialog (which waits until one of the button handlers calls "dispose" on the dialog), then test the flag.
    public class MyDialog extends JDialog {
           boolean resultOk;
           JButton okButton, cancelButton;
         public  MyDialog(Frame parent) {
             super(parent, "Validate dialog", true);
           okButton = new JButton("OK");
           okButton.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent evt) {
                   if(formIsValid()) {
                         resultOk = true;
                         dispose();
          cancelButton = new JButton("Cancel");
          cancelButton.addActionListner(new ActionListener() {
              public void actionPerformed(ActionEvent evt) {
                  resultOK = false;
                 dispose();
         private boolean formIsValid() {
            .... validation
        MyDialog dlg = new MyDialog(parentFrame);
        dlg.show();
         if(dlg.resultOK)  { // ok button selected
           ...

  • Return multiple variables from function via DBLINK

    hey,
    I've created a function for use by another database through a dblink.
    I created the function to return a ref cursor but
    have since found out that this is not allowed so i'm looking for
    alternatives?
    Assuming I want to keep the function on our database (for maintainability reasons) what other options do i have?
    Two suggestions i've got are 1) to return a ',' delimited string
    or to have a number of OUT parameters. Is there any reason
    why either of these would not work or would be preferable to the other?
    Thanks for reading, any help much appreciated.
    BTW i'm new to PL/SQL so feel free to dumb it down.
    cheers.
    function....
    CREATE OR REPLACE FUNCTION "GET_SCHEME_DETAILS"
    IN_BRANCH IN VARCHAR2,
    IN_AGENCY IN VARCHAR2,
    IN_PRODUCT_SUFFIX IN VARCHAR2,
    IN_TERM IN INTEGER,
    IN_LOAN_START_DATE IN DATE
    RETURN sys_refcursor AS TYPE RESULTSET IS REF CURSOR;
    and its being called like this....
    select GET_SCHEME_DETAILS@PPPRO ( '864' , '500086' , 'M7' , 10 , TO_DATE ( '01/02/2010' , 'DD/MM/YYYY' ) ) FROM DUAL ;

    I would be amazed if that even compiled.
    The function should look something like:
    CREATE FUNCTION GET_SCHEME_DETAILS (in_branch          IN VARCHAR2,
                                        in_agency          IN VARCHAR2,
                                        in_product_suffix  IN VARCHAR2,
                                        in_term            IN INTEGER,
                                        in_loan_start_date IN DATE) RETURN sys_refcursor AS
       l_ref_cur SYS_REFCURSOR;
       < any other variables that need declaring >
    BEGIN
       OPEN l_ref_cur FOR
          <your select tstatment here>
       RETURN l_ref_cur;
    END;and you would call it from the other database like:
    DECLARE
       l_other_ref_cur SYS_REFCURSOR;
       < any other variables that need declaring  like one for each column in the ref cursor>
    BEGIN
       l_other_ref_cur := get_scheme_details@PPPRO ('864', '500086', 'M7', 10,
                                                    TO_DATE ( '01/02/2010' , 'DD/MM/YYYY' ));
       LOOP
          FETCH l_other_ref_cursor INTO <variable list>
          EXIT WHEN l_other_ref_cursor%NOT_FOUND;
          <do something with the values>
       END LOOP;
       CLOSE l_other_ref_cur;
    END;Having said that, if you are only expecting to get one row back, then you could just as easily use a procedure with out parameters.
    If you expect multiple rows back, you could also just do a query on the other database drectly using the db link assuming that the user that the db link uses to connect has appropriate privileges.
    HTH
    John

  • Returning 3 variables from function

    I pass into a certain function 4 variables, 3 of them are worked on and changed, how could I pass back the 3 changed variables? I C i could do pointers, is there anything like that in java?

    The_One wrote:
    theres no way of changing the variables i passed in automatically from another function? like just reassign them?No there isn't and there can't be, because Java uses pass-by-value. If you reassign the parameters, you'll only change the local copies of those parameters.
    The real object-oriented solution to this would be to return an object that contains those three values.
    And if the four values put in and the three values that you want to return are somehow related, then you might want to use an object as the input as well.
    Could you tell us what specific method you're talking about? Then we could suggest a Java-like solution.

  • Return value from function within package

    Hi,
    There is a function within a pl/sql package that I am trying to get data from. The problem is that the data returned can be up to 32,767 chars (varchar2 limit).
    It accepts 3 input parameters and returns on varchar2.
    The only way I can get it to work is using this syntax:
    ==================================
    variable hold varchar2(4000);
    call TrigCodeGenerator.GenerateCode(VALUE1', 'VALUE2','VALUE3') into :hold;
    print hold;
    =====================================
    However, if the data returned is greater than 4000 then I get this error:
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 1
    I can't increase the size of the variable (hold) as there seems to be a limitation on this type of variable.
    Also, I am running this in sql plus worksheet. Will it limit the display of the data (assuming, that someone can get the whole 32,767 chars displayed back) ?
    Thanks in advance,
    Ned

    Never mind,
    I declared the variable hold as clob and set the long and longchunksize parameters to 100,000 and it seems to work.

  • Error getting return value from function

    Hello
    I'm getting a error calling a function with ODP.NET from C#
    Code:
    OracleCommand oraCom = new OracleCommand("NORMALIZACION.nif",oraCon);
    oraCom.CommandType = CommandType.StoredProcedure;
    OracleParameter param1 = new OracleParameter("numnif",OracleDbType.Varchar2);
    param1.Value= "73667866A";
    param1.Direction = ParameterDirection.Input;
    OracleParameter param2 = new OracleParameter("nif",OracleDbType.Varchar2);
    param2.Size = 10; //FIXME line
    param2.Direction = ParameterDirection.ReturnValue;
    oraCom.Parameters.Add(param1);
    oraCom.Parameters.Add(param2);
    oraCom.ExecuteNonQuery();
    nif_norm = oraCom.Parameters["nif"].Value.ToString();
    if i write the FIXME line i get a error (ORA-06502) complaining about the size, no matter the value i wrote.
    If i don't write the FIXME line, it works but nif_norm is always empty, although the function i call is a single return 'Hello';
    Where am I wrong??
    Any help, examples with varchar2 as return value???
    BTW: the same code with the MS provider for Oracle works fine.

    Good point -- i shall do so.
    What I think I'm missing, in my quest for ODP.NET competence, is a solid set of example code. I've searched around and found various fragements here and there, but when it comes to data access from .NET there must surely be some finitie set of possibilities (if we can discount bad practices like building dynamic SQL statements without bind variables).
    For example, possibly in increasing order of complexity ...
    * Read a single value from a SQL statement ... "select emp_name from emp where rownum < 2"
    * Read a single value by passing in a parameter ... "select emp_name from emp where user_id = :?"
    * read multiple values ... "select emp_name from emp where user_id in (:?,:?)"
    * execute a stored procedure with no in or out parameters
    * retreive a value from a function with no parameters
    * pass a parameter to a stored procedure
    * read an out parameter from a stored procedure
    Then work with in and out ref cursors, blobs, whatever.
    Thoughts?

  • 1.6.0_10 and 11, Memory leak returning variables from Java to JavaScript

    Environment: Windows XP SP2, IE7, JScript 5.7, JRE 1.6.0_11-b03 and 1.6.0_10
    Memory allocated in Java and returned as a JavaScript variable value is not garbage collected in Java when the JavaScript variable is re-used.
    In the following simplified example, a populated HashMap is returned from the applet test1 method to the JavaScript variable hash1.
    The JavaScript variable hash1 is re-used on the next iteration so I would expect it should be marked for garbage collection.
    In 1.6.0_7 and previous releases, the memory associated with this Java HashMap is freed implicitly.
    In 1.6.0_10 and 1.6.0_11 the HashMap memory is never freed.
    Is this is what we should expect, a feature of the significant LiveConnect changes that were part of 1.6.0_10?
    Do we need to rewrite our code to call new Java methods from JavaScript explicitly freeing the memory, in this example calling the freeMem method?
    Has anybody else experienced this problem since 1.6.0_10?
    Thanks
    Rob
    Example code ...
    TestRLApplet.java
    import java.applet.Applet;
    import java.util.HashMap;
    public class TestRLApplet extends Applet
    private HashMap hash1;
    public TestRLApplet()
    public void init()
    public HashMap test1()
    hash1 = new HashMap();
    for (int i = 0; i <10; i++) {
    hash1.put(Integer.toString(i),Integer.toString(i));
    return (hash1);
    public void freeMem() {
    hash1.clear();
    hash1 = null;
    TestClient.htm
    <HEAD>
    <TITLE></TITLE>
    <SCRIPT LANGUAGE="javascript">
    function window_onload()
    var hash1;
    testAppplet = document.TestRLApplet;
    for (cnt=0; cnt < 1000; cnt++)
    hash1= testAppplet.test1();
    </SCRIPT>
    </HEAD>
    <object
    classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 1 HEIGHT = 1 NAME = "TestRLApplet" >
    <PARAM NAME = CODE VALUE = "TestRLApplet.class" >
    <PARAM NAME = ARCHIVE VALUE = "../applets/TestRLApplet.jar" >
    <PARAM NAME = NAME VALUE = "TestRLApplet" >
    <PARAM NAME = MAYSCRIPT VALUE = true >
    <param name = "type" value = "application/x-java-applet;version=1.6">
    <param name = "scriptable" value = "false">
    </object>
    <BODY LANGUAGE=javascript onload="return window_onload()" leftMargin=40 id=body >
    </BODY>
    </HTML>
    Java Console
    Java Plug-in 1.6.0_10
    Using JRE version 1.6.0_10 Java HotSpot(TM) Client VM
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    Memory: 5,056K Free: 2,551K (50%) ... completed.
    Memory: 7,996K Free: 3,499K (43%) ... completed.
    Memory: 7,996K Free: 1,038K (12%) ... completed.
    Memory: 13,180K Free: 3,745K (28%) ... completed.
    Memory: 22,844K Free: 5,614K (24%) ... completed.
    Memory: 37,984K Free: 15,009K (39%) ... completed.
    Memory: 37,984K Free: 13,069K (34%) ... completed.
    Memory: 37,984K Free: 6,125K (16%) ... completed.
    Memory: 65,088K Free: 25,107K (38%) ... completed.
    Memory: 65,088K Free: 21,201K (32%) ... completed.
    Memory: 65,088K Free: 13,381K (20%) ... completed.
    Memory: 65,088K Free: 7,967K (12%) ... completed.
    Memory: 65,088K Free: 5,013K (7%) ... completed.
    Memory: 65,088K Free: 414K (0%) ... completed.

    What are you missing?
    I inherited this app and signing the third party jars is how it was setup, I was wondering the same thing too, why was it necessary to sign the third party jars?
    The applet runs in either JRE 1.6.0_13 or JRE 1.6.0_27 depending on the other Java apps the user uses. JRE 1.6.0_13 does not have the mixed code security (so it is like is disable), but JRE 1.6.0_27 does have the mixed code security and the applet will not launch with mixed code security enable, so we have to disable it. With all the hacking going on in the last two years, is important to improve security; so this is a must.
    Yes, I always clear up the cache.
    Any idea on how to resolve this problem?

  • Problem returning variables from dynamic SQL/PLSQL

    Hi, I have a problem I am trying to solve using a very short piece of dynamic SQL or PLSQL but I am having problems getting the variable values out of the dynamic block.
    I have 16 counters whose names are made up of three variable parts - 'scheme', 'contributory category' and 'employment category'
    The 'scheme' can be either 'no1', 'no2', 'off', 'cg' or 'amc'
    The 'contributory category' can be either 'cont' or 'noncont'
    The 'employment category' can be either 'ft' or 'pt'
    (There are only 16 because only 16 combinations are possible)
    For example the total counter name could be 'v_cg_noncont_ft_count'
    I have created a variable by concatenating the various elements called v_incr_count_name which holds the name of the counter I want to increment.
    I am running this whole thing within an anonymous PLSQL block so I cannot use global variables meaning that my variables are not visible within a dynamic PLSQL block.
    I believe this means that either I need to bind the variables within a PLSQL block or use a SELECT FROM INTO SQL block.
    I have tried a few solutions with no luck such as the following PLSQL:
    v_incr_count := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'BEGIN :a := :a + 1; END;';
    EXECUTE IMMEDIATE sql_stmt USING v_incr_count_name;
    Unfortunately I am getting the 'IN bind variable bound to an OUT position' error which I believe is because it is trying to return a value into v_incr_count_name which has been defined by default as an IN variable. The problem is that I need to store the returned value into the variable whose name is stored in v_incr_count_name.
    Another solution I tried is:
    v_incr_count_name := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'SELECT '||v_incr_count_name||' + 1 FROM DUAL';
    EXECUTE IMMEDIATE sql_stmt INTO v_return;
    This solution gives me an 'Invalid colum error'
    Any help would be greatly appreciated
    Cheers, Dan

    Repost:
    Problem with variables in dynamic SQL/PLSQL

  • Returning Cursor from Function

    I have been struggling all afternoon to get a package function
    to return a cursor. Following some advice from the forums, I
    think I'm getting close. <vbg> But am getting a compile error
    on my RETURN statement. Can someone please help or post a
    working example of how to do this. Thanks!
    -- IN PACKAGE HEADER
    type package_cursor is ref cursor;
    function testfunction (p_system_date in date)
    return package_cursor;
    -- IN PACKAGE BODY
    function testfunction (p_system_date in date)
    return package_cursor is
    cursor c1 is
    select columns from tables where mydate = p_system_date;
    begin
    open c1;
    return c1;
    end testfunction;

    Nevermind, I figured it out by using Barbara Boehmer example in
    the "function returning record or table" thread.
    function testfunction (
    p_system_date in date)
    return package_cursor is
    vret package_cursor;
    begin
    open vret for
    select columns from tables where mydate = p_system_date;
    return vret;
    end testfunction;

  • Returning objects from functions

    Hi,
    public HSSFRow someFunction() {
       HSSFRow returnrow;
       Iterator rowiterator = someobject.rowIterator();
          while(rowiterator.hasNext()) {
             returnrow = rowiterator.next();
       return returnrow;
    }My problem is this, I want to pass a HSSFRow object back from a function, but the constructor to this object is protected so i cant initialize an object, this code wont compile because it says that the returnrow object might not have been initialized. How do i get round this problem?

    Hey-
    You could just initialize returnrow to null and check for null whenever you call someFunction(), that should do it.
    Lee

  • Returning Recordsets from Functions

    Pardon my ignorance; there is probably a simple answer to this one, but I'm trying to make the leap to Oracle Stored Procedures and I have a basic question:
    I have created a Function in Oracle 8.1.7 EMP_SEL_ALL, based on the following SQL Statement:
    CREATE OR REPLACE FUNCTION "SCOTT"."EMP_SEL_ALL" (
              enuma          IN NUMBER)
              RETURN SCOTT.emp%ROWTYPE IS
    emp_row SCOTT.emp%ROWTYPE;
    BEGIN
         SELECT * into emp_row FROM SCOTT.emp
         WHERE empno = enuma;
    RETURN emp_row;
    END;
    The function compiles with no problems.
    I have written a Java call to execute the Function, which reads as follows. Because I am attempting to return an entire row, I assume that will equate to a ResultSet:
    sqlCallStmt = con.prepareCall("{ call SCOTT.EMP_SEL_ALL ? ) }");
    sqlCallStmt.setInt(1, 7369);
    result = sqlCallStmt.executeQuery();
    The error returned is as follows:
    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00221: 'EMP_SEL_ALL' is not a procedure or is undefined
    Looking in DBA Studio, the Function is shown in the SCOTT schema, and I am logged in as that user. I am therefore inclined to think that, rather than a permissions issue, I have a syntax error somewhere, or I have left out a step.
    For anyone who has been down this road before, please advise. Is there a better way to do this via Stored Procedure? I have no problem querying the table and data in a standard SQL statement. Many thanks in advance.

    First, when you call a function I think you have to use the syntax {call ? = function_name} (notice where the ? goes.
    However, I still don't think you will be able to get this to work becuase a Java client cannot interpret a PL/SQL record (or rowtype, in your case).
    If you want to return the results as a recordset, you will have to move the function into package and declare a REF CURSOR for the return type. It appears your code only returns one row, however, so a recordset will create unnecessary overhead.
    It would probably be best to make your function a procedure that returns OUT parameters, one for each column selected.

  • How to Return Type from Function

    I've defined a type and a function in specification. But package body returns pls-00330 error (invalid use of type name or subtype name). What am I doing wrong? My intent is to write a function which will return a record containing two values. For now, I put "null;" as a placeholder.
    --specification
    CREATE OR REPLACE PACKAGE res.year_qtr AS
    TYPE yq_type IS RECORD
    (yr varchar2(2),
    qtr varchar2(1));
    FUNCTION yq_fun (date_in date)
    RETURN yq_type;
    END year_qtr;
    -body
    CREATE OR REPLACE PACKAGE BODY res.year_qtr AS
    FUNCTION yq_fun (date_in date)
    RETURN yq_type IS
    BEGIN
    null;
    RETURN year_qtr.yq_type; --get error on this line!
    END;
    END year_qtr;
    Edited by: user516543 on Mar 23, 2009 12:17 PM

    You need to declare a variable of that type and return the variable.
    You can't just return the type as it's not actually a declaration of that type.
    --specification
    CREATE OR REPLACE PACKAGE res.year_qtr AS
      TYPE yq_type IS RECORD
        (yr varchar2(2),
         qtr varchar2(1));
      FUNCTION yq_fun (date_in date)
        RETURN yq_type;
    END year_qtr;
    --body
    CREATE OR REPLACE PACKAGE BODY res.year_qtr AS
      FUNCTION yq_fun (date_in date) RETURN yq_type IS
        v_ret year_qtr.yq_type;
      BEGIN
        null;
        RETURN v_ret;
      END;
    END year_qtr;

Maybe you are looking for

  • LO Settings (in SBIW) for SD and Inventory before Customizing LO (LBWE)

    Hi, Please let me know the LO Settings(in SBIW) to be maintained in R/3 for SD, Inventory and  Purchasing before Customizing  LO (LBWE). i.e, for : <u>SD</u> 1. Change statistics currency for each sales organization 2. Assign Update Group <u>Inventor

  • Certificate Authority is not being seen by windows server 2003 machines

    Good Afternoon, We recently installed a certificate authority using windows server 2008 r2. There was an old certificate authority that had went bad and the role could not be uninstalled on the bad server. The new certificate authority works with win

  • Error in installing SAP Web AS ABAP (Unicode Version)

    I have SAP Web AS Java in my machine already, but in order to install XI, I need to install also ABAP unicode. During the installation, I got the following error. I can't interpret it what it is or what I have done wrong. Can anybody give me a hand?

  • Acrobat Std v9.5 browser session locks up past 2nd page

    I updated to v9.5 Acrobat Std. yesterday (from v9.45 --> 9.46 -->9.47 to 9.50).  I opened a PDF linked inside a webpage to a new tab (using 32 bit IE9). The webpage PDF opens fine. But when I scroll to the second page (which is black), the browser se

  • Is the screensaver supposed to run during iTunes playback?

    I've been listening to an audiobook for a couple of hours straight today. I've been using a mix of my Apple Remote (the small white one) the dedicated iTunes buttons on my keyboard, and my mouse, to pause and play the audiobook over the course of sai