Parse Tablename/Table Owner

I would like to validate a user's input (via a C Shell) for an Oracle Table name. Can anyone assist me with the SQL statement(s) needed to parse the table owner and table name?
null

I didn't understand a little bit what You mean by parse, but there is a view all_tables and columns owner and table_name.
So
SELECT owner, table_name
FROM all_tables;
will give You all tables with their respective owners
Of course there are also views, synonyms for views and tables and maybe something other ...

Similar Messages

  • Dynamic table owner in apex 3.0 and Oracle 10g

    I have an application that requires bulk deletes for all rows in a particular department. The application edits incoming data and then moves final approved data to the 'production' db. End users modify their data via bulk load until they are happy with validity checks. At certain times of the year this could be as many as a million rows in a single table with referential integrity deletes in up to 5 additional tables. This generates unnecessary redo and archive logs so I thought we might just create separate schemas for each department (11) and do DROP/CREATE table instead.
    The problem is that I see no way to dynamically change the table owner in ApEx. Is there any way to do this short of export/import to a 11 different parsing schemas?

    ...I thought we might just create separate
    schemas for each department (11) and do DROP/CREATE
    table instead.Instead of doing drop/create on your tables just do a truncate on the table.
    >
    The problem is that I see no way to dynamically
    change the table owner in ApEx. Is there any way to
    do this short of export/import to a 11 different
    parsing schemas?You may try creating your tables as follows
    CREATE TABLE dept1.table_a AS SELECT * FROM old_table WHERE dept=1;
    CREATE TABLE dept2.table_a AS SELECT * FROM old_table WHERE dept=2;
    Then investigate using UNION logic and possibly a flag to show/hide departments...
    SELECT * FROM dept1.table_a WHERE dept=1 AND :P1_FLAG=???;
    UNION
    SELECT * FROM dept2.table_a WHERE dept=2 AND :P1_FLAG=???;
    The above union logic may work for reporting needs but would likely not work for your maintenance pages where you need to insert/update/delete...
    Message was edited by:
    tfa

  • App needs to run on multiple DBs; can parsing schema/ ref owner be dynamic?

    I have an app that needs to run on multiple databases. Is there a way to create something like an app-level item -- something that only needs to be set once -- that can be referenced to specify the parsing schema, and all of the instances of "reference table owner" used to specify the source for DML? Or (I've not tried this yet) can I just NOT set the value of reference table owner? In my case, the reference table owner for all tables is the same as the parsing schema.
    Thanks,
    Carol

    hi Varad -- I should have been more specific. The application does not need to access multiple databases; rather, it will be installed on multiple databases, operating only on the DB on which it's installed. (Same functionality on each DB, same DB schemas in each, different data in each.)
    So, I'm wondering if there is a way to have the parsing schema somehow be set automatically based on information in the database, or if I'll have to create a slightly different version of the app, w/ different parsing schemas, for each database.
    It was recommended to me (perhaps by you, I can't recall) that the parsing schema be the same as the owner of the tables that the app accesses; the table owner is different in each of these databases, so that is the source of this problem (if indeed it is a problem).
    Thoughts?
    Thanks,
    Carol

  • How can I specify table owners when I export project to Java source?

    Using TopLink Mapping Workbench, when I export project to Java source, the descriptors is automatically generated like:
    descriptor.addTableName("SOME_TABLE");
    Is there a way to configure the TopLink Mapping Workbench so it generates the descriptors so that the table owner is explicitly specified?
    descriptor.addTableName("SCHEMA_A.SOME_TABLE");
    Thanks!

    You can re-name your tables in the MW to be fully qualified for the name and that's how it will be generated and used.
    Doug

  • SQL-Developer 1.5.4 - SQL-Worksheet does not use Table-Owner

    In old versions of the sql-Developer you can drop a Table in the Worksheet and a select Query was built. With the new version 1.5.4 the table-owner is missng and you must fill in the table-owner or the query does not work with tables of other users.
    Is that a bug or are there the posibility of change settings to drop tables in the SQL-worksheet with table-owners.

    The drag and drop functionality was updated so that when you use drag and drop the schema is not prefixed for the current user you are connected to. However it is appended if you drag a table form another connection. It appears to have been overlooked for Other Users. We will address this in a future release. In the meantime,a workaround is to create a connection to the other users and then the drag and drop will append the connection name.
    Sue

  • Page Table Owner

    Hello everybody,
    I made the following query to get table and column names handled by a application/page:
    select APEX_APPLICATION_PAGE_DB_ITEMS.ITEM_NAME,
    APEX_APPLICATION_PAGE_DB_ITEMS.DB_TABLE_NAME,
    APEX_APPLICATION_PAGE_DB_ITEMS.DB_COLUMN_NAME,
    APEX_APPLICATION_PAGE_ITEMS.FORMAT_MASK
    from APEX_APPLICATION_PAGE_DB_ITEMS,
    APEX_APPLICATION_PAGE_ITEMS
    where APEX_APPLICATION_PAGE_DB_ITEMS.APPLICATION_ID = APEX_APPLICATION_PAGE_ITEMS.APPLICATION_ID
    and APEX_APPLICATION_PAGE_DB_ITEMS.PAGE_ID = APEX_APPLICATION_PAGE_ITEMS.PAGE_ID
    and APEX_APPLICATION_PAGE_DB_ITEMS.ITEM_ID = APEX_APPLICATION_PAGE_ITEMS.ITEM_ID
    and APEX_APPLICATION_PAGE_DB_ITEMS.APPLICATION_ID = 37891
    and APEX_APPLICATION_PAGE_DB_ITEMS.PAGE_ID = 55
    How can I improve it to get DB table owner?
    Thanks,

    P - The table owner isn't exposed by that view (APEX_APPLICATION_PAGE_DB_ITEMS), but you could change it to pull out what you want and compile the new view in the Application Express product schema. This wouldn't hurt anything but it wouldn't be supported, of course.
    The change would be where you see, in the current view source:       r := dbms_lob.substr(c1.process_sql_clob,255,1);Change that to:       l_owner := replace(substr(r,1,instr(r,':')-1),'F|',null);     
           r := dbms_lob.substr(c1.process_sql_clob,255,1);...along with adding a declaration for l_owner. Then you'll need to replace #OWNER# with the f.owner value.
    Scott

  • Label Security - Can see all rows as LBACSYS but none as table owner

    Question: I've inherited a 10.2.2 database that contains a copy of a database that was upgraded from 8i.
    All of the tables that were managed within Secure Access are now managed by OLS. The new tables now have two columns, one for SECMGR and one for OLS. The label was copied from SECMGR to OLS. The labels were recreated in the OLS container.
    When I connect as the table owner and query a row count; I get zero. When I connect as lbacsys and query a rowcount, I get all rows.
    Just for test purposes; I've gone into Policy manager and granted full access, profile_access, all compartments and groups and still the table owner cannot see any rows on the table. I've also disabled the policy for that table and still no rows.
    Does anyone have any idea why the table owner cannot see the data?
    Thanks in advance!

    [URGENT]
    I'm beginning to get closer to the problem; yet still no solution. To narrow down the problem I decided to create a new container/policy and a subset of the compartments, groups, and labels. (The existing container has over 500 groups).
    After creating them and applying them to a test table. I've noticed that when I set a label in the table using the char_to_label function: example
    update test_label_table
    set sec_label = char_to_label('LO:COMP1')
    where name = 'Low';
    I then queried the row as lbacsys and retrieved a different level and compartment and a group that I didn't create: results
    select name,label_to_char(sec_label)
    from test_label_table
    where name = 'Low'';
    NAME LABEL_TO_CHAR
    Low TS:REG:US
    How is this possible? What could I possibly have done wrong to get this output?
    Thanks in advance!

  • Updating FND table owner password after database import/export?

    We created a reporting instance from our production environment, and moved the EUL to a new schema through a database export/import process - not the Discoverer Administrator export/import process. The password associated with the owner of the FND tables is embedded within the EUL in production. When this was moved to a new schema in our reporting instance, this password "came with" the EUL. However, the password for the FND table owner is different in the reporting instance than it is in production. Is there any way to update this after the fact for the owner of the EUL?
    Here's what happened: EUL_OWNER1 is the owner of the Applications mode EUL in production. The copy was taken of production to create the reporting instance. At that time, EUL_OWNER2 was created in the reporting instance, and the tables and data owned by EUL_OWNER1 was exported and imported into EUL_OWNER2. The reason that we did this was to lock down security and keep people from running reports against production, hindering the performance of the overall system. The APPS password (which owns the FND tables), which was required when creating the EUL_OWNER1 EUL in production, is different in the reporting instance. When you log into Discoverer Administrator as EUL_OWNER2 and try to validate folders, you get "ORA-00942: table or view does not exist" errors for all of your tables. Basically, that user cannot view those tables because it does not have the appropriate APPS password.
    Can this be updated somehow? Or do I have to re-create the EUL for EUL_OWNER2 by using the Discoverer export/import functions? Thanks.
    Meredith

    Hi,
    I don't think the FND password is embedded in the EUL tables. What you will have lost by moving the EUL through a database export/import is all the grants that gave the EUL owner access to the FND tables and other Apps objects. These can be reapplied at the database level. However, the EUL owner does not actually need access to the tables that are mapped into the EUL as you can refresh these when you connect as an Applications user.
    Hope that helps,
    Rod West

  • Getting ORA-00903:invalid table name with both system and table owner

    Hi All,
    Oracle version 9.2
    I'm trying to retrieve some information from a few tables and import them to Excel. I haven't got much idea about ORACLE, but I'm not able to do anything.
    I open SQL PLus, and use CONNECT SYSTEM/[email protected] AS SYSDBA
    The console shows connected.
    I use select table_name,owner from dba_tables where owner='USER1';
    I can see the tables I want to access in the output.
    I do select * from USER1.TABLE1 and also tried with select * from TABLE1, both return ORA-00903:invalid table
    I also tried to connect with "CONNECT USER1/[email protected]" also shows connected, but then same error ORA-00903:invalid table
    Could anyone guide me so I can find out whats going on wrong??
    Thanks.. Best regards!

    Great! this worked! At least now I know I can read the data.
    Now I would like to get the data from this table into Excel 2007, but I can't install Office in the ORACLE server, so I have setup my client computer (Windows 2003 server with Excel 2007).
    I installed the ORACLE ODBC driver, and put the TNSName.ora file into the network admin folder.
    I successfully create the ODBC connector, and try connection is successfull. However, when I try to get the data, Excel send an error saying that it cannot list the tables!
    Anyway, any simple solution will do. If there is an easy way of making ORACLE create for example a CSV file with all the data from the table it will be good as well. What would be the easiest way?

  • RFC Lookup - Best Approach To Parse Returned Tables

    Hi Everyone,
    We are doing some RFC Lookups at a header node that are returning tables for all of the items (for performance reasons).  I am trying to figure out what the best way to extract the values from the table, which is most of time has more than 1 key column.  At the moment I am doing this through DOM, but I have also heard about using arrays, and have even seen an example of using a hashtables with all of the values concatenated together to later parse out using substrings.  I'm looking for the best approach to:
    1) Store this data as some kind of global object to lookup during the header
    2) Search and Parse from the global object during linte items.
    As an example, I have the following lines in my table:
    Key1,Key2,Value1,Value2,Value3
    A,A,1,2,3
    A,B,1,2,4
    A,C,3,4,2
    B,A,2,4,6
    And during line item processing I may want to find the value for Key1=A, Key2=C.
    Thanks
    Peter

    Hi Peter,
    Please take a look at these...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/xi%20mapping%20lookups%20rfc%20api.pdf
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    cheers,
    Prashanth
    P.S Please mark helpful answers

  • Change table'owner

    Good afternoon,
    I would like to change table's owner without moving data (alter table move or export/import) in oracle 8i
    does it exist a solution for that ?
    thanks for your help
    Fabrice

    new table will be created in DEFAULT TABLESPACE of user2 <<if you do not add a tabelspace clause. You can also specify table parameters such as pctfree and storage information if desired.
    You will have to manually add (if needed) indexes, triggers, and table level constraints using this method.
    If this process will need to re-done on a regular basis you might want to consider running the DDL once and using a truncate followed by an insert/select to repopulate the table.
    -- Mark D Powell --

  • Sql query parsing (retrieve tables and columns used in query)

    Hi,
    1. Is there any view in Oracle which can tell me, which tables and columns were used in the last ran query, no matter how complex the query is.
    2. Secondly I can get table names, used in stored procedures and views, using USER_DEPENDENCIES VIEW, however this System View does not return column names, used in that procedure / view, any idea please .
    Thanks and Regards,
    Luqman

    luqman123 wrote:
    Hi,
    1. Is there any view in Oracle which can tell me, which tables and columns were used in the last ran query, no matter how complex the query is.I don't believe so. You can look at V$SQL and retrieve the actual SQL text from there.
    2. Secondly I can get table names, used in stored procedures and views, using USER_DEPENDENCIES VIEW, however this System View does not return column names, used in that procedure / view, any idea please .Oracle added fine grained dependency tracking in 11g, but didn't expose any views to query this information. However, it has been reverse engineered a bit: About Oracle: DBA_DEPENDENCY_COLUMNS

  • How to download a file from a table not in the parsing schema

    We have a table in another schema which holds files in a blob column. I can create a form on this table and the file upload works fine. The file browse page item has the source as the blob column and storage type "BLOB column specified in Item Source attribute". The download link generated for the page shows a call to apex_util.get_blob_file and the parameters are correct. However, when you click on the link you get a Page Not Found 404 error. Same error in Apex 4.1.1. The plsql error is:
    ORA-20544: Invalid table owner
    ORA-06512: at "APEX_040000.WWV_FLOW_DML", line 1628
    ORA-06512: at "APEX_040000.HTMLDB_UTIL", line 2244
    ORA-06512: at line 31
    Is there a way to use apex_util.get_blob_file to download a file when the table is in another schema?
    Rod West

    Hi,
    I am not sure that the post explains everything as the "Automatic Row Processing" and "Automatic Row Fetch" process work fine on this page and therefore security should not be an issue.
    Thanks for the view suggestion, but I am not sure that a view is a good option for us because the parsing schema does not have create view privilege and therefore the view would be difficult to install and maintain. We will problably end up with a custom download file process.
    Rod West

  • SQL*Loader-929: Error parsing insert statement for table

    Hi,
    I get the following error with SQL*Loader:
    Table MYTABLE loaded from every logical record.
    Insert option in effect for this table: INSERT
    Column Name Position Len Term Encl Datatype
    IDE FIRST * ; CHARACTER
    SQL string for column : "mysequence.NEXTVAL"
    CSI_NBR 1:10 10 ; CHARACTER
    POLICY_NBR 11:22 12 ; CHARACTER
    CURRENCY_COD 23:25 3 ; CHARACTER
    POLICY_STAT 26:27 2 ; CHARACTER
    PRODUCT_COD 28:35 8 ; CHARACTER
    END_DAT 44:53 10 ; CHARACTER
    FISCAL_COD 83:83 1 ; CHARACTER
    TOT_VAL 92:112 21 ; CHARACTER
    SQL*Loader-929: Error parsing insert statement for table MYTABLE.
    ORA-01031: insufficient privileges
    I am positive that I can SELECT the sequence and INSERT into the table with the user invoking sql*loader.
    Where does that "ORA-01031" come from?
    Regards
    ...

    Options:
    1) you are wrong about privileges OR
    2) you have the privilege only when you connect via SQL*Plus (or whichever other tool you used to test the insert).
    Is it possible that during your test you enabled the role which granted you the INSERT privilege - and that SQL*Loader doesn't do this?
    Can you see the table in this list?
    select *
    from user_tab_privs_recd
    where table_name='MY_TABLE'
    and owner='table owner whoever';
    select *
    from user_role_privs;Any roles where DEFAULT_ROLE is not YES?
    HTH
    Regards Nigel

  • Parsing BLOB (CSV file with special characters) into table

    Hello everyone,
    In my application, user uploads a CSV file (it is stored as BLOB), which is later read and parsed into table. The parsing engine is shown bellow...
    The problem is, that it won't read national characters as Ö, Ü etc., they simply dissapear.
    Is there any CSV parser that supports national characters? Or, said in other words - is it possible to read BLOB by characters (where characters can be Ö, Ü etc.)?
    Regards,
    Adam
      |
      | helper function for csv parsing
      |
      +-----------------------------------------------*/
      FUNCTION hex_to_decimal(p_hex_str in varchar2) return number
      --this function is based on one by Connor McDonald
        --http://www.jlcomp.demon.co.uk/faq/base_convert.html
       is
        v_dec number;
        v_hex varchar2(16) := '0123456789ABCDEF';
      begin
        v_dec := 0;
        for indx in 1 .. length(p_hex_str) loop
          v_dec := v_dec * 16 + instr(v_hex, upper(substr(p_hex_str, indx, 1))) - 1;
        end loop;
        return v_dec;
      end hex_to_decimal;
      |
      | csv parsing
      |
      +-----------------------------------------------*/
      FUNCTION parse_csv_to_imp_table(in_import_id in number) RETURN boolean IS
        PRAGMA autonomous_transaction;
        v_blob_data   BLOB;
        n_blob_len    NUMBER;
        v_entity_name VARCHAR2(100);
        n_skip_rows   INTEGER;
        n_columns     INTEGER;
        n_col         INTEGER := 0;
        n_position    NUMBER;
        v_raw_chunk   RAW(10000);
        v_char        CHAR(1);
        c_chunk_len   number := 1;
        v_line        VARCHAR2(32767) := NULL;
        n_rows        number := 0;
        n_temp        number;
      BEGIN
        -- shortened
        n_blob_len := dbms_lob.getlength(v_blob_data);
        n_position := 1;
        -- Read and convert binary to char
        WHILE (n_position <= n_blob_len) LOOP
          v_raw_chunk := dbms_lob.substr(v_blob_data, c_chunk_len, n_position);
          v_char      := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
          n_temp      := ascii(v_char);
          n_position  := n_position + c_chunk_len;
          -- When a whole line is retrieved
          IF v_char = CHR(10) THEN
            n_rows := n_rows + 1;
            if n_rows > n_skip_rows then
              -- Shortened
              -- Perform some action with the line (store into table etc.)
            end if;
            -- Clear out
            v_line := NULL;
            n_col := 0;
          ELSIF v_char != chr(10) and v_char != chr(13) THEN
            v_line := v_line || v_char;
            if v_char = ';' then
              n_col := n_col+1;
            end if;
          END IF;
        END LOOP;
        COMMIT;
        return true;
      EXCEPTION
         -- some exception handling
      END;

    Uploading CSV files into LOB columns and then reading them in PL/SQL: [It&#146;s|http://forums.oracle.com/forums/thread.jspa?messageID=3454184&#3454184] Re: Reading a Blob (CSV file) and displaying the contents Re: Associative Array and Blob Number of rows in a clob doncha know.
    Anyway, it woudl help if you gave us some basic information: database version and NLS settings would seem particularly relevant here.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

Maybe you are looking for