Oracle 11G, access other schema's procedure

Hi all,
I have a peculiar problem while calling a procedure from JAVA.
I have two schemas, SCH1 and SCH2. Java is connected to  SCH1. There is a procedure in SCH2, grant is given to SCH1. in SCH1 a synonym is created using the following commad.
create synonym PR_GET_DATE for sch2.PR_GET_DATE;
Procedure is given below. For testing, I removed all the actions inside my procedure.
create or replace
PROCEDURE PR_GET_DATE(
    P_REP_PROCESS_DATE IN DATE,
    P_REP_TYPE         IN VARCHAR2,
    P_ETL_DATE OUT DATE ,
    P_STATUS OUT VARCHAR2,
    P_MSG OUT VARCHAR2)
AS
  V_WK_REP_DATE DATE;
BEGIN
null;
end;
{code}
If I test this from SQLPLUS, it works fine. But if I call it from Java, I am getting the following error in Java. But if I compile it in SCH1 and try calling from java, it works fine. Can someone please explain me the possible cause of this behaviour.
org.springframework.jdbc.BadSqlGrammarException:
CallableStatementCallback; bad SQL grammar [{call PR_CLMSR_GET_REP_DATE()}];
nested exception is java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types
of arguments in call to 'PR_CLMSR_GET_REP_DATE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Thanks,
Jaggyam

Thanks All for you response!
Grant is given, otherwise it would have been clearly mentioned in the error
We are passing all the parameters with appropriate value. To throw more light on that, we did not make any change in the java. But simply dropped the synonym took the copy of the procedure from SCH2 and compiled in SCH1. After doing so, I didn't get any error in Java. So nothing wrong in the number of parameters passed or their type.
By looking at the error message, even I thought the parameters are not properly passed from java. But without making any code change Java, it is working fine after we moved the procedure to SCH1. Again in either case when I called from SQLPLUS, I had no issues. I don't have a concrete evidence to put in front of my Java team to prove that nothing is wrong in the code.
Kindly throw your thoughts please.
Thanks in advance,
Jaggyam

