Get Schema for a specific object.

I need to get the schema name for a "table" so that I can get its underlying meta data info. A user passes me the "table" name, but the "table" could be in my schema, or could a synonym pointing to another schema. I need to be able to execute the following ;
Select COLUMN_NAME, DATA_TYPE, NULLABLE from all_tab_columns where table_name = passedTable and owner = TableOwner
But the calling program only knows (and passes) the "table" name, so I need to figure out what the true owner/table is.
What I nee is something similar to the "which" command in unix/linux.
Paul

Thank you dan.
Once I had the name of the procedure (DBMS_UTILITY.NAME_RESOLVE), I was able to find other information about how to use it.
For further information look;
http://psoug.org/reference/dbms_utility.html
My actual working code in vb.net is;
strSQL = "sys.dbms_utility.name_resolve"
strErrorSection = strSQL
objCommand = New OracleCommand(strSQL, objConnection)
objCommand.CommandText = strSQL
objCommand.CommandType = CommandType.StoredProcedure
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "name"
objOracleParameter.OracleType = OracleType.VarChar
objOracleParameter.Direction = ParameterDirection.Input
objOracleParameter.Size = 30
objOracleParameter.Value = UCase(strTableName)
objCommand.Parameters.Add(objOracleParameter)
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "context"
objOracleParameter.OracleType = OracleType.Number
objOracleParameter.Direction = ParameterDirection.Input
objOracleParameter.Size = 10
objOracleParameter.Value = 2
objCommand.Parameters.Add(objOracleParameter)
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "schema"
objOracleParameter.OracleType = OracleType.VarChar
objOracleParameter.Size = 30
objOracleParameter.Direction = ParameterDirection.Output
objCommand.Parameters.Add(objOracleParameter)
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "part1"
objOracleParameter.OracleType = OracleType.VarChar
objOracleParameter.Size = 30
objOracleParameter.Direction = ParameterDirection.Output
objCommand.Parameters.Add(objOracleParameter)
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "part2"
objOracleParameter.OracleType = OracleType.VarChar
objOracleParameter.Size = 30
objOracleParameter.Direction = ParameterDirection.Output
objCommand.Parameters.Add(objOracleParameter)
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "dblink"
objOracleParameter.OracleType = OracleType.VarChar
objOracleParameter.Size = 30
objOracleParameter.Direction = ParameterDirection.Output
objCommand.Parameters.Add(objOracleParameter)
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "part1_type"
objOracleParameter.OracleType = OracleType.VarChar
objOracleParameter.Size = 30
objOracleParameter.Direction = ParameterDirection.Output
objCommand.Parameters.Add(objOracleParameter)
objOracleParameter = New OracleParameter
objOracleParameter.ParameterName = "object_number"
objOracleParameter.OracleType = OracleType.Number
objOracleParameter.Size = 10
objOracleParameter.Direction = ParameterDirection.Output
objCommand.Parameters.Add(objOracleParameter)
objCommand.ExecuteNonQuery()
strActualSchema = objCommand.Parameters("schema").Value
strActualTableName = objCommand.Parameters("part1").Value
objCommand = Nothing
strSQL = "Select COLUMN_NAME, DATA_TYPE, NULLABLE " & _
"from all_tab_columns where table_name = '" & strActualTableName & "' and owner = '" & strActualSchema & "'"

