Can't access tables in PL/SQL package

I'm trying to create my first package/stored procedure. Been to class, so I don't think the problem is with me. In a real environment now. My schema/user has access to tables in another schema, plus create procedure priviledges. I compiled the package spec OK, but couldn't use %Type. I had to specify the datatype. The package body won't compile with the error message "Error: PLS-00201: identifier 'PTI_PROD.SC_MSTR' must be declared". I can run the SQL just fine in SQL*Plus. Why can't I access tables inside a package. We didn't have this problem in class.

steven. the oracle error msgs documentation says that maybe there is no access privelege to the table. this looks like a privelege issue. grant priveleges explicitly on those tables accessed by your procedure not through any roles.
in your case login as pti_prod and type
grant select,insert,update on sc_mstr to user1;
this shld work.
null

Similar Messages

  • I am trying to have access tables of the Sql Server through the Oracle

    I am trying to have access tables of the Sql Server through the Oracle and this being occurred the error:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message: [Generic Connectivity using ODBC][H006] The init parameter <HS_FDS_CONNECT_INFO> is not set.
    Please set it in init <orasid>.ora file.
    ORA-02063: preceding 2 lines from HSMSQL
    I created the ODBC with name HSMSQL.
    I made all the configurations in the archives
    tnsnames.ora:
    HSMSQL=
    (DESCRIPTION=
    (ADDRESS= (PROTOCOL = tcp)(HOST = wsus)(PORT = 1521))
    (CONNECT_DATA =
    (SID = HSMSQL)
    (HS = OK)
    listener.ora:
    (SID_DESC = (SID_NAME=HSMSQL)
    (ORACLE_HOME= C:\oracle\ora92)
    (PROGRAM =hsodbc)
    initHS_SID.ora:
    HS_FDS_CONNECT_INFO = HSMSQL
    HS_FDS_TRACE_LEVEL = OFF
    -- Create database link
    create database link HSMSQL.US.ORACLE.COM
    connect to TESTE identified by TESTE2
    using 'HSMSQL';
    But when I execute query the error occurs:
    Select * from TabTeste@HSMSQL
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message: [Generic Connectivity using ODBC][H006] The init parameter <HS_FDS_CONNECT_INFO> is not set.
    Please set it in init <orasid>.ora file.
    ORA-02063: preceding 2 lines from HSMSQL
    Please they help me, thanks, Paulo.

    Hi,
    It seems that your configuration is Ok. By the way, the workaround for this error is:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Transparent gateway for ODBC][H001] The environment variable <HS_FDS_CONNECT_INFO> is not set.
    * Set HS_FDS_CONNECT_INFO in the hs{sid}init.ora file to the data source name.
    Example: HS_FDS_CONNECT_INFO = <ODBC DataSource Name>
    * Make sure the hs{sid}init.ora file exists in the ORACLE_HOME/hs/admin directory and has the same name as the SID in the LISTENER.ORA.
    Example: If SID=hsodbc in the listener.ora file, then the hs{sid}init.ora file would be named ORACLE_HOME/hs/admin/inithsodbc.ora
    For more information see if this [url http://forums.oracle.com/forums/thread.jspa?forumID=61&threadID=576975]thread can help you.
    Cheers

  • Can we access tables created internally for Business objects in CAF

    Hi,
         When we create and Deploying Business objects in CAF then internally it creates tables in Oracle/Maxdb database. Can we access those tables through CAF.
              Or is it possible for Oracle to access the Business objects tables which are deployed on SAP Web Application server?
              We can configure the Oracle driver in the SAP Web App Server. But how can we use it?

    Hi Rohit!
    Can we access the tables created internally for BO's without the use of CRUD methods provided by them.?
    Or
    Can we fire queries on these tables through Oracle.? As the tables are created along with BO's in the database.
    Maybe, you can do that, but why do you want to do that?
    Based on the Entity Services (i.e., CRUD and find operations) that are generated for your BOs, you can implement Application Services which contain any business operation that you want to perform. Furthermore, you can expose your Application Services as Web Services. That's the designated way to do that.
    Manually manipulating the underlying database tables does not sound like a good idea.
    Best regards
    Alexander

  • Can't access tables in other Oracle database schemas

    Hi. We got our Oracle database admin to install APEX in our Oracle database. She created a login and schema for my Oracle database user so that I could work with APEX a little. Here's the information on the version of APEX we have installed:
    Database Version Information
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    I've found that my user is only able to access Oracle tables within my own Oracle database schema. Most of our main tables are in 3 other schemas and I'd need access to all tables in all these schemas. Right now whenever I encounter a drop list of values for Schema, only by own schema is available in the list of values.
    Is there something our Admin can do to make these tables in other schemas available to my user account?

    Sharpe,
    This documentation should point you in the right direction. It will show you how to add multiple schemas to a workspace.
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21678/adm_mg_wrkspc.htm#CHDBDCCJ
    Cheers,
    Tyson Jouglet

  • How many systems can be accessed to a single SQL Server?

    I am a C# developer. I am developing a C# application. I need to install application in all the client PC's and I am planning it to install SQL Server in a single pc or server. I am planning
    to give the connection to sql server from the client pc's. How many connections is possible? Is it depends on OS? If I need more connections what to do?
    Thank's in Advance.

    Hello,
    You can establish up to 32,767 Connections to SQL Server, see
    Maximum Capacity Specifications for SQL Server => "User Connections"
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Accessing tables from different schema in CDS and AMDP

    Hi All,
    We are working on a HANA system which has several schema replicated from SAP R/3/Non SAP systems. We have BW 7.4 SP9 deployed on the same system and accessing the HANA views using latest BW virtual objects such as Open ODS , Composite providers etc.
    We are also using the BW system for few ABAP based data processing developments. We are currently accessing HANA views in ABAP programs by creating dictionary views based on external HANA views.
    We would like to however use recent possibilities of CDS and AMDP for better life cycle management of ABAP based solutions. The open SAP course on this subject was of very good help. Thanks a lot "open SAP team" for that. I would however have few open questions,
    As I understand AMDP gives us full flexibility of writing sql procedures within ABAP development environment, but can we access tables from different schema into AMDP code. If yes, then sample code would help.
    If the answer of first question is yes, then how do we manage transports between development and production systems where the schema names would be different. Currently in open HANA developments, such transport is manged using Schema mapping.
    Can I also use different schema tables in CDS views.
    We are updating few tables in ABAP dictionary after applying processing logic in ABAP program as detailed in step 1. With the new approach using AMDP, can we directly update database schema tables which will give us an optimization advantage.
    New ABAP HANA program interfaces are quite promising and we would like to use them to optimize many data intensive applications.
    Thanks & Regards,
    Anil

    Hi Anil,
    I can only answer 1. and 2. (and would be interested into 3. as well):
    1.
    Yes you can access tables from a different schema and also HANA views. In this case no 'using' is needed.
    Examples:
        RESULT = SELECT
        FROM
              "SAP_ECC"."T441V" AS t,
              "_SYS_BIC"."tmp.package/AFPO" AS a.
        WHERE ...
    2. In this case, if you need schema mapping: You could use HANA (projection) views which just forward to a different schema, also see example.
    Best regards,
    Christoph

  • My PL/SQL package worked in 8i but does not function in 9i

    At our site we have two servers. On server B (master server) we enter all the user information such as create user,alter,
    grant,revoke... etc. This data is entered into the master server and also inserted into a log table that is accessed, periodically, by our
    second server, server A.
    Server B is accessed by a PL/SQL package, executed at server A. It accesses server B through a database link and selects the
    statements in the table at server B, and executes them on server A. It if encounters an error (user doesn't exist, role doesn't
    exist,...etc) it makes an entry in a error_log table on server B, deletes that entry from the log table on server B, and continues with
    the next statement. In Oracle 8.1.6.3, it works great. However, we have just migrated to Oracle 9.0.1.3 and now we can't get it
    to work at all. It appears that the exception handler(s) is not working and falls through to the outer most exception handler which
    states: when others then dbms_output.put_line ('Processing Aborted');
    If anyone has any ideas on this subject, please let me know.
    Thanks,
    Bernie

    did you check to see what the Oracle error message was, using someting like this:
    dbms_output.put_line(SubStr(SQLERRM, 1, 255)) ;

  • --urgent Can I use table data to create a dynamic drop down menu?

    Hi,
    I am asked to investigate the possibility of using APEX to create a table driven dynamic drop down menu? The deadline is tomorrow but I have spent quite a bit of time but still have not any clue. Can any one have such experience to point me a way to focus on?
    Many thanks.
    Jennifer

    Thanks you very much for the help Kevin.
    Currently my company is using htp.p style to create web app and using the dynamic menu in a similar way as you explained. Now they want to move to Apex and still keep dynamic menu functionality. After reading your response and research I have done I think I can embed it into Apex application by creating the similar table and PL/SQL package and let Apex to call the PL/SQL package when the application is first called. However may I ask you a question about how to call such pl/sql procedure in Apex? .
    The current application has the following URL, from which the procedure pkg_main.print_menu is called and html home page with dynamic menu is displayed.
    Http://app server:1234/pls/applicationname/pkg_main.print_menu?p_new_window=N
    BUT what about the Apex? The Apex URL format is like the following, where 11563 and 1 is application id and page number. Assume that 1 is home page, but HOW the procedure is called, from WHERE?
    http://apex.oracle.com/pls/apex/f?p=11563:1:3397731373043366363
    Jennifer

  • How to access tables in another workspace (same server) ?

    This one is probably simple, but I can't figure it out : we have different applications in different workspaces but on the same server : how I can simply access tables (read only is enough) in a different workspace than the application ?
    Edited by: JJ MAHE - Oracle on Mar 18, 2013 2:07 AM

    Hello
    If you need access to oracle schema, the schema needs to be assigne to desired workspace. You can configure it in INTERNAL Workspace. One Oracle schema can be assigne to many workspaces.
    Regards

  • How can I access Constants Decalred in PL/SQL Package

    CREATE OR REPLACE PACKAGE PKGDIMCONSTANT AS
    ABCD123 CONSTANT NUMBER := 1942; --:NodeDef
    END PKGDIMCONSTANT;
    Testing in PL/SQL it is working
    BEGIN
    RetVal :=PKGDIMCONSTANT.abcd123;
    dbms_output.PUT_LINE( RetVal ); END;
    The output is : 1942

    Assuming you want to access them from SQL...
    You cant directly access the constants from SQL. I tried some tests and did not work.
    What you can do is write a PLSQL function in the same package to return the value of that constant and use that function.

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • How can I see the relationship of tables in Microsoft SQL Server?

    How can I see the relationships of the tables? Exactly like what we see in Access. In Access if we select Database tool and then relationships, we can see how the tables are linked to each other. How can I find this option in SQL Server Management Studio?
    Thanks,
    GGGGGNNNNN
    GGGGGNNNNN

    Thanks,
    I could verify what you explained here. how can I overcome this message and resolve it when my database owner is not there:
    Message while starting with database diagrams of a attached/restored database
    If you have just attached/restored a database from another SQL Server instance. While accessing its database diagrams folder, you may get the following message
    It is an informational message and would prevent you from working on database diagrams. The message says that your database has no valid owner currently. Reason for this error is that database owner on a previous SQL Server instance does not exist here.
    To overcome this error just add the valid database owner through T-SQL or SSMS. Also verify the compatibility level of your database is correct for your SQL Server instance.
    I appreciate your help.
    GGGGGNNNNN
    GGGGGNNNNN

  • Using Interactive Report with SQL query accessing tables via db link

    Is there a known issue with using the interactive report in version 3.1.2.00.02 with SQL that is accessing tables via a database link? I get the error 'not all variables bound', I do not get this error when using the standard report for the same SQL?
    Thanks,
    Edited by: [email protected] on May 26, 2009 2:59 PM

    Varad,
    Good question, failed to check that. In fact there are errors. Dump file c:\oraclexe\app\oracle\admin\xe\bdump\xe_s002_3640.trc
    Mon Jun 15 08:48:11 2009
    ORACLE V10.2.0.1.0 - Production vsnsta=0
    vsnsql=14 vsnxtr=3
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Windows XP Version V5.1 Service Pack 3
    CPU : 2 - type 586, 1 Physical Cores
    Process Affinity : 0x00000000
    Memory (Avail/Total): Ph:1051M/2038M, Ph+PgF:2273M/3934M, VA:1302M/2047M
    Instance name: xe
    Redo thread mounted by this instance: 1
    Oracle process number: 16
    Windows thread id: 3640, image: ORACLE.EXE (S002)
    *** ACTION NAME:(PAGE 2) 2009-06-15 08:48:11.743
    *** MODULE NAME:(APEX:APPLICATION 112) 2009-06-15 08:48:11.743
    *** SERVICE NAME:(SYS$USERS) 2009-06-15 08:48:11.743
    *** CLIENT ID:(ADMIN:232384011651572) 2009-06-15 08:48:11.743
    *** SESSION ID:(24.931) 2009-06-15 08:48:11.743
    *** 2009-06-15 08:48:11.743
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [_LdiDateFromArray+55] [PC:0x608B04F3] [ADDR:0x0] [UNABLE_TO_WRITE] []
    Current SQL statement for this session:
    select Stage,Procedure,Stp,FW,Reslt,MSG,date_run
    from bi_msg_VW@dwitnm
    order by 1
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    2FE1EA14 1207 package body SYS.DBMS_SYS_SQL
    2FE1F064 328 package body SYS.DBMS_SQL
    2ABDC520 5097 package body APEX_030200.WWV_RENDER_REPORT3
    2BD5E55C 1538 package body APEX_030200.WWV_FLOW_DISP_PAGE_PLUGS
    2BD5E55C 366 package body APEX_030200.WWV_FLOW_DISP_PAGE_PLUGS
    335BDA88 11190 package body APEX_030200.WWV_FLOW
    2BDBD1C8 255 procedure APEX_030200.F
    2AB58D10 30 anonymous block
    ----- Call Stack Trace -----
    I didn't include the call stack, it is too large. Now I'm even more puzzled that the IR would work while a sql report would fail.
    Bob

  • How can a type defined in a PL/SQL package be used by an object?

    How can a type defined in a PL/SQL package be used by an object?
    In the PL/SQL Reference manual it says that object attributes can be
    types defined inside a PL/SQL package: How do you make this work?
    Here is a sample that demonstrates what I am trying to do:
    CREATE OR REPLACE
    PACKAGE Phone IS
    TYPE Phone_rectype IS RECORD (
    Main VARCHAR2(12),
    Home VARCHAR2(12),
    Business VARCHAR2(12),
    Mobile VARCHAR2(12),
    Fax VARCHAR2(12),
    Pager VARCHAR2(12)
    END Phone;
    CREATE OR REPLACE
    TYPE customer_type
    AS OBJECT (
    CustNo NUMBER,
    CustName VARCHAR2(30),
    PhoneNumber Phone.Phone_rectype
    This is the error that i get:
    Warning: Type created with compilation errors.
    Errors for TYPE CUSTOMER_TYPE:
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    5/15 PLS-00201: identifier 'PHONE.PHONE_RECTYPE' must be declared
    null

    That's a good point, Justin - thanks for the advice. At the moment, our process of data validation isn't very well defined, so the table definitions aren't always the same beyond a core set. As we get more automated and able to develop table definitions flexible enough to accomodate all the quirks in client data, I may be able to consider moving to a single schema to take advantage of maintenance and performance improvements. My ultimate concern with doing that is that the datasets we're dealing with can be tens of millions of rows in size. Clearly, I'm no DBA, but I just assumed that we would be able to churn through these datasets faster if they were in a schema by themselves rather than lumped together into one huge half-a-billion row table?

  • I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work

    Hi,
    I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
    (fault number -2147217900)
    I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
    Working with LabView 7.1, database con. toolset.
    Who can HELP?
    Thanks a lot
    Marco

    Hello,
    I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
    Paulo

Maybe you are looking for

  • One song at a time

    Since I downloaded iTunes 10.0.1(22) about a week ago, it's only playing one song at a time - not just within playlists but in the music library too. I can't find anything in Preferences that helps. I didn't change any settings anyway. Has anyone any

  • 6280 goes white screen when I sync with Vista

    Hi all, My 6280 goes white screen and reboot when I sync after a 350 items uploaded to my laptop under Vista Premium Family Edition. I've got this problem either connected through the cable or bluetooth. I use the latest version of PC Suite, but I do

  • Is There any Bapi/Idoc to inactivate a given customer ?

    HI all,   We have a requirement that we want to inactivate a few customers using a BAPI. Is this functionality is available ? if it does please help me out. Thanks in advance.

  • Loading the cube from 3 datasources and getting 3 records for each keyfield

    Hi All, I am loading an InfoCube from 3 separated datasources. These 3 datasources are UD Datasources and their unique source system is UD Connect. Each of the datasource contains a unique key field 'Incident Number' (same as we use have in Datasourc

  • Need Guidance. Kindly Guide

    Hi, Dont know whether this is the right place to ask such questions... I need some guidance. I have 5 yrs of expereince in Oracle.(4 years in Oracle PL/SQL and 1 year in Oracle DBA continuing). The company management now wants me to move into Oracle