Similar Messages

  • Access other schema's table without specify the schema name

    Hi, need ur help again,
    I would like to access other schema's table without specify the schema name. for example,
    select * from hr.jobs;
    What priviledges i need if i want to select the data in this way:
    select * from jobs;
    Thanks!

    Public synonyms have their place, but are not generally a good idea as they will cause conflicts with other schemas and applications. Another think that you can do is issue the
    ALTER SESSION set CURRENT_SCHEMA = schema;
    The CURRENT_SCHEMA (8i and above) parameter changes the current schema of the session to the specified schema. Subsequent nqualified references to schema objects during the session will resolve to objects in the specified schema. The setting persists for the duration of the session or until you issue another ALTER SESSION SET CURRENT_SCHEMA statement. CURRENT_SCHEMA is a session parameter only, not an initialization parameter.
    This setting offers a convenient way to perform operations on objects in a schema other than that of the current user without having to qualify the objects with the schema name. This setting changes the current schema, but it does not change the session user or the current user, nor does it give you any additional system or object privileges for the session.

  • Access other schema object from connection

    Hi;
    from the dbconnection, how can I access other schema object?
    Thanks

    Hi,
    I don't know if I understand correctly but if you mean the scenario you connect to the database as SCOTT and you want to map table EMPLOYEES from HR schema, you can do it within wizard and in read only view object you
    use schema name as prefix like select * from HR.EMPLOYEES. If you mean something else please describe it more.
    regards,
    Branislav

  • How to get the own schema data while calling the other schema's Procedure

    Hello Experts,
    I'm Sanjit, new to OTN forum.
    I'm using Oracle 10g 10.1.0.2.0 database. Another user Sush has created one procedure proc_1 like
    create or replace procedure proc_1
    as
    v_total number;
    begin
    select sum(amt) into v_total from trans_master where dot
    between add_months(sysdate,-3) and sysdate;
    dbms_output.put_line('last three months total transactions is: '||v_total);
    end proc_1;
    He has the Trans_master table and having 280 records and I have the same Trans_master table with 430 records
    inserted in last 3 months. He has granted execute privileges on the procedure Proc_1 to me. When I call the procedure
    I cannot call it directly like my own schema procedures: Exec Proc1;
    I am calling like : Exec Sush.Proc1 to get the result. My issue is: when the procedure is called,
    it is accessing the data from the Sush schema Trans_master table with 280 records total, but I want
    the procedure to get the total amount of transaction of 430 records from my own Trans_master table.
    Please resolve my issue which would be a great help. And is there any way to call the procedure of other schema
    by not attaching the owner name of the object with it?
    Thanks
    Sanjit

    Pleast take a look at "Definer's rights and invoker's rights" in the following article:
    http://docs.oracle.com/cd/E11882_01/timesten.112/e21639/accesscntl.htm#BABDDCHC
    I guess you need to define a stored procedure with "invoker's rights".
    If this is what you are looking for will have to define it in the stored procedure that you are going to call.
    The syntax is as follows:
    create or replace procedure <yourprocedure> authid current_user ...
    ...or (the following is the default, you don't have to use the "authid definer" keywords):
    create or replace procedure <yourprocedure> authid definer ...
    ...hm

  • Oracle 11g Rel2 Sample Schemas Missing

    I installed Oracle 11g Release 2 and created a database using DBCA. In one screen there is an option to create sample schema but it was greyed out so I could not select it.
    I searched the dbhome\demo\schema\human_resources directory but there is only one file in it -hr_code.sql(It created triggers in hr schema).
    There is no sql to create hr schema or populate schema tables. I searched the net to download the scripts but no idea where to get them. Can you help me

    josephj1989 wrote:
    I installed Oracle 11g Release 2 and created a database using DBCA. In one screen there is an option to create sample schema but it was greyed out so I could not select it.
    I searched the dbhome\demo\schema\human_resources directory but there is only one file in it -hr_code.sql(It created triggers in hr schema).
    There is no sql to create hr schema or populate schema tables. I searched the net to download the scripts but no idea where to get them. Can you help meHi,
    There are some earlier threads on this topic, see Re: MISSING ORACLE DATAUSER "HR"
    HtH
    Johan

  • Readonly user can access other schema and change them

    Hello everybody,
    I created a readonly user like this in oracle 11g r2
    SQL> CREATE USER readonly IDENTIFIED BY readonly;
    SQL> GRANT CREATE SESSION ,CREATE SYNONYM TO readonly;
    SQL> GRANT SELECT ON SA.vCustomerService TO readonly;
    But when I connect to the database and do a select like:
    SQL> SELECT * FROM ACC;
    I get the data from that table, even if I do an update on that table it works.
    What am I doing wrong that my readonly user still has full acces on the other schema?
    Thanks in advance for your help!
    Best regards,
    GIL GOMES Dany

    Dan_lu wrote:
    Hello everybody,
    I created a readonly user like this in oracle 11g r2
    SQL> CREATE USER readonly IDENTIFIED BY readonly;
    SQL> GRANT CREATE SESSION ,CREATE SYNONYM TO readonly;
    SQL> GRANT SELECT ON SA.vCustomerService TO readonly;
    But when I connect to the database and do a select like:
    SQL> SELECT * FROM ACC;
    I get the data from that table, even if I do an update on that table it works.Check the permissions for that table -- maybe some operations on this table are granted to publc?

  • Can Oracle reports access different schemas?

    I have a query that accesses 2 schemas: It gives me an error ORA-00904 when I try to run the report.
    Any ideas?

    Yes it helps. I had 3 queries... and the first was accessing the other schema but not the second or third query when they should have. However, when I ran the report, it kept giving me an error as if the first one was the problem.
    Misleading error diagnostics made doubt it.

  • Access other schema to check details

    I am updating certain rows (contain coupons information) in the db with a particular condition
    Before updaing i need to check whether those are in active status in an other schema which has relevant info related to coupons
    do i need nested am's to do this

    hi,
    you can use createStatement() method of AM to get any data from the database (if AM's user has db privileges to read another users tables)
    here is an example:
    http://jjzheng.blogspot.com/2010/11/run-single-query-in-application-module.html
    regards,
    Brano

  • Uninstall oracle 11g

    i had installed oracle 11g in f drive in my computer and when i uninstalled it folder app still exists
    and occupying around 4 GB of hard drive space and when i try to delete it from system as it was occupying more it is giving me error
    canno delete
    oci access is denied
    please somebody help

    Pl do not post duplicate threads - Uninstall oracle 11g
    Srini

  • Dbconsole start  failed on Oracle 11G

    After installing Oracle 11G and creating a new database, I have created new db console reporsitory, with the commands:
    set ORACLE_SID
    set ORACLE_HOME
    set SYS_PWD
    set PORT
    emca -repos create -silent -SID $ORACLE_SID -ORACLE_HOME $ORACLE_HOME -SYS_PWD $SYS_PWD -DBSNMP_PWD $SYS_PWD -SYSMAN_PWD $SYS_PWD -PORT $PORT
    emca -config dbcontrol db -silent -SID $ORACLE_SID -ORACLE_HOME $ORACLE_HOME -SYS_PWD $SYS_PWD -DBSNMP_PWD $SYS_PWD -SYSMAN_PWD $SYS_PWD -PORT $PORT
    At the end, the command fails:
    INFO: This operation is being logged at /exec/products/oracle/cfgtoollogs/emca/HYDRA/emca_2008_09_22_22_25_54.log.
    Sep 22, 2008 10:26:41 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
    INFO: Stopping Database Control (this may take a while) ...
    Sep 22, 2008 10:26:44 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
    INFO: Uploading configuration data to EM repository (this may take a while) ...
    Sep 22, 2008 10:27:13 PM oracle.sysman.emcp.EMReposConfig invoke
    INFO: Uploaded configuration data successfully
    Sep 22, 2008 10:27:16 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
    INFO: Software library configured successfully.
    Sep 22, 2008 10:27:16 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
    INFO: Deploying Provisioning archives ...
    Sep 22, 2008 10:27:21 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
    INFO: Provisioning archives deployed successfully.
    Sep 22, 2008 10:27:21 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
    INFO: Securing Database Control (this may take a while) ...
    Sep 22, 2008 10:27:32 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
    INFO: Database Control secured successfully.
    Sep 22, 2008 10:27:32 PM oracle.sysman.emcp.util.DBControlUtil startOMS
    INFO: Starting Database Control (this may take a while) ...
    Sep 22, 2008 10:30:40 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
    WARNING: Error executing /exec/products/oracle/v11.1.0/bin/emctl start dbconsole
    Sep 22, 2008 10:30:40 PM oracle.sysman.emcp.EMConfig perform
    SEVERE: Error starting Database Control
    Refer to the log file at /exec/products/oracle/cfgtoollogs/emca/HYDRA/emca_2008_09_22_22_25_54.log for more details.
    Could not complete the configuration. Refer to the log file at /exec/products/oracle/cfgtoollogs/emca/HYDRA/emca_2008_09_22_22_25_54.log for more details.
    When I want to start dbconsole manually, I have the following error:
    emctl start dbconsole
    Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    https://RD_x3650_22:1158/em/console/aboutApplication
    Starting Oracle Enterprise Manager 11g Database Control ............................................................................................. failed.
    Logs are generated in directory /exec/products/oracle/v11.1.0/RD_x3650_22_HYDRA/sysman/log
    The logs give the following message:
    emdctl.trc:
    2008-09-23 00:19:32 Thread-3083821984 ERROR http: 5: Unable to initialize ssl connection with server, aborting connection attempt
    2008-09-23 00:19:32 Thread-3083813792 ERROR ssl: Open wallet failed, ret = 28750
    2008-09-23 00:19:32 Thread-3083813792 ERROR ssl: nmehlenv_openWallet failed
    2008-09-23 00:19:32 Thread-3083813792 ERROR ssl: Error initializing SSL
    2008-09-23 00:19:32 Thread-3083813792 ERROR http: 5: Unable to initialize ssl connection with server, aborting connection attempt
    2008-09-23 00:19:32 Thread-3083813792 ERROR main: nmectla_agentctl: Error connecting to https://RD_x3650_22:3872/emd/main. Returning status code 1
    emoms.trc:
    2008-09-22 23:07:08,275 [OC4J Launcher] ERROR app.ContextInitializer contextInitialized.479 - Integration Class not found: oracle.sysman.pp.ec.ui.intg.ExtendClusterIntegration
    2008-09-22 23:07:08,276 [OC4J Launcher] ERROR app.ContextInitializer contextInitialized.479 - Integration Class not found: oracle.sysman.pp.dn.ui.intg.DltNodeIntegration
    2008-09-22 23:07:08,277 [OC4J Launcher] ERROR app.ContextInitializer contextInitialized.479 - Integration Class not found: oracle.sysman.pp.common.ui.intg.ProvCommonIntegration
    emagent.log:
    2008-09-22 23:06:59 Thread-3083801408 EMAgent started successfully (00702)
    2008-09-22 23:14:56 Thread-3083817792 Starting Agent 10.2.0.3.0 from /exec/products/oracle/v11.1.0 (00701)
    2008-09-22 23:14:57 Thread-3083817792 [Database Instance] InstanceProperty (DBVersion) is marked OPTIONAL but is being used (00506)
    2008-09-22 23:14:57 Thread-3083817792 [Cluster Database] InstanceProperty (DBVersion) is marked OPTIONAL but is being used (00506)
    2008-09-22 23:14:57 Thread-3083817792 [Load Balancer Switch] InstanceProperty (snmpTimeout) is marked OPTIONAL but is being used (00506)
    2008-09-22 23:14:58 Thread-3083817792 EMAgent started successfully (00702)
    2008-09-23 00:14:00 Thread-3083813696 Starting Agent 10.2.0.3.0 from /exec/products/oracle/v11.1.0 (00701)
    2008-09-23 00:14:01 Thread-3083813696 [Database Instance] InstanceProperty (DBVersion) is marked OPTIONAL but is being used (00506)
    2008-09-23 00:14:01 Thread-3083813696 [Cluster Database] InstanceProperty (DBVersion) is marked OPTIONAL but is being used (00506)
    2008-09-23 00:14:01 Thread-3083813696 [Load Balancer Switch] InstanceProperty (snmpTimeout) is marked OPTIONAL but is being used (00506)
    2008-09-23 00:14:03 Thread-3083813696 EMAgent started successfully (00702)
    I've tried this:
    - set correctly TIMEZONE,
    - configure secure dbconsole (emctl secure dbconsole),
    - stop service nscd,
    - change the port number,
    - recreate the repository....
    But the problem still occurs...
    Has someone another idea?
    Thank You
    Anne

    emctl secure agent does not exist with Oracle 11G
    I tried:
    emctl secure dbconsoleOracle Enterprise Manager 11g Database Control Release 11.1.0.6.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    [https://RD_x3650_22:5500/em/console/aboutApplication|https://rd_x3650_22:5500/em/console/aboutApplication]
    Please enter repository password:
    DBCONSOLE already stopped... Done.
    Agent is already stopped... Done.
    Securing dbconsole... Started.
    Securing dbconsole... Sucessful.
    But the dbconsole starting still have errors
    The command status gives:
    emctl status agent -secureOracle Enterprise Manager 11g Database Control Release 11.1.0.6.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    Checking the security status of the Agent at location set in /exec/products/oracle/v11.1.0/RD_x3650_22_HYDRA/sysman/config/emd.properties... Done.
    Agent is secure at HTTPS Port 3938.
    Checking the security status of the OMS at [http://RD_x3650_22:5500/em/upload/..|http://rd_x3650_22:5500/em/]. Done.
    OMS is running but has not been secured. No HTTPS Port available.
    And the command "emctl ssl off" does nots exist with Oracle 11G
    Anne

  • Do you recommend me "Learning Oracle 11g Training DVD - Tutorial Video"?

    Hi
    I found on Amazon "Learning Oracle 11g Training DVD - Tutorial Video by InfiniteSkills". Is it worth it? There are no Amazon reviews :-(
    Do you use other video training? What do you recommend me?

    I don't know if the video is any good, but Lewis Cunningham is a reasonably well-known authority on Oracle. He talks about the release of the video in his blog, gives a table of contents and a link to some samples:
    http://it.toolbox.com/blogs/oracle-guide/new-dvd-training-learning-oracle-11g-50929

  • Query in Stored Procedure accessing another schema

    Hi - this is going to sound kind of strange and even i can't come up with an explanation. My JDK 1.1.7 applet uses a type 4 JDBC thin driver (i think v 8.04.06) to access an Oracle 7.3.4 database. We also have a link with full grants and synonymns to another Oracle schema in an Oracle 8 database. Has never been a problem - we can access anything we need to through queries or stored procedures from either of these databases.
    So, i have a new stored procedure that needs to be called through JDBC that queries a table in the Oracle 8 database. For some reason, whenever i execute this stored procedure from java it hangs on this query and the instance needs to be restarted. If i execute that same stored procedure from SQL Plus, it runs fine.
    I tried a little test. I put a straight query in my java code that goes directly to that table (no stored procedure involved). It runs great through java!
    is this weird or what? my dbas have checked out all privelages and it seems that i have access to everything i could possibly need.
    If anyone has any suggestions i would love to hear them.
    thanks for your help...
    Lori - [email protected]
    null

    You can only access an object in another user's schema if you either:
    (a) Specify the 'other' schema name explicitly: SCHEMA.OBJECT
    (b) A synonymn has been created to access the object: CREATE SYNONYM OBJECT FOR SCHEMA.OBJECT.
    The user requiring the synonym should create it, or the user owning the object can create a PUBLIC synonym, if they have the authority.
    To check my hypothesis, try typing 'DESCRIBE procedure_name' from SQL*Plus as both users.

  • Oracle 11g - Objects Access ?

    Oracle 11g - Objects Access ?
    =====================
    I hope this is the right forum for this issue, if not let me, where to go.
    We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
    We have a Schema A with database objects.
    We need to provide access to another group on selective items.
    We need to provide Read access to one table (T1) of Schema A and Insert/Update access to another one (T2).
    If we create another user/schema B in our instance, they can see other than T1 and T2 of Sch A via other User Objects (via TOAD/SQL Developer etc) or using Database catalog.
    How do we hide our other objects for User/Schema B?
    Thanks in helping.

    qwe16235 wrote:
    Oracle 11g - Objects Access ?
    =====================
    I hope this is the right forum for this issue, if not let me, where to go.
    We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
    We have a Schema A with database objects.
    We need to provide access to another group on selective items.
    We need to provide Read access to one table (T1) of Schema A and Insert/Update access to another one (T2).
    If we create another user/schema B in our instance, they can see other than T1 and T2 of Sch A via other User Objects (via TOAD/SQL Developer etc) or using Database catalog.
    How do we hide our other objects for User/Schema B?
    With Oracle everything is prohibited; except that which is explicitly GRANTed.
    simply put SCHEMA_B has privs to see objects that are owned by SCHEMA_A.

  • How to export a table of data from MS Access 2007 to Oracle 11g

    I have been looking all over trying to find a way to get a table from Access 2007 to Oracle 11g. I tried using the export options in Access but can't get them setup correctly I guess. What are the steps to setting this up correctly or is there another way to export the data?

    MS Access 2007 DB migration To oracle 10g

  • Calling Stored procedure in Oracle 11g from Oracle forms developer 6i

    We have Oracle 11g (11.1.0.7.0 ) database (64 bit) installed on Windows Server 2008.
    In this database, we have stored procedure ABC(arg1) which is accesing a table in another instance through DB LINK. If we EXECUTE this procedure from SQL/TOAD. It runs successfully and generates the desired output.
    If we write the contents of the stored procedure in the PROGRAM UNIT / ANY TRIGGER in FORM 6i then also, It runs successfully and generates the desired output.
    It is also mentioned, that if we try to use any table in the same instance (and not through DBLINK) then it works fine.
    However, if we try to call this stored procedure (which is  accesing a table in another instance through DB LINK) from  ORACLE FORMS  6i  in WHEN-BUTTON-PRESSED trigger then the FORM BUILDER gets hanged while compiling the form developed in FORMS 6i.
    Please provide a solution to this problem.
    THANKS IN ADVANCE.
    Hemant Singh.
    Asstt. Manager(IT)
    Software development team.

    Forms 6i was never meant to run against a 11g database, this was not tested and is also not supported.Well, that is not completely true. Developer 6i is supported against a 11g database, but only for Oracle Apps R11. That means that for most other customers (not Apps) Forms 6i will work against an 11g database. However, only Apps R11 is supported, and patches are only created specifically for Apps. We are also running Forms 6i against an 11g database without (well, minor) problems.
    In this case, you need to find a solution. You can try to put the stored procedure in a package. The package body, with the reference to the remote table, will be hidden from Forms this way.

Maybe you are looking for

  • BI ABAP and BI PORTAL

    Hi I would like to know some basic information on the following questions: 1. What is BI ABAP stack and BI ABAP System? 2. What is BI Portal and its use? 3. How can we know that J2EE is installed on BI Server? 4. How does this all together work? Rega

  • AIR iOS app fails uploading to Apple (iTunes Connect)

    I've been trying to upload my iOS app to iTunes Connect via Application Loader but it fails every single time. I'm getting the following error(s); 'Unable to run the lipo command: ... Can't map input file ...' and 'Application failed codesign verific

  • Why is the text I type sometimes deleted on my iphone?

    Sometimes when I am typing a text, what I have typed gets deleted one letter at a time as if I was pressing the delete key?

  • Invalid signature stopping upgrade [Solved]

    i am unable to upgrade any packages because i seem to have an invalid pgp signature. could someone point me to the place where the sigs are stored so that i can delete the offending sig. Note : i know that i can change siglevel in pacman.conf but i w

  • Even more faster pacman searches ??

    UPDATED: version 0.2.1        rewritten synchronize function. it is more robust now. UPDATED: version 0.2       fixes a SERIOUS bug:       directories of the db were not deleted when the db is synchronize back in case some packages had been removed.