Similar Messages

  • What values are possible for a specific object/field

    Hi everyone,
    I am trying to do the following
    Pull a list out of the system that would provide me with value's description for a specific authoirsation object / field
    I have tried SE16 > AGR_1251 > one of my roles
    I am getting the role, object, field, low and high values
    for example
    myrole - M_FORECAST - ACTVT - 03
    What I have missing is the English description of what "03" is. for example "Display"
    A 03 for a field may not always have the same meaning for different objects
    Alternativly can I pull a list somewhere of the potential values and their description for a specific Authorization Object / Field combination?
    Thank you
    Coco

    Please go through the following Tables:
    TACT : Contains the Text Descriptions of all Activities (for e.g. 01= Create/ Generate, 02= change etc.)
    TACTZ : Contains the Authorization Object specific Activities.
    TOBJ  : Description of Authorization Objects
    TOBJT: Text Description of Authorization Objects
    AUTHX:  Details of Fields
    TPARA:  Parameter Ids of Fields
    There are many more... but these are of help as per your question.
    Regards,
    Dipanjan

  • How to remove blocks from buffer cache for a specific object

    hi everybody,
    is it possible to remove blocks which belogns to a specific object (a table for ex) from buffer cache.
    as you know, there is
    alter system flush buffer_cache;command but it does it's job for all buffer cache. if you ask me why i want this, for tuning reasons. I want to test some plsql codes when they run as if they are running for the first time (reading from disk).
    ps: I use oracle 11g r2

    Hi mustafa,
    Your performance will not degrade if you run the query second time ( if i understood correctly, you worry about the performance if you execute the procedure second time). Executing/running the code/sql statements over and over again will have following two good benefits.
    1) This will avoid hard parsing (Hard parsing is resource intensive operation and this generally increase the overall processing time.
    2) This will avoid physical read IO (You gonna see the benefits if data blocks already cached and you dont have to spend time in reading blocks from disk. Reading from disk is much costlier and time consuming operation as compared to data in RAM)
    Having that said sometime bad written queries will acquire more blocks then required and consume most part of buffer cache, and this can some times effect the other important blocks and force to flush out from buffer cache.
    Oracle have built some intelligence for large full table scan operations for e.g will doing full table scan(I hope you already know what is fts) oracle will put its blocks at end of LRU chain. So these will be the buffers will would flush out first then any other.
    From oracle documentation:
    "When the user process is performing a full table scan, it reads the blocks of the table into buffers and puts them on the LRU end (instead of the MRU end) of the LRU list. This is because a fully scanned table usually is needed only briefly, so the blocks should be moved out quickly to leave more frequently used blocks in the cache.
    You can control this default behavior of blocks involved in table scans on a table-by-table basis. To specify that blocks of the table are to be placed at the MRU end of the list during a full table scan, use the CACHE clause when creating or altering a table or cluster. You can specify this behavior for small lookup tables or large static historical tables to avoid I/O on subsequent accesses of the table."
    Regards
    Edited by: 909592 on Feb 6, 2012 4:37 PM

  • I can't get artwork for a specific album recently added

    I can't get artwork for a recently added album. All other albums have thier proper artwork, no issues.  just Smashing Pumpkins...

    Hello, nicgeo. 
    Thank you for visiting Apple Support Communities.
    iTunes will only download album artwork for songs that it can find in the iTunes Store. iTunes will check each song in your iTunes library and attempt to match it up with a song in the iTunes Store. If the data matches, iTunes will download the album artwork from the iTunes Store and add it to the song in your iTunes library. If iTunes does not find a particular song's artwork in the iTunes Store, you will not see an alert message. iTunes simply does not download artwork for that song.  If the data does not match, you will have to add the artwork manually.
    iTunes 11 for Windows: Add artwork to songs and other items
    http://support.apple.com/kb/PH12361
    Cheers,
    Jason H.

  • Query Builder - Getting Universelist for one specific Group

    Hi All,
               I am in need of a query string (in query builder) that will return me All the universes for a specific group.Is it possible to do and if possible what will be the way to do this?
    Thanks in advance for your help,
    Anirban

    Hi Anirban,
    What is the BusinessObjects version you are using ( i.e. BO XIR2 or BOXI 3.0)?
    Regards,
    Deepti Bajpai

  • Getting DDL for all oracle objects

    I am working to get the DDL for all the oracle objects within my schema.
    Some how I got the DDL but I can't got the comments associated with the oracle tables.
    Shall I know what I am missing in using dbms_package I am currently using ..?
    Below is the sql I am using to get DDL
    SELECT dbms_metadata.get_ddl(replace(OBJECT_TYPE, ' ', '_'), OBJECT_NAME,OWNER)
    FROM DBA_OBJECTS
    WHERE OBJECT_TYPE in ('SEQUENCE',
    'PROCEDURE',
    --'DATABASE LINK',
    'PACKAGE',
    'PACKAGE BODY',
    'MATERIALIZED VIEW',
    'TABLE',
    'INDEX',
    'VIEW',
    'FUNCTION')
    AND
    OWNER = 'Schema_1';
    Can I know what needs to be changed to above sql to get comments on oracle tables along with their DDL.
    Any advise is highly appreciated.
    Thanks
    JP

    >
    I am still MISSING ';' after every sql and comments.
    >
    You only get what you ask for. If you want modifications you have to set the proper transform parameters.
    See DBMS_METADATA in the PL/SQL Packages and Types doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_metada.htm
    See SET_TRANSFORM_PARAM and SET_REMAP_PARAM Procedures and table 74-22 that list the parameters you can use
    Here are some examples from Java code that I use depending on flags that have been set
    -- set the transforms back to the defaults
            String defaultTransform   = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'DEFAULT'); END;";
    -- do not include referential constraints
            String ref_constraints    = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'REF_CONSTRAINTS', false); END;";
    -- do not include constraints
            String constraints        = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS', false); END;";
    -- do not include the schema prefix
            String noschema           = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'EMIT_SCHEMA', false); END;";
    -- make it look pretty
            String pretty             = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY', true); END;";
    -- don't include the physical properties
            String physicalProperties = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PHYSICAL_PROPERTIES', false); END;";
    -- don't include the segment attributes
            String segmentAttributes  = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SEGMENT_ATTRIBUTES', false); END;";
    -- include a sql terminator for each statement
            String sqlterminator      = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR', true); END;";The last one is what you are looking for.

  • Create a business object for a Maintenance object

    Hello,
    I want to create a business object for a maintenance object to change all XML attributes to XML elements.
    Should I have to change the whole XML Schema from attributes to elements one by one?
    For example, I create the business object CM_Person_BO for the maintenance object Person, and use the business object to add user in a more standard way.
    But it is a quite large job to rewrite the whole schema for the maintenance object Person, which has following elements, which are PersonIdentifiers, PersonNames, PersonPhones, PersonCharacteristics, Person and SeasAddress.
    Is there any easy way to do it?
    Thanks,
    Kerr

    Should I have to change the whole XML Schema from attributes to elements one by one?
    Is there any easy way to do it?Unfortunately not, you will have to define the schema containing each field/element, once. The primary objective is that you should create a scaled down version of the BO having only the required fields or subset of available fields, you may not need all the fields of a MO. This increases performance as the IO is performed only for specified fields in the BO.
    You can define separate Data Areas for each Person object's context, i.e. Identifiers, Names, Phones, etc. and include them (includeDA) within the Person BO (CM_Person_BO) for clarity.

  • How to obtain an access key for modifying standard objects?

    Hello,
    I am a so-called "dummy" in ABAP development, and I need some very basic
    help.
    I'm trying to modify standard communication structure MCVBAK for LIS
    enhancement, as I learned in the LO630 SAP training, but I need an "access
    key".
    I went into my "SAP online services" account, but I can't find where I'll
    find the acess key for the specific object I'm trying to modify.
    Can someone help me, please?

    You may be needing to enter your developer's key. 
    You must be a registered developer on your system to do this type of work.
    Your system administrator will have to register you thru OSS, and you will be given a key.
    The first time you try to edit an object, you can enter this, and you won't see that prompt again.
    After that, if you are trying to change an SAP object, you will need to register that as described above.
    Doug

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • How to get all oneorder header_guids for a specific reference PRODUCT_ID?

    Hi,
    in servicerequest we add iobjects as reference objects.
    The iobject represents the machine a customer has an issue with.
    Within the iobject master we have a PRODUCT_ID. The product_ID represents the machine type.
    So:
    1 product_id could have 1:n iobjects (machines)
    1 servicerequest has 1:1 iobject.
    The requirement is to select all oneorder documents with a specific product_id within the assigned iobject.
    I do not realy know which database tables i have to join?
    Or is there already a function module in standard which can be used?
    Thank you
    Kind regards
    Manfred

    Hi,
    OBJECT_ID can´t be the import parameter for IOBJECTs because it is from type CRMT_OBJECT_ID - which is the ID of transactions and not IOBJECTs.
    I have played arround with this function module CRM_SERVICE_PORTAL_SEARCH but haven´t found an option to get all servicerequests (one order documents) for a specific reference object or a list of reference objects.
    Are there other ideas how to use this or another function module for my requirement.
    Thanks a lot.
    Kind regards
    Manfred

  • Could not get schema Object:java.sql.SQLSyntaxErrorException ora-904

    All of a sudden I get
    Could not get schema Object:java.sql.SQLSyntaxErrorException: ORA-00904: "SYS"."O"."NAME": ongeldige ID
    when doing anything in the tables tree in the connections pane
    The only thing I set recently is pga_aggregate_target
    Environment
    Oracle 11.2.0.1
    OS Windows Vista Ultimate sp2
    Sql developer 2.1.1.64.39 with its own JDK
    As the download links on OTN are broken I can not upgrade, and I'd rather not work in command line sqlplus.
    Help!!!
    Sybrand Bakker
    Senior Oracle DBA

    My copy of sqldeveloper isn't located in that directory. Would that matter?
    In the mean time I have disabled filtering the tables node. Opening the tables node doesn't result in exceptions anymore.
    Now, when I click on any table in that node I get 4 identical ora-904 error messages for sys.o.name for any table.
    Apparently it is querying either the all_objects view and it thinks it is querying sys.obj$.
    I didn't yet enable sql_trace for the session, I'm more or less giving up on sqldeveloper. I can not use the space bar in any datagrid, sqldeveloper has always been extreemly unresponsive when navigating the schema browser (as opposed to Toad), etc, etc. Too bad I bought Sue Harpers book, but I think I will be de-installing sqldeveloper soon.
    Sybrand Bakker
    Senior Oracle DBA

  • Restricting Authorization for a specific Info-object

    Dear All,
    I have a scenario where I have to restrict the account managers by specific channels.
    I have 2 info-objects, Sold-to party and Sales Channel. Sales Channel is defined as attribute of the the Sold-To Part info-object.
    I was exploring the BI authorizations concept in SCM 2007.
    I created a authorization called "Test" and assigned the info-object Sales Channel in the authorization and restricted it for one value. This authorization along with 0BI_ALL I have added to the role under BI authorizations.
    However in interactive demand planning, I cannot restrict by the sales channel. It allows me to load data for all the channels.
    If I remove 0BI_ALL object, then I cannot load anything in interactive planning.
    Does anyone have a step by step proceedure for using the BI authorization concept?
    Regards,
    Kedar

    Yes, 0TCAACTVT (activity), 0TCAIPROV (InfoProvider) and 0TCAVALID (validity) have to be made authorization relevant. For the info objects you want to use to control security, also make them authorization relevant in RSD1, imagine the object you want relevant is ZZ_VKORG (sales organization).
    Then use RSCEADMIN transcation and 0BI_ALL will include the objects from above, copy 0BI_ALL into a object such as Z_1000 and then change the value for the specific info object that you want to control, imagine that you want sales org 1000 only to be allowed within Z_1000.
    Now, you have 2 choices: You can use the normal security maintenance (SU01, PFCG) and you can asssign RSRS_AUTHBIAUTH and set BIAUTH requal to Z_1000 or you can use user maintenance directly within RSCEDAMIN and assign Z_1000 to the user. Either way, it becomes part of the authorization of the user.
    You may find that you need to introduce colon authorization concept ( for mixed levels of data and that is just a matter of adding a second line to the allowable values and setting it like "EQ :".
    Things to consider:
    1. This authorization concept is water tight and will do everything you need, but will do at the expense that if you don't model it first, you will kill yourself trying to make it right. This becomes evident when you trace a security issue (via RSCEADMIN) because the way BI7.0 works is that it will build a minimized superset of authorizations, so it is best to know where you want to get to, rather than starting off by where you know you need to go.
    2. To control change or display mode, you will need to influence 0TCAACTVT, even though you might think to use C_APO_SEL3 for ACTVT, the BI7.0 concept works within the BI space and 0TCAACTVT doesn't impact it.
    3. If you activate more info objects, 0BI_ALL will get updated automatically but your custom  authorization objecst will not. So, it is best to activate them all at the same time so that you don't have to manually change them.
    4. Do the work in development and transport it to the TEST/QA/PROD environments, there are transprt tools within the RSCEADMIN.
    This is probably enough to get you going, reply back if you have specific questions or issues.
    I've been thru this in a painful way, sometimes the best things learned are learned the hard way

  • XMP property for a page object not predefined and no extension schema...

    In attempting to make PDF/A-1b files, I get the Preflight error "XMP property for a page object not predefined and no extension schema present."
    Every page reports the same Trigger values:
    => Property exists in predefined schema (XMP 2004): is not true
    => Extension schema is present in XMP: is not true
    By following the suggestions in the Acrobat 9 Help page "Edit document metadata" I can save existing metadata to an external .xmp file, but I cannot change the XMP metadata to solve the Preflight error.
    I would be grateful for suggestions re how to solve the Preflight error.
    Thanks,
    Raphael

    There is still that same problem.
    Pictures what needed to converted tot PDF/A
    My situation is large JPEG's.
    My workaround to print it out with adobe pdf printer with the options
    1) papiersource on base of pageformat PDF
    2) If needed use adjusted paperformat

  • Audit specific objects for specific users

    audit statement has the option to choose audit by user list
    audit object has the option to choose audited objects
    now i need to audit specific objects, i.e. user A's tables accessed by a specific group of users, let's say ALL users other than A
    Is it a simple way to achieve this goal? (audit A's tables that accessed by all database users other than A)
    Thanks!

    sorry, the link works now. However, there is nothing new in 10G, same as I read from 9i document. See my highlight below in the quoted document text, my requirements is the combination of them ( specific users and specific objects). Thanks anyway.
    <quote
    Table 8-1 Auditing Types and Descriptions
    Type of Auditing (link to discussion)      Meaning/Description
    Statement Auditing      Enables you to audit SQL statements by type of statement, not by the specific schema objects on which they operate. Typically broad, statement auditing audits the use of several types of related actions for each option. For example, AUDIT TABLE tracks several DDL statements regardless of the table on which they are issued. You can also set statement auditing to audit selected users or every user in the database.
    Privilege Auditing
         Enables you to audit the use of powerful system privileges that enable corresponding actions, such as AUDIT CREATE TABLE. Privilege auditing is more focused than statement auditing, which audits only a particular type of action. You can set privilege auditing to audit a selected user or every user in the database.
    Schema Object Auditing
         Enables you to audit specific statements on a particular schema object, such as AUDIT SELECT ON employees. Schema object auditing is very focused, auditing only a single specified type of statement (such as SELECT) on a specified schema object. Schema object auditing always applies to all users of the database.
    Fine-Grained Auditing
         Enables you to audit at the most granular level, data access and actions based on content, using any Boolean measure, such as value > 1,000,000. Enables auditing based on access to or changes in a column.
    /quote>

  • View ADSI properties for an AD object from a specific DC

    Hello all,
    What I'm wanting to do is to view the ADSI properties of an active directory object by querying a SPECIFIC DC. My plan is to use this information to check whether adprep has replicated to all DC's in the domain.
    For example, the following command gets me the ADSI information for an AD object from some DC for Domain1:
    [adsi]'LDAP://CN=ActiveDirectoryUpdate,CN=ForestUpdates,CN=Configuration,DC=Domain1,DC=net'
    However, I would like to get this information from a SPECIFIC DC, not just from any DC. I have also been tampering around with get-adrootdse, but am unable to determine how to drill down under a specific "naming context" object (like to return
    the "cn=activedirectoryupdate,cn=forestupdates" object under the configuration naming context object like the command above):
    Foreach($namingcontext in (Get-ADRootDSE -server DC1.Domain1.net).namingcontexts){
    get-adobject $namingcontext -Properties *
    Anyone have any ideas how I can use the [ADSI] adapter or get-adrootdse to return specific AD objects from a specific domain controller?

    Nevermind, I believe I found my answer:
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/17/how-can-i-access-active-directory-on-a-specific-domain-controller.aspx

Maybe you are looking for

  • OSX LION POOR PERFORMANCE MACBOOKPRO!!!!

    SINCE UPGRADING TO LION IVE HAD REGRETS! HERES A FEW ISSUES!! Sometimes hangs in Safari on full screen mode, and occationally not in full screen mode, sometimes have to force quit, wht the **** cant i get it to open on favourite sites?!! iPhoto lags

  • Unable to cancel "Unarchiving" action

    Safari crashed as I was downloading a document. I double-clicked the 'download part' in an attempt to resume the download. The item appeared to partially download and is stuck at what looks like 99%. I cannot cancel it, nor can I trash the partial do

  • Converting PR into Schedule lines in mass

    All SAP Gurus, We have scheduling agreements for several materials. Now in day to day working, various user departments rais the PR for these items. Then we enter the schedule for these items into the scheduling agreement (with reference to PR). But

  • What are ur power/sleep settings if u let ur iTunes play all nite?

    Does Itunes keep playing and streaming music if u let it go while u sleep? What settings do u put ur Mac on to allow this so it doesn't turn your modem connectionoff and at the same time doesn't hurt ur system in the long run from overuse? Thanks!

  • Cash flow Statement via Direct method using BW

    Hi Gurus, I have an requirement to prepare Cash flow statement via direct method using BW. Can anyone advice or point me to the steps need to be done in order to achieve this Thank you BR