Function: I get ORA-04063 if I try to execute from another schema

Hi All,
I have a schema named "SCHEMA_A" and in this schema I have a function named TEST" that gets a numeric parameter "ID" and returns a string.
Then I have a schema named "SCHEMA_B" with a grant on functions SCHEMA_A.TEST. I want to use function "TEST" from SCHEMA_B.
If I try to execute SELECT SCHEMA_A.TEST(1) FROM DUAL inside schema SCHEMA_B I get ORA-04063.
But if I try to execute TEST(1) from owner schema (SCHEMA_A) and then again from SCHEMA_B it works. But it works only for parameter with value = 1.
If I try SELECT SCHEMA_A.TEST(2) FROM DUAL I get again ORA-04063. It seems that to use a specific value for function parameter, I need to execute first in the owner schema and only after that I can execute from the other schema.
Function code is very simple:
+CREATE OR REPLACE FUNCTION TEST(ID IN NUMBER)+
+RETURN VARCHAR2+
+IS+
+l_return VARCHAR2(256);+
+BEGIN+
+l_return := 'hello world';+
+RETURN (l_return);+
+END TEST;+
I use Oracle 11g R2.
Any idea why it happens?...

I can compile and grant as you did.
But if I try to execute from a schema different by owner (in your case SCOTT) something like
SELECT <your schema>.TEST(1) FROM DUAL
I get an error.
To fix, I have to execute this function in the owner schema with exactly the same parameter.
If I execute with a parameter in the owner schema (suc as 1,2 and 3), I can execute also in schema different by owner (in your case SCOTT). But if I try with a new parameter (es: 4) from SCOTT it give me an error.
Strange...

