Query to see the name of the table and the name of the column...

Hi Experts,

I have an Oracle DB, I have more than 50 tables and 100,000 records. I want to get the name of the table of the record that contains "ITxtVarValue made reference to a non-existent text" text.

Is there any simple query it to find the table name and the column name for this particular file reside?

Help, please. Any help will be rewarded.

Thank you
G

Tags: Database

Similar Questions

  • Query to see the list of tables is selected frequently

    Hi all


    Please tell me is it possible to find out the list of tables is repeated selected, (Please exclude the insert + updates + deletions truncated drop).


    Concerning

    Hi Sameer

    You can check V$ SQL_PLAN to see the objects being accessed by your SQL queries. If you have a diagnostic license, you can also consult DBA_HIST_SQL_PLAN

    select distinct object_owner, object_name from v$sql_plan;
    
    select object_name, count(*) from v$sql_plan group by object_name
    

    Remember, this is only a crude way to find this information.

    Concerning
    Vincent

  • Hi cannot see the column in the primary key as a master detail

    I have a form master detail. In the first form master, I am unable to see the primary key
    Now, the form is based was completely and I'd also like to see the visible primary key column in the main report


    If I put the primary key as rowid then I should have seen the primary key.
    Now I can see the pencil icon (the icon of pencil to the rank nedopil) instead of the actual primary key column. who's a number of data...
    I'd like to be too visible. Can we guide what should I do for this...
    Thank you

    Are not only in the hidden items? Change the settings for them to be unhidden.

  • See the column position of the cursor in the code view

    I realized this was requested in 2008...

    Is there a way to display the character column where the cursor was when in code view? And consider the size of the tabs (i.e., counts tabs as the number of characters)? I'm trying to make sure align various blocks of code in classic asp massively complex (and ugly) code...

    Thank you.

    The current version of Dreamweaver does not display the column number. However, the media don't.

    In parentheses is a free, open-source editor created by Adobe. It was announced last year that consoles will be integrated in the next major release of Dreamweaver, and that a public beta would be released sometime this year. You can either wait that the public beta version (should be pretty quickly), or you can download media immediately.

  • not able to see the column with missing values

    Hello world. For a few days, I'm not able to view column that only have missing values in excel using smartview. I checked the deleted column values are all Unflagged, as to remove the missing blocks in the smartview options.
    Maybe there's something else I have installation?

    Thank you

    After unflagging "Delete column" refreshing sheet wasn't enough. To make the active sheet active options must be closed. Options then work correctly in the new worksheet (in the same excel file).

  • Unable to see the content in the editor

    Hello

    I don't know if I've changed something to accidemt but I can't seem to understand what ive done wrong, maybe one of you guys can see my mistake now!

    When I insert an html edit in dreamweaver file, everything is accessible to a 'master' table... now I must have clicked on something that does not allow me to see all this in this table, and that's what I want to know.

    I click on the live mode view and it works as normal, but now I am unable to edit in Design view, because I don't see anything.

    Ive attached a screenshot, and the link to the page 'online' is www.lwsphotography.co.uk/portfolio_rail.html

    Any help would be appreciated!

    Thanks in advance,

    Lew

    UK

    Based on what I saw in the code view of this screenshot that some tags are not colored properly, which means that the tags are missing somewhere.  Click on file-> Validate-> markup and see what errors are returned.  That should shed some light on your problem.

  • DATE format - when you set the column in the table

    Hi friends,

    I came across a piece of code that applied a TO_DATE() function on a column of type date.

    I have two tables t1 and t2 and they have columns col1 and col2 respectively of type DATE
    t1
    col1 DATE
    
    t2
    col2 DATE
    There is also a variable var1 and is defined as follows:
    var1 DATE;
    now, I like conditions below in the code:
    AND to_date(t1.col1,'dd/mm/yyyy') = to_date(t2.col2,'dd/mm/yyyy')
    AND to_date(t1.col1,'dd/mm/yyyy') = to_date(var1,'dd/mm/yyyy')
    This code has failed on the Production with an error: ORA-01861 literal does not match the format string

    I changed the code to remove TO_DATE() and it worked fine. Dev said that they used this function for that if the two columns or variable is in the date format of diff.,... they can be brought into harmony.
    for example if col1 is dd/mm/yyyy and col2 is dd/mm/yyyy, then there will be a problem.

    My doubt is... in a given environment if we create a table and define a DATE type column, or define a variable of type DATE, their format may be different at any time? I think that no.?

    In this scenario, the date format can be different?

    Thank you

    your thoughts are correct. A date is a date, the question of how it is shown on the interface is a different matter.

  • How can I modify, move, add a column... Information for the columns to make a few changes of script?

    Hi Oracle Experts,

    I have a difficult question . Lets say that I have two table with the same name, but these two tables come from two different databases with 2 different users.

    A source database and the user SCOTT

    Table Column Data_Type Length PRECISION Scale Primary key Nullable Default Comment
    BOOKSBOOK_IDVarchar24--1---
    ISBN_10Varchar2

    13

    ---Yes--PRICENumber-62-Yes--

    Target database B and user DAVID


    Table Column Data_Type Length PRECISION Scale Primary key Nullable Default Comment
    BOOKSBOOK_IDVarchar220--1---
    PRICENumber-62-Yes--
    TITLEVarchar250---Yes--

    What I want to do:

    I want to get a query script that shows which columns need to edit, add and drop depends on the source table (make the necessary changes to make the columns in the Source table columns the same target table). No need to make any changes in the database do not want the query that must run to make these changes.

    EXAMPLE: I was using under query to get the query create table EMP. But seeing the column information to create the column even for the other user is difficult:)

    Select dbms_metadata.get_ddl ('TABLE', 'EMP') of double

    Erhan_toronto wrote:

    Is it possible to see the result like this:

    ALTER table Target_table change BOOK_ID Varchar2 (4);

    ALTER table Target_table add ISBN_10 Varchar2 (13), null;

    ALTER table drop TITLE Target_table;

    There are two simple ways to do so.

    1. use free sql Oracle development tools

    http://www.Oracle.com/technetwork/developer-tools/SQL-Developer/downloads/index.html

    Simply select 'Tools - Diff of the database' and go through the menus

    Here is an article from Oracle by Jeff Smith that shows how do

    http://www.Oracle.com/technetwork/issue-archive/2012/12-Sep/o52sqldev-1735911.html

    >

    Quickly copy, compare and synchronize databases with Oracle SQL Developer.

    >

    2 use the DBMS_METADATA_DIFF package - see the commercial doc

    http://docs.Oracle.com/CD/E11882_01/server.112/e22490/metadata_api.htm#BABIDHGE

    >

    Using the DBMS_METADATA_DIFF API to compare the metadata of the object

    >

    If you look at step 14 of this article, you will see the result of the use of COMPARE_ALTER:

    >

    14. compare the results by using the navigation API DBMS_METADATA_DIFF:

    SQL > SELECT dbms_metadata_diff.compare_alter ('TABLE', 'TAB1', 'TAB2') FROM dual;
    ALTER TABLE 'SCOTT '. "' TAB1 ' ADD ("MGR"NUMBER (4,0))
    ALTER TABLE 'SCOTT '. "' TAB1 ' DROP ("JOB")
    ALTER TABLE 'SCOTT '. "' TAB1 ' CHANGE ('ENAME' VARCHAR2 (20))
    ALTER TABLE 'SCOTT '. "' TAB1 ' ADD A KEY ('EMPNO') PRIMARY AID INDEX
    PCTFREE, INITRANS 10 2 STORAGE (INITIAL 16384 MINEXTENTS THEN 16384 1)
    MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 USER_TABLES
    (VALEUR PAR DÉFAUT) ACTIVATE ALTER TABLE "SCOTT" TAB1"AND RENAME"TAB2 ".

    1 selected line.

    >

  • How to list the columns for a view

    Dear experts

    I know how to list the columns in a table. This easy by querying the data USER_TAB_COLUMNS dictionary.

    But my problem is how to issue a query that returns the columns for a view?

    Thanks in advance

    USER_TAB_COLUMNS stores the metadata for both views.

    Select * from user_tab_columns where table_name = 'YOUR_VIEW_NAME"of order of column_id.    -Replace with your view_name (mandatory course)

    See you soon,.

    Manik.

  • Select the request match the columns diagonally

    Hello

    Here are the instructions struncture and table insert
    create table emp_trans values (empno number , emptran_no number, prev_amount number, current_amount number)
    
    insert into emp_trans values(102,109,0,20);
    insert into emp_trans values(102,119,10,20);
    insert into emp_trans values(102,129,20,30);
    insert into emp_trans values(102,139,30,0);
    
    insert into emp_trans  values(201,101,0,20);
    insert into emp_trans values(201,110,20,30);
    insert into emp_trans values(201,120,0,30);
    insert into emp_trans values(201,130,30,20);
    insert into emp_trans values(201,140,0,20);
    In the chart, we see some mappings as follows

    Data based empno.
    We have 2 employees with empno 201 and 102. Each empno has different emptrans_no. Are not necessarily in a sequence.
    We have to select the Recordset where prev_amount column matches the values in column current_amount for
    the previous record for each individual empno.

    until the next basic select statement can be considered
    select * from emp_trans  order by empno , emptran_no
    for ex:

    the column values of prev_amount of emptran_no 129 EMP No 102 with values of 20 matches with the column of current_amount have 20
    with emptran_no 119.

    empno 201 with emptran_no 110, we can see the column of prev_amount having the value put 20 mapped to havig 20 current_account column values
    of emptran_no previous 101 for the same 201 empno.

    something like we need to see the values of mathced diagonally.

    Any help on this request, most welcome.

    Kind regards

    Hello

    Sri says:
    Hello

    Here are the instructions struncture and table insert

    create table emp_trans values (empno number , emptran_no number, prev_amount number, current_amount number) ...
    

    Thanks for posting the CREATE TABLE and INSERT. Please test 9and, if necessary, correct) them before posting. You do not want the word 'values' above.

    In the chart, we see some mappings as follows

    Data based empno.
    We have 2 employees with empno 201 and 102. Each empno has different emptrans_no. Are not necessarily in a sequence.
    We have to select the Recordset where prev_amount column matches the values in column current_amount for
    the previous record for each individual empno.

    Means "the previous record? Is the line with the same empno and the next emptran_no below? The combination (empno, emptran_no) is unique?
    >

    until the next basic select statement can be considered

    select * from emp_trans  order by empno , emptran_no
    

    for ex:

    the column values of prev_amount of emptran_no 129 EMP No 102 with values of 20 matches with the column of current_amount have 20
    with emptran_no 119.

    empno 201 with emptran_no 110, we can see the column of prev_amount having the value put 20 mapped to havig 20 current_account column values
    of emptran_no previous 101 for the same 201 empno.

    something like we need to see the values of mathced diagonally.

    Any help on this request, most welcome.

    Kind regards

    Always show the desired results from the given sample data. It is fine to describe the results, but describe them after (not instead of) displaying.
    Is that what you want?

    `    EMPNO EMPTRAN_NO PREV_AMOUNT CURRENT_AMOUNT
    ---------- ---------- ----------- --------------
           102        129          20             30
           102        139          30              0
           201        110          20             30
           201        130          30             20
    

    Here's a way to get these results:

    WITH   got_prev_current_amount     AS
    (
         SELECT     empno, emptran_no, prev_amount, current_amount
         ,     LAG (current_amount) OVER ( PARTITION BY  empno
                                          ORDER BY         emptran_no
                               )        AS prev_current_amount
         FROM    emp_trans
    )
    SELECT       empno, emptran_no, prev_amount, current_amount
    FROM       got_prev_current_amount
    WHERE       prev_amount     = prev_current_amount
    ORDER BY  empno, emptran_no
    ;
    
  • Change the order of the columns does not cause any data found error report

    Hello. I have a weird problem (and I'm new to APEX). I have a subregion of report that shows the details of a master record based on the ID of the parent area. When I have everything first to change SQL for the query and apply the changes page works fine. When I go back and change the region > attributes report and use the arrows to change the order of the columns the region then returns:

    error report:
    ORA-01403: no data found

    I tried to change the query so that the columns found in the desired order and who has also not returned no data error. If I go back to my original query (which had 2 fewer columns) the page works again. Then I change to the new query (2 addtl columns), and then it works again, until I have change the order of the columns again. Don't know if it would be serious or not, but one of the columns is a 2 columns of the table concat.

    Any ideas would be appreciated, because I'm out of them.

    Thank you!

    use: Apex 4.0
    DB: 10g Exp

    "807428," Hi

    using 4.0 or 4.0.1? Can you reproduce the same problem on apex.oracle.com as well?

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • User ColumnSetContainer for the width of the columns preferences

    Hi laurentsd,

    I want to set the width of the column columnsetContainers (datagrid) at run time and save it.

    so next time when the connection of the user then user will see the columns according to the preferences of his last.

    Is this possible in webclient vSphere SDK. ?

    Thanks in advance.

    ........................

    Kind regards

    Abhishek

    Thanks for the confirmation.

  • Creating a unique index frame on a one-to-many table and search

    Hello

    I was properly put in place of the full text index on multiple columns on the same table (using the MULTI_COLUMN_DATASTORE preferences), but now I have a situation with a table of one-to-many data collection (with a CF of a lookup table), and I need to get columns through two of these tables. Code example below, several of my chatter after the code block:
    CREATE TABLE SUBMISSION
    ( SUBMISSION_ID             NUMBER(10)          NOT NULL,
      SUBMISSION_NAME           VARCHAR2(100)       NOT NULL
    );
     
    CREATE TABLE ADVISOR_TYPE
    ( ADVISOR_TYPE_ID           NUMBER(10)          NOT NULL,
      ADVISOR_TYPE_NAME         VARCHAR2(50)        NOT NULL
    );
      
    CREATE TABLE SUBMISSION_ADVISORS
    ( SUBMISSION_ADVISORS_ID    NUMBER(10)          NOT NULL,
      SUBMISSION_ID             NUMBER(10)          NOT NULL,
      ADVISOR_TYPE_ID           NUMBER(10)          NOT NULL,
      FIRST_NAME                VARCHAR(50)         NULL,
      LAST_NAME                 VARCHAR(50)         NULL,
      SUFFIX                    VARCHAR(20)         NULL
    );
    
    INSERT INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME) VALUES (1, 'Some Research Paper');
    INSERT INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME) VALUES (2, 'Thesis on 17th Century Weather Patterns');
    INSERT INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME) VALUES (3, 'Statistical Analysis on Sunny Days in March');
    
    INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (1, 'Department Chair');
    INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (2, 'Department Co-Chair');
    INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (3, 'Professor');
    INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (4, 'Associate Professor');
    INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (5, 'Scientist');
    
    INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (1,1,2,'John', 'Doe', 'PhD');
    INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (2,1,2,'Jane', 'Doe', 'PhD');
    INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (3,2,3,'Johan', 'Smith', NULL);
    INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (4,2,4,'Magnus', 'Jackson', 'MS');
    INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (5,3,5,'Williard', 'Forsberg', 'AMS');
     
    COMMIT;
    I want to be able to create a text index to group these fields:

    SUBMISSION_ADVISORS. FIRST NAME
    SUBMISSION_ADVISORS. LAST_NAME
    SUBMISSION_ADVISORS. SUFFIX
    ADVISOR_TYPE. ADVISOR_TYPE_NAME

    I looked at DETAIL_DATASTORE and USER_DATASTORE, but examples of Oracle Docs for DETAIL_DATASTORE leave me a little confused. It seems that this should be fairly simple.

    Ideally, I try to avoid creating new columns and keeping a minimum shutter adjustments. But I'm open to any suggestion. Thanks for your time and your thoughts.

    -Jamie

    I would create a procedure that creates a virtual with labels document, what is the multi_column_datatstore behind the scenes. Then I would like to use this procedure in a user_datastore, so the result is the same for several tables as a multi_column_datastore for a table. I would use auto_section_group or another type of Group of sections, so that you can search from WITHIN as with the multi_column_datastore. Please see the demo below.

    SCOTT@orcl_11gR2> -- tables and data that you provided:
    SCOTT@orcl_11gR2> CREATE TABLE SUBMISSION
      2  ( SUBMISSION_ID           NUMBER(10)          NOT NULL,
      3    SUBMISSION_NAME           VARCHAR2(100)          NOT NULL
      4  )
      5  /
    
    Table created.
    
    SCOTT@orcl_11gR2> CREATE TABLE ADVISOR_TYPE
      2  ( ADVISOR_TYPE_ID           NUMBER(10)          NOT NULL,
      3    ADVISOR_TYPE_NAME      VARCHAR2(50)          NOT NULL
      4  )
      5  /
    
    Table created.
    
    SCOTT@orcl_11gR2> CREATE TABLE SUBMISSION_ADVISORS
      2  ( SUBMISSION_ADVISORS_ID      NUMBER(10)          NOT NULL,
      3    SUBMISSION_ID           NUMBER(10)          NOT NULL,
      4    ADVISOR_TYPE_ID           NUMBER(10)          NOT NULL,
      5    FIRST_NAME           VARCHAR(50)          NULL,
      6    LAST_NAME           VARCHAR(50)          NULL,
      7    SUFFIX                VARCHAR(20)          NULL
      8  )
      9  /
    
    Table created.
    
    SCOTT@orcl_11gR2> INSERT ALL
      2  INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME)
      3    VALUES (1, 'Some Research Paper')
      4  INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME)
      5    VALUES (2, 'Thesis on 17th Century Weather Patterns')
      6  INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME)
      7    VALUES (3, 'Statistical Analysis on Sunny Days in March')
      8  SELECT * FROM DUAL
      9  /
    
    3 rows created.
    
    SCOTT@orcl_11gR2> INSERT ALL
      2  INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
      3    VALUES (1, 'Department Chair')
      4  INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
      5    VALUES (2, 'Department Co-Chair')
      6  INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
      7    VALUES (3, 'Professor')
      8  INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
      9    VALUES (4, 'Associate Professor')
     10  INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
     11    VALUES (5, 'Scientist')
     12  SELECT * FROM DUAL
     13  /
    
    5 rows created.
    
    SCOTT@orcl_11gR2> INSERT ALL
      2  INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
      3    VALUES (1,1,2,'John', 'Doe', 'PhD')
      4  INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
      5    VALUES (2,1,2,'Jane', 'Doe', 'PhD')
      6  INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
      7    VALUES (3,2,3,'Johan', 'Smith', NULL)
      8  INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
      9    VALUES (4,2,4,'Magnus', 'Jackson', 'MS')
     10  INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
     11    VALUES (5,3,5,'Williard', 'Forsberg', 'AMS')
     12  SELECT * FROM DUAL
     13  /
    
    5 rows created.
    
    SCOTT@orcl_11gR2> -- constraints presumed based on your description:
    SCOTT@orcl_11gR2> ALTER TABLE submission ADD CONSTRAINT submission_id_pk
      2    PRIMARY KEY (submission_id)
      3  /
    
    Table altered.
    
    SCOTT@orcl_11gR2> ALTER TABLE advisor_type ADD CONSTRAINT advisor_type_id_pk
      2    PRIMARY KEY (advisor_type_id)
      3  /
    
    Table altered.
    
    SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD CONSTRAINT submission_advisors_id_pk
      2    PRIMARY KEY (submission_advisors_id)
      3  /
    
    Table altered.
    
    SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD CONSTRAINT submission_id_fk
      2    FOREIGN KEY (submission_id) REFERENCES submission (submission_id)
      3  /
    
    Table altered.
    
    SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD CONSTRAINT advisor_type_id_fk
      2    FOREIGN KEY (advisor_type_id) REFERENCES advisor_type (advisor_type_id)
      3  /
    
    Table altered.
    
    SCOTT@orcl_11gR2> -- resulting data:
    SCOTT@orcl_11gR2> COLUMN submission_name FORMAT A45
    SCOTT@orcl_11gR2> COLUMN advisor      FORMAT A40
    SCOTT@orcl_11gR2> SELECT s.submission_name,
      2           a.advisor_type_name || ' ' ||
      3           sa.first_name || ' ' ||
      4           sa.last_name || ' ' ||
      5           sa.suffix AS advisor
      6  FROM   submission_advisors sa,
      7           submission s,
      8           advisor_type a
      9  WHERE  sa.advisor_type_id = a.advisor_type_id
     10  AND    sa.submission_id = s.submission_id
     11  /
    
    SUBMISSION_NAME                               ADVISOR
    --------------------------------------------- ----------------------------------------
    Some Research Paper                           Department Co-Chair John Doe PhD
    Some Research Paper                           Department Co-Chair Jane Doe PhD
    Thesis on 17th Century Weather Patterns       Professor Johan Smith
    Thesis on 17th Century Weather Patterns       Associate Professor Magnus Jackson MS
    Statistical Analysis on Sunny Days in March   Scientist Williard Forsberg AMS
    
    5 rows selected.
    
    SCOTT@orcl_11gR2> -- procedure to create virtual documents:
    SCOTT@orcl_11gR2> CREATE OR REPLACE PROCEDURE submission_advisors_proc
      2    (p_rowid IN           ROWID,
      3       p_clob     IN OUT NOCOPY CLOB)
      4  AS
      5  BEGIN
      6    FOR r1 IN
      7        (SELECT *
      8         FROM      submission_advisors
      9         WHERE  ROWID = p_rowid)
     10    LOOP
     11        IF r1.first_name IS NOT NULL THEN
     12          DBMS_LOB.WRITEAPPEND (p_clob, 12, '');
     13          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r1.first_name), r1.first_name);
     14          DBMS_LOB.WRITEAPPEND (p_clob, 13, '');
     15        END IF;
     16        IF r1.last_name IS NOT NULL THEN
     17          DBMS_LOB.WRITEAPPEND (p_clob, 11, '');
     18          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r1.last_name), r1.last_name);
     19          DBMS_LOB.WRITEAPPEND (p_clob, 12, '');
     20        END IF;
     21        IF r1.suffix IS NOT NULL THEN
     22          DBMS_LOB.WRITEAPPEND (p_clob, 8, '');
     23          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r1.suffix), r1.suffix);
     24          DBMS_LOB.WRITEAPPEND (p_clob, 9, '');
     25        END IF;
     26        FOR r2 IN
     27          (SELECT *
     28           FROM   submission
     29           WHERE  submission_id = r1.submission_id)
     30        LOOP
     31          DBMS_LOB.WRITEAPPEND (p_clob, 17, '');
     32          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r2.submission_name), r2.submission_name);
     33          DBMS_LOB.WRITEAPPEND (p_clob, 18, '');
     34        END LOOP;
     35        FOR r3 IN
     36          (SELECT *
     37           FROM   advisor_type
     38           WHERE  advisor_type_id = r1.advisor_type_id)
     39        LOOP
     40          DBMS_LOB.WRITEAPPEND (p_clob, 19, '');
     41          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r3.advisor_type_name), r3.advisor_type_name);
     42          DBMS_LOB.WRITEAPPEND (p_clob, 20, '');
     43        END LOOP;
     44    END LOOP;
     45  END submission_advisors_proc;
     46  /
    
    Procedure created.
    
    SCOTT@orcl_11gR2> SHOW ERRORS
    No errors.
    SCOTT@orcl_11gR2> -- examples of virtual documents that procedure creates:
    SCOTT@orcl_11gR2> DECLARE
      2    v_clob  CLOB := EMPTY_CLOB();
      3  BEGIN
      4    FOR r IN
      5        (SELECT ROWID rid FROM submission_advisors)
      6    LOOP
      7        DBMS_LOB.CREATETEMPORARY (v_clob, TRUE);
      8        submission_advisors_proc (r.rid, v_clob);
      9        DBMS_OUTPUT.PUT_LINE (v_clob);
     10        DBMS_LOB.FREETEMPORARY (v_clob);
     11    END LOOP;
     12  END;
     13  /
    JohnDoePhDSome
    Research PaperDepartment Co-Chair
    JaneDoePhDSome
    Research PaperDepartment Co-Chair
    JohanSmithThesis on 17th Century
    Weather PatternsProfessor
    MagnusJacksonMSThe
    sis on 17th Century Weather PatternsAssociate
    Professor
    WilliardForsbergAMS
    

    Statistical Analysis on Sunny Days in

    MarchScientist
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- user_datastore that uses procedure:
    SCOTT@orcl_11gR2> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('sa_datastore', 'USER_DATASTORE');
      3    CTX_DDL.SET_ATTRIBUTE ('sa_datastore', 'PROCEDURE', 'submission_advisors_proc');
      4  END;
      5  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- index (on optional extra column) that uses user_datastore and section group:
    SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD (any_column VARCHAR2(1))
      2  /
    
    Table altered.
    
    SCOTT@orcl_11gR2> CREATE INDEX submission_advisors_idx
      2  ON submission_advisors (any_column)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  PARAMETERS
      5    ('DATASTORE     sa_datastore
      6        SECTION GROUP     CTXSYS.AUTO_SECTION_GROUP')
      7  /
    
    Index created.
    
    SCOTT@orcl_11gR2> -- what is tokenized, indexed, and searchable:
    SCOTT@orcl_11gR2> SELECT token_text FROM dr$submission_advisors_idx$i
      2  /
    
    TOKEN_TEXT
    ----------------------------------------------------------------
    17TH
    ADVISOR_TYPE_NAME
    AMS
    ANALYSIS
    ASSOCIATE
    CENTURY
    CHAIR
    CO
    DAYS
    DEPARTMENT
    DOE
    FIRST_NAME
    FORSBERG
    JACKSON
    JANE
    JOHAN
    JOHN
    LAST_NAME
    MAGNUS
    MARCH
    PAPER
    PATTERNS
    PHD
    PROFESSOR
    RESEARCH
    SCIENTIST
    SMITH
    STATISTICAL
    SUBMISSION_NAME
    SUFFIX
    SUNNY
    THESIS
    WEATHER
    WILLIARD
    
    34 rows selected.
    
    SCOTT@orcl_11gR2> -- sample searches across all data:
    SCOTT@orcl_11gR2> VARIABLE search_string VARCHAR2(100)
    SCOTT@orcl_11gR2> EXEC :search_string := 'professor'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> SELECT s.submission_name,
      2           a.advisor_type_name || ' ' ||
      3           sa.first_name || ' ' ||
      4           sa.last_name || ' ' ||
      5           sa.suffix AS advisor
      6  FROM   submission_advisors sa,
      7           submission s,
      8           advisor_type a
      9  WHERE  CONTAINS (sa.any_column, :search_string) > 0
     10  AND    sa.advisor_type_id = a.advisor_type_id
     11  AND    sa.submission_id = s.submission_id
     12  /
    
    SUBMISSION_NAME                               ADVISOR
    --------------------------------------------- ----------------------------------------
    Thesis on 17th Century Weather Patterns       Professor Johan Smith
    Thesis on 17th Century Weather Patterns       Associate Professor Magnus Jackson MS
    
    2 rows selected.
    
    SCOTT@orcl_11gR2> EXEC :search_string := 'doe'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> /
    
    SUBMISSION_NAME                               ADVISOR
    --------------------------------------------- ----------------------------------------
    Some Research Paper                           Department Co-Chair John Doe PhD
    Some Research Paper                           Department Co-Chair Jane Doe PhD
    
    2 rows selected.
    
    SCOTT@orcl_11gR2> EXEC :search_string := 'paper'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> /
    
    SUBMISSION_NAME                               ADVISOR
    --------------------------------------------- ----------------------------------------
    Some Research Paper                           Department Co-Chair John Doe PhD
    Some Research Paper                           Department Co-Chair Jane Doe PhD
    
    2 rows selected.
    
    SCOTT@orcl_11gR2> -- sample searches within specific columns:
    SCOTT@orcl_11gR2> EXEC :search_string := 'chair'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> SELECT s.submission_name,
      2           a.advisor_type_name || ' ' ||
      3           sa.first_name || ' ' ||
      4           sa.last_name || ' ' ||
      5           sa.suffix AS advisor
      6  FROM   submission_advisors sa,
      7           submission s,
      8           advisor_type a
      9  WHERE  CONTAINS (sa.any_column, :search_string || ' WITHIN advisor_type_name') > 0
     10  AND    sa.advisor_type_id = a.advisor_type_id
     11  AND    sa.submission_id = s.submission_id
     12  /
    
    SUBMISSION_NAME                               ADVISOR
    --------------------------------------------- ----------------------------------------
    Some Research Paper                           Department Co-Chair John Doe PhD
    Some Research Paper                           Department Co-Chair Jane Doe PhD
    
    2 rows selected.
    
    SCOTT@orcl_11gR2> EXEC :search_string := 'phd'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> SELECT s.submission_name,
      2           a.advisor_type_name || ' ' ||
      3           sa.first_name || ' ' ||
      4           sa.last_name || ' ' ||
      5           sa.suffix AS advisor
      6  FROM   submission_advisors sa,
      7           submission s,
      8           advisor_type a
      9  WHERE  CONTAINS (sa.any_column, :search_string || ' WITHIN suffix') > 0
     10  AND    sa.advisor_type_id = a.advisor_type_id
     11  AND    sa.submission_id = s.submission_id
     12  /
    
    SUBMISSION_NAME                               ADVISOR
    --------------------------------------------- ----------------------------------------
    Some Research Paper                           Department Co-Chair John Doe PhD
    Some Research Paper                           Department Co-Chair Jane Doe PhD
    
    2 rows selected.
    
    SCOTT@orcl_11gR2> EXEC :search_string := 'weather'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> SELECT s.submission_name,
      2           a.advisor_type_name || ' ' ||
      3           sa.first_name || ' ' ||
      4           sa.last_name || ' ' ||
      5           sa.suffix AS advisor
      6  FROM   submission_advisors sa,
      7           submission s,
      8           advisor_type a
      9  WHERE  CONTAINS (sa.any_column, :search_string || ' WITHIN submission_name') > 0
     10  AND    sa.advisor_type_id = a.advisor_type_id
     11  AND    sa.submission_id = s.submission_id
     12  /
    
    SUBMISSION_NAME                               ADVISOR
    --------------------------------------------- ----------------------------------------
    Thesis on 17th Century Weather Patterns       Professor Johan Smith
    Thesis on 17th Century Weather Patterns       Associate Professor Magnus Jackson MS
    
    2 rows selected.
    
  • Name of the table to see the forecast in the backend SQL query

    Hello


    Forecast is released on ASIC of Dematra,

    I have the name of the table to see the forecast published in Demantra

    How to confirm that the same forecasts are published in CPSA also

    What is the name of Table to see forecasts, forecasts

    Data published in the CAWC Demantra forecasts will be stored in the following MSD_DP_SCN_ENTRIES_DENORM table

    first get the scenario_id of the msd_dp_ascp_scenarios_v of table using scenario_id check if the forecast is filled in msd_dp_scn_entries_denorm

    Published by: user11986840 on August 13, 2012 03:15

  • How to see the lock on the table and query?

    Hi all
    How do we see the lock on the table and query?


    Thank you
    Rafi

    Yes Rafi,

    It works fine at my end... see below:

    Opening of Session 1 with scott/tiger and:
    setting a day emp set ename = 'xx' where empno = 7499;

    Opening of Session 2 with scott/tiger and:
    setting a day emp set ename = 'xx' where empno = 7499;
    > This session is locked by a superior.

    Open 3 Session with pw/sys as sysdba and:

    SQL> set serveroutput on
    SQL> BEGIN
      2  dbms_output.enable(1000000);
      3  for do_loop in (select session_id, a.object_id, xidsqn, oracle_username, b.owner owner,
      4  b.object_name object_name, b.object_type object_type
      5  FROM v$locked_object a, dba_objects b
      6  WHERE xidsqn != 0
      7  and b.object_id = a.object_id)
      8  loop
      9  dbms_output.put_line('.');
     10  dbms_output.put_line('Blocking Session : '||do_loop.session_id);
     11  dbms_output.put_line('Object (Owner/Name): '||do_loop.owner||'.'||do_loop.object_name);
     12  dbms_output.put_line('Object Type : '||do_loop.object_type);
     13  for next_loop in (select sid from v$lock
     14  where id2 = do_loop.xidsqn
     15  and sid != do_loop.session_id)
     16  LOOP
     17  dbms_output.put_line('Sessions being blocked : '||next_loop.sid);
     18  end loop;
     19  end loop;
     20  END;
     21  /
    .
    Blocking Session : 139
    Object (Owner/Name): SCOTT.EMP
    Object Type : TABLE
    Sessions being blocked : 134
    
    PL/SQL procedure successfully completed.
    

    HTH
    Girish Sharma

Maybe you are looking for