Similar Messages

  • Function to get all the months name of a year from dual

    HI GURUS
    Is there any function to get all the months name of a year from dual
    thanks in advance

    What about this --
    satyaki>
    satyaki>select months_name
      2  from (
      3         select to_char(add_months(trunc(sysdate,'YEAR'),rownum-1),'MONTH') months_name
      4         from dual
      5         connect by rownum<=12
      6       );
    MONTHS_NAME
    JANUARY
    FEBRUARY
    MARCH
    APRIL
    MAY
    JUNE
    JULY
    AUGUST
    SEPTEMBER
    OCTOBER
    NOVEMBER
    MONTHS_NAME
    DECEMBER
    12 rows selected.
    satyaki>Regards.
    Satyaki De.

  • I get this message when I try to share from iPhoto I am using Mountain LionOS

    I get this message when I try to share from iPhoto. "The email server didn’t recognize your username/password combination."
    I am using Mountain LionOS. I can not correcct it.

    restart your system
    if that does not resolve it backup youoriPhoto librtary, depress the option and command keys, launch iphoto and rebuild the database
    also report the version of iPhoto and on the OS please
    LN

  • Getting all the threads running in one JVM from another JVM ...

    I want to get all the threads running in one JVM from another JVM.
    Is it possible ?
    namanc

    I am going to write a java application that prints all the java application running at the background. And this application has a control over all the threads. means killing the threads, restart the thread etc
    namanc

  • I get Ora-00600 when I try to fetch large data via Xml

    Hi all
    I user Oracle8i ver 8.1.6, when I execute the following
    procedure:
    PROCEDURE TTG_EXEC_SQL (SELECT_STATMENT in VarChar2, Result Out
    Clob, err_no Out Number) IS
    -- This Procedure excutes SELECT command and return the result
    data throw Xml CLOB parameter.
    QueryCtx DBMS_XMLquery.CtxType;
    ErrorNum NUMBER;
    ErrorMsg VARCHAR2(200);
    RES1 CLOB;
    Begin
    QueryCtx := DBMS_XMLQuery.NewContext( Select_Statment );
    DBMS_XMLQuery.setRaiseException(QueryCtx, true);
    DBMS_XMLQuery.setRaiseNoRowsException(QueryCtx, true);
    DBMS_XMLQuery.propagateOriginalException(QueryCtx,true);
    ResULT := DBMS_XMLQuery.getXML(QueryCtx);
    DBMS_XMLQuery.CloseContext(QueryCtx);
    Exception
    when others then
    DBMS_XMLQuery.getExceptionContent (QueryCtx,ErrorNum,
    ErrorMsg);
    ERR_NO := NVL(ErrorNum,0);
    END;
    I get Ora-00600 error when the retrived data is more than 800
    records.
    can any one help me Pls ASAP.
    THNX
    Husam

    Can you get the query result with SQL command alone?

  • Getting an error when I try to boot from my snow leopard disk

    I want to install Snow Leopard on a partion on my new iMac. But when I try to boot from my old Snow Leopard-startup-disk all that happens is that I hear some beeping noise from the iMac.
    Would apreciate any help.
    Best Regards
    Andreas.

    If your machine shipped with Lion, most likely you cannot install SL, since it won't run on it. Details in Don't install a version of Mac OS X earlier than what came with your Mac

  • I get an error when i try to execute a function that returns a date value

    Hi,
    I'm new in ODP.NET, i'm make a package that contains a function that returns a date i.e.
    Package Body General_pkg is
    Function Get_Day Return Date is
    vd_day date;
    Begin
    select sysdate into vd_day from dual;
    return vd_day;
    end Get_Day;
    End General_pkg;
    i use the next code to execute the function:
    OracleCommand cmdData = new OracleCommand("General_pkg.Get_Day", cnx);
    cmdData.CommandType = Commandtype.StoredProcedure;
    OracleParameter PRM;
    PRM = new OracleParameter();
    PRM.ParameterName = "VDATE";
    PRM.OracleDbType = OracleDbType.Date;
    PRM.Direction = ParameterDirection.ReturnValue;
    cmdData.Parameters.Add(PRM);
    try
    cmdData.ExecuteNonQuery();
    catch(OracleException e);
    When i execute this code, i have and exception, which say "identifier GENERAL_PKG.Get_Day must be declare..."
    Obviously the package is correctly created in ORACLE i tested first in sql plus and it works but in ODP.NET they don't recognize the package or the function i don't know... please help!!!

    OOOOOPSS.... i forgot that i change the user in my conecction string that's why it didn't work...
    i guess i had to much beer last night.;. :)
    thanks.

  • I am getting ORA-02063 error while copying bulk data from DBLINK

    Hi all ,
    I am trying to copy data from DBlink ,whenever i am trying to pull more data ,The db link break down ,
    I have try to put /*+ APPEND */  (Hint) in insert statement.Below is the insert code from my procedure
    from where i am getting below error
    "Error in copy_data_pkg-3113 ORA-03113: end-of-file on communication channel
    ORA-02063: preceding line from TESTDBLINK"
    Insert code:
    INSERT /*+ APPEND */ INTO target_tab
    select
    col1,
    col2,
    col3,
    col4,
    col5,
    o_time
    FROM padmin.V_tab1@testdblink
        where
    trunc (sysmodtime) = trunc(sysdate)-1
    and O_time >= al_time
    and (CLEAR_TIME is null or  CLEAR_TIME >= occur_time)
        and (res_code is null or (UPPER(res_code) not LIKE '%TEST TT%' and UPPER(res_code) not LIKE '%TEST SITE%'))
        and ((UPPER(BRIEF_DESC) not like '%TEST TT%' and UPPER(BRIEF_DESC) not LIKE '%TEST SITE%'))
        and (o_time+(330/(24*60))) <= trunc(SYSDATE)-1/24/60/60
        and  catvar IN('POS')
      and UPPER(action_var) not like '%SC_NET%' and UPPER(action) not like '%ROAM_NET%' and UPPER(action) not like '%PUP_NET%';
      COMMIT ;
    Please suggest me ,why i am getting this error.

    Can you elaborate the thing... I don't think  /*+ APPEND */ this is working for me ,still I am getting same error.
    If you have any other suggestion,I would like to hear.
    Should i not put commit after some 500 records inserted ? As i am putting commit once after whole data gets inserted.

  • Getting "Unknown Error" whenever I try to Download from iTunes or App Store

    I first noticed something strange when my phone started randomly asking me to input my Apple ID password. Then my password stopped working on my Apple TV. It prompted me to reset my password, so I did. Now the new password is working on everything (Apple.com, Apple TV) but I am still getting this cryptic message when I try to download music or apps to my iPhone 4S.

    Issue resolved.  I received feedback from my MacRumors forum.  I recently activated my cookies filter on my Cisco router - which I forgotten about.  Deactivating the cookies filter solved the iTunes/App Store download problem. 

  • I get this message when I try to update from LR5 to LR6

    What do I have to do?

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Select "/var/log/install.log" from the file list on the left. If you don't see that list, select
    View ▹ Show Log List
    from the menu bar. Then select the messages from the last installation or update attempt, starting from the time when you initiated it. If you're not sure when that was, start over and note the time. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.

  • Ain't getting it: insert into table by determing value from another table

    I have a table (PERCENTILE_CHART) with percentiles and test scores for different tests:
    Structure:
    Percentile, Reading_Test, Writing_Test
    Data:
    30,400,520
    31,450,560
    97,630,750
    98,630,780
    99,640,800
    The data is currently in ascending order by Percentile.
    If a person took the Reading test and scored 630 he or she would be in the 98th (not 97th) percentile of the class taking that test.
    I wrote a statement to return the percentile:
    select Percentile
    from ( select ROWNUM, PERCENTILE
    from PERCENTILE_CHART
    where READING_TEST <= '650'
    order by READING_TEST desc)
    where ROWNUM < 2 order by PERCENTILE desc;
    This select works and is able to determine the highest percentile for a score.
    Ok, now I want to process all the records in a STUDENT table which have
    test scores and insert them in a new table along with the percents, normalizing the data in the process.
    Have this:
    STUDENT:
    Student_Name,Student_ID,
    John Smith,121,Reading,98,Writing,90
    Maggie Smithe,122,Reading,95,Writing,96
    And needs to be moved to into SCORES with the percentiles, so I get this:
    SCORES:
    Student_Name,Student_ID,Test_Name,Percentile
    121,Reading,98
    121,Writing,90
    122,Reading,95
    122,Writing,96
    This is were I get confused. How do I insert the data into the SCORES table with the percentile? I think calling a function in package is the way to do it:
    function oua_Test_Percentile_f (
    p_Test_Name in char,
    p_Test_Value in char)
    return char as
    -- Declare variables
    c_Return_PTile char(2);
    begin
    select PERCENTILE into c_Return_PTile
    from (select ROWNUM, PERCENTILE
    from PERCENTILE_CHART
    where p_Test_Name <= '&p_Value'
    order by p_Test_Nmae desc)
    where ROWNUM < 2 order by PERCENTILE desc;
    return c_Return_PTile;
    end;
    But this function doesn't return the percentile even though it is based on my working select mentioned earlier. It returns a blank for all tests.
    And even if it is working how do I then populate the SCORES table?

    You may want to use analytical functions so that you can determine the percentile across all of the different scores:
    SQL> with
    2 PERCENTILE_CHART as
    3 (
    4 select 30 PERCENTILE, 400 READING_TEST, 520 WRITING_TEST from dual union all
    5 select 31 PERCENTILE, 450 READING_TEST, 560 WRITING_TEST from dual union all
    6 select 97 PERCENTILE, 630 READING_TEST, 750 WRITING_TEST from dual union all
    7 select 98 PERCENTILE, 630 READING_TEST, 780 WRITING_TEST from dual union all
    8 select 99 PERCENTILE, 640 READING_TEST, 800 WRITING_TEST from dual
    9 )
    10 select
    11 max(percentile) over (partition by reading_test) HIGHEST_READING,
    12 max(percentile) over (partition by writing_test) HIGHEST_WRITING,
    13 percentile_chart.*
    14 from
    15 percentile_chart
    16 /
    HIGHEST_READING HIGHEST_WRITING PERCENTILE READING_TEST WRITING_TEST
    30 30 30 400 520
    31 31 31 450 560
    98 97 97 630 750
    98 98 98 630 780
    99 99 99 640 800
    SQL>
    I wasn't exactly sure how you wantd to coorelate this to the student records though; the student table had only two column name headings but there were four rows listed as examples and had fewer rows than in the percentile_chart table...
    If you join the student table to the able query it might be what you are looking for.
    You can create another table based on the output of your query by doing:
    create table scores
    as select * from
    (insert your query here)
    /

  • I don't get email notifications when using find my iphone from another device.

    When my husband uses the app "find my iphone" to locate my where abouts, I no longer get email notifications.  He uses my user name and password.  I believe he dismantled that feature somehow.  Is that possible? 

    I think it time to change your password... or husband

  • Query assigned to role. Doesnt execute when try to execute from under role

    Hi Experts,
    We have some queries assigned to a role in PFCG.
    Now the anomaly is as follows:
    some of the queries that are assigned, do not show any technical names in the Bex role window. When we click on these queries under this role, nothing happens. no execution, nothing.
    The same queries if executed from under the Infoareas->infoprovider->query path, execute correctly.
    This would point to incorrect assignments in PFCG, BUT thats not the case.
    <bsp_protcl>://<bsp_server>/sap/bw/BEx?sap-language=<language>&bsplanguage=EN&cmd=ldoc&INFOCUBE=Z1&QUERY=ZQ1
    <bsp_protcl>://<bsp_server>/sap/bw/BEx?sap-language=<language>&bsplanguage=EN&cmd=ldoc&INFOCUBE=Z2&QUERY=ZQ2
    The details of the query assignments to the role are as above.
    Query ZQ1 shows in Bex role with a technical name and executes properly.
    Query ZQ2 doesn't show a technical name under that role in Bex and doesnt execute.
    Also if I execute ZQ2 from the PFCG, it executes correctly.
    What are we missing here?
    All help appreciated!

    The query name is correct.  The assignment seems to be correct too.
    But for this particular assignment, the bex role doesnt show a technical name for the query. neither does the query execute.
    Why don't the assignment via PFCG work?
    Edited by: CC on May 22, 2008 6:04 PM

  • The update could not be installed. Please make sure there are no other copies of Firefox running on your computer, and then restart Firefox to try again. I get this message when I try to install FF 7 and FF is NOT running! Help

    Get this message everytime I try to upgrade from FF6 to 7. I have rebooted and tried again twice and still nothing. Shortly after I get the failed to install message FF6 starts up by itself. On top of all this some, if not all web pages, do not complete. Google Chrome works just fine. No fix for FF problems I will uninstall and use Google Chrome
    e-mail: [email protected]

    If there are problems with updating then best is to download the full version and uninstall the currently installed version.
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 7.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Uninstall your current Firefox version.
    * Do not remove personal data when you uninstall the current version or you lose your bookmarks and other data in the profile folder.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/Profile_backup
    If files already have been downloaded then you may have to remove the files in the updates and updates\0 folder.<br />
    You can delete active-update.xml and updates.xml as well if present.
    C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Mozilla\Firefox\Mozilla Firefox\updates
    (%USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Mozilla Firefox)
    The "Application Data" folder in XP/Win2K and the "AppData" folder in Vista/Windows 7 are hidden folders.
    *http://kb.mozillazine.org/Show_hidden_files_and_folders

  • TS3694 i keep getting error 3194 when i try to upgrade my iphone4 on ios 5.1.1 to ios6.what should i do?

    i keep getting error 3194 when i try to upgrade my iphone4 on ios 5.1.1 to ios6.what should i do?

    From the page which you posted your question:
    Unable to contact the iOS software update server gs.apple.com
    Error 1004, 1013, 1638, 3194: These errors may be the result of the connection to gs.apple.com being redirected or blocked. Follow these steps to resolve these errors:
    Install the latest version of iTunes.
    Check security software. Ensure that communication to gs.apple.com is allowed. Follow this article for assistance with security software. iTunes for Windows: Troubleshooting security software issues.
    Check the hosts file. The restore will fail if there is an active entry to redirect gs.apple.com. Follow iTunes: Advanced iTunes Store troubleshooting to edit the hosts file or revert to a default hosts file. See section "Blocked by configuration: (Mac OS X/Windows) > Rebuild network information".
    Try to restore from another known-good computer and network.
    If the errors persist on another computer, the device may need service.

Maybe you are looking for

  • Display a sum of a column(field) in the view

    Hi I would like to show the sum of a revenue field(currency) in any view of the opportunity entity(only when revenue field exist in the view) , may be at the end of the view or as a alert message on button click., but sum should change dynamically ba

  • Error during creation of Resource for Telemetry.

    Hi, I am trying to enable Telemetry so I can look at performance of resources used by Resource Groups. When I try set Mount Point for Filesystem resource, I get following error: root@bidwsvia # clrs set -p FilesystemMountPoints=/telemetry telemetry-h

  • After updating ram and to SSD hard drive bluetooth no longer works

    Updated my two sets of hynix 2GB ram to two sets of Crucial 4GB ram (8GB total), and then also installed a Samsung 1TB SSD hard drive. Now my Bluetooth does not recognize any devices at all. I'm using a Mid-2010 Macbook Pro 17" 2.53 ghtz on the most

  • Have to sign into my account each time I launch an app

    Hi, each time I launch an app, I have to sign in, to accept terms of contract, or I get a message saying this is a demo version. I am fed up with this !!! I have a legal version, and I don't want to sign in every day. Used it on OSX before, and there

  • SLD Landscape Design Question

    After reading the Planning Guide - System Landscape Directory, I am left with a question. The Setup: Standard three system landscape ECC 6.0 Ehp5 on NW 7.02ECC Instances: DE1, QE1, PE1 PI 7.31 PI Instances: DP1, QP1, PP1 PI Business Systems: DE1CLNT1