SQVI - Join tables using similar fields (but not same)

Hi folks!
I would like to know if there is a way to do a join between two tables thru fields that are similar but not exactly the same. For example, I need to join tables EKKO and CDHDR, where the PO numbers do exist in both the tables (EKKO-EBELN and CDHDR-OBJECTID), but the fields are different. Is it possible to achieve such kind of a join?
Appreciate your help.
Regards,
Anwar.

>
Mohammad Anwar wrote:
though their data type is the same (CHAR).
unfortunately it is not enough... You have to select separately from the two tables and merge the data somehow in the program.

Similar Messages

  • Joining tables with "similar" field values

    I have run into a situation where I want to join two tables on a field called U_LotusBox.    In my main table the the feild can contain values like 1 or 2 or 3 or 1,2,3,4.  That's 1 comma 2 comma 3 comma 4.  My field in the second tables contains only single digit values, like 1 ,2, 3 up to 5.
    When the two fields are identical I am able to retrieve data.  But if my field in the main contains a value of 1,2,3 and my secondary table field value is 2 I get no data returned because the two fields are not identical.  
    Is it possible to have a join that is "fuzzy" meaning that if the main table field values contains the value of the secondary field value, 2 in my example would it be possible to return data?
    Any thoughts would be appreciated.

    Ralph,
    Here in high-level details is an SQL example of creating two tables (test1 and test2) with one column in each table (col_a and col_b, respectively) to show how a join on a substring of one column can be tied to a column of another table:
    create table test1 (col_a char(5))
    create table test2 (col_b char(1))
    insert into test1 values ('1')
    insert into test1 values ('1,2,3')
    insert into test2 values ('1')
    insert into test2 values ('2')
    select col_a,test2_tbl1.col_b
    from test1 inner join test2 as test2_tbl1 on col_a=test2_tbl1.col_b or
    substring(col_a,1,1)=test2_tbl1.col_b or
    substring(col_a,3,1)=test2_tbl1.col_b or
    substring(col_a,5,1)=test2_tbl1.col_b
    col_a     col_b
    ~~~~~~~|~~~~~
    1         1
    1,2,3     1
    1,2,3     2
    thanks,
    John

  • Cannot join tables used in the workbook. Join "" not found in the EUL. Atte

    Trying to migrate workbooks from one instance to other using discoverer 10.1.2.48.18 i am getting the following error
    Unable to open the worksheet requested.
    - OracleBI Discoverer was unable to find the worksheet that was requested.
    - BIB-10310 An unknown exception occurred.
    - Cannot join tables used in the workbook. Join "" not found in the EUL. Attempt to open workbook failed.
    but its fine one instance , and in prod i am getting above weird error.
    does anybody know how to rectify this.

    Note:267476.1 - for those who can't get into metalink but still need to know the answer
    Subject: Discoverer Workbook Fails With 'Cannot join tables.Item dependency "" not found in EUL' After EUL Migration, Importing Or Cloning
    Doc ID:      Note:267476.1      Type:      PROBLEM
    Last Revision Date:      28-APR-2005      Status:      PUBLISHED
    The information in this document applies to:
    Oracle Discoverer - Version: 4.1 to 10.1
    This problem can occur on any platform.
    Symptoms
    Opening a workbook migrated from one instance to another results in the following errors:
    * Unable to load EUL item ...
    * Cannot join tables. Item dependency "" not found in EUL.
    * Illegal operation... DIS4USR OR DIS5USR caused an invalid page fault in module....
    If using the workbook dump utility, you may notice:
    * Found in EUL by id *** Name has changed to .. where the new name is really the wrong column
    It seems that items are matched by internal item identifiers (IDs) and not by developer keys and names.
    Changes
    Migrating from one environment to another. For example, you may have performed a database export / import of the EUL schema from DEV to TEST
    Cause
    The timestamp is the same for both EULs, what can be confirmed by the following SQL statement:
    * Discoverer 4:
    SQL> select ver_eul_timestamp from eul4_versions;
    * Discoverer 9.0.2 , 9.0.4, 10.1 the script is:
    SQL> select ver_eul_timestamp from eul5_versions;
    If the result of the sql output is the same in both EULs, it means that timestamp of both EULs are the same. Discoverer assumes that the EUL are exactly the same (e.g. this can happedn when one of them is created with export/import of the other EUL schema using database export/import utilities) and this is the reason it tries to match items by identifiers and not by developer keys or names.
    Solution
    Change the column ver_eul_timestamp in the eul4_versions (4.1) or eul5_versions(9.0.2 - 10.1)tables to be something different in the destination EUL. The format of this column is like year:month:day:seconds:milliseconds
    Example:
    * Discoverer 4.1:
    sql> update EUL4_VERSIONS set VER_EUL_TIMESTAMP =TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS');
    sql> commit;
    * Discoverer 9.0.2:
    SQL> update EUL5_VERSIONS set VER_EUL_TIMESTAMP = TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS');
    sql> commit;
    * Discoverer 9.0.4 -10.1:
    Run the script: EUL5_id.sql as the eulowner ID
    o For 9.0.4 -- This is found on a PC with the Discoverer Administrator installed in drive:\Oracle Home\discoverer\sql
    o For 10.1.0 -- This is found on a PC with the Discoverer Administrator installed in drive:\Oracle Home\discoverer\util
    This is documented in:
    Oracle® Business Intelligence Discoverer
    Administration Guide
    10g Release 2 (10.1.2.0.0)
    Part No. B13916-02
    http://download.oracle.com/docs/pdf/B13916_02.pdf
    Chapter 4 "About copying EULs and EUL objects by exporting and importing"
    Oracle® Discoverer Administrator
    Administration Guide
    10g (9.0.4)
    Part No. B10270-01
    http://download.oracle.com/docs/pdf/B10270_01.pdf
    Chapter 3 "About copying EULs and EUL objects by exporting and importing"
    References
    Bug 3202329 - Migrating Workbooks Between Instances Shows Incorrect Column

  • I have CS5 and a d-600. I would like to use camera raw but not working. I downloaded CR 7.3 and still not working. Do I need to upgrade to CS6 ..or just throw it all out the window and get rid of my d-600 ?

    I have CS5 and a d-600. I would like to use camera raw but not working. I downloaded CR 7.3 and still not working. Do I need to upgrade to CS6 ..or just throw it all out the window and get rid of my d-600 ?

    it allows you to use your cr files, Adobe - Adobe Camera Raw and DNG Converter : For Windows
    Camera Raw: How to use Adobe DNG Converter - YouTube

  • I have a macbook air and  and hdmi that i have used many times, but not all of a sudden the tv won't recognize the hdmi. The computer flashes when it is plugged into the hdmi but the tv says "no signal" and the airplay displays option says "no device"

    I have a macbook air and  and hdmi that i have used many times, but not all of a sudden the tv won't recognize the hdmi. The computer flashes when it is plugged into the hdmi but the tv says "no signal" and the airplay displays option says "no device detected" and the drop down bar is grey and locked.

    I have a macbook air and  and hdmi that i have used many times, but not all of a sudden the tv won't recognize the hdmi. The computer flashes when it is plugged into the hdmi but the tv says "no signal" and the airplay displays option says "no device detected" and the drop down bar is grey and locked.

  • Connection ... able to connect using sql developer, but not sqlplus or toad too

    Hi folks, having this issue, with only one of my so many databases, what might be the reason and how to fix/correct this, please assist.
    Able to connect using sql developer, but not sqlplus or toad too; sqlplus error: ORA-12154: TNS:could not resolve the connect identifier specified
    thanks in advance.

    SQLDEVELOPER works since it use JDBC Thin & does not use tnsnames.ora
    ORA-12154 ALWAYS only occurs on SQL Client & no SQL*Net packets ever leave client system
    ORA-12154 [B]NEVER[/B] involves the listener, the database itself or anything on the DB Server.
    ORA-12154 occurs when client requests a connection to some DB server system using some connection string.
    TNS-03505 is thrown by tnsping & is same error as ORA-12154 thrown by sqlplus or others.
    The lookup operation fails because the name provided can [B]NOT[/B] be resolved to any remote DB.
    The analogous operation would be when you wanted to call somebody, but could not find their name in any phonebook.
    The most frequent cause for the ORA-12154  error is when the connection alias can not be found in tnsnames.ora.
    The lookup operation of the alias can be impacted by the contents of the sqlnet.ora file; specifically DOMAIN entry.
    TROUBLESHOOTING GUIDE: ORA-12154 & TNS-12154 TNS:could not resolve service name [ID 114085.1]
    http://edstevensdba.wordpress.com/2011/02/26/ora-12154tns-03505/

  • Way can't I use BBM in my swedish Iphone5?  In many country thay can use it. But not in sweden

    Way can't we in sweden use BBM as many other country can. My friend lives in Dubai and when I have a blackberry we use it. But not now when I bought a Iphone 5. You can have in for the Iphone in other countrys but not in Sweden. Way??

    For 'why' questions you need to ask Apple.

  • I will using of firefox but not working shortcut key of website.

    I will using of firefox but not working shortcut key of website.
    It's working in chrome and I.E.

    Check the connection settings.
    *Tools > Options > Advanced : Network : Connection > Settings
    *https://support.mozilla.org/kb/Options+window+-+Advanced+panel
    If you do not need to use a proxy to connect to internet then select "No Proxy" if the default "Use the system proxy settings" setting doesn't work.
    See "Firefox connection settings":
    *https://support.mozilla.org/kb/Firefox+cannot+load+websites+but+other+programs+can

  • I have a new keyboard and two of the keys are inverted when I use my Mac -- but not on the Mac at the Apple store. The @ is where the should be and visa-versa. That is, when I type the @ I get and when I type the I get @. I am in Français numérique.

    I have a new keyboard and two of the keys are inverted when I use my Mac -- but not when they put that keyboard on the Mac at the Apple Store. The @ is where the < should be and visa-versa. That is, when I type the @ I get < and when I type the < I get @. I am in Français numérique. Thanks

    Try a SMC reset, please do it 2-3 times.
    SMC RESET
    Shut down the computer.
    Unplug the computer's power cord and all peripherals.
    Press and hold the power button for 5 seconds.
    Release the power button.
    Attach the computers power cable.
    Press the power button to turn on the computer.
    PRAM RESET
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • Status are "open" in CRM but not same shown in replicated sales Doc.

    Dear Experts,
    Status are "open" in CRM but not same shown in replicated sales Doc ( R/3 ). please suggest with optimal solution.
    Regards,
    Sany

    Hi Sai,
    Thanks for your response, I am using PFAL transaction to transfer the employees from ECC to CRM. and I am using only one emplyee for execution, is there any other transactions to replicate employees.
    In ECC, after executing the PFAL transaction, getting successful transfer of IDoc message with green light.
    In CRM in WE02, it is showing yellow light for the same IDocs.
    but even with yellow light (Warning) some employees are successfully converting into BPs, but some employees are not converting.
    I could not trace the problem that, why it is happening. IDocs are reaching to CRM system, but some idocs are not converting into BP where as some IDocs are converting into BPs successfully.
    Please help me to resolve this issue.
    Your suggestions will be highly appreciated.
    Best regard
    Raghu ram

  • SQVI Join Tables

    Hello everyone,
    I'm trying to use SQVI to join table AGR_TCODES and TSTC and link TCODE.  However, (I'm guessing) that since the Long Text on TCODE in one table is different than the other, I can not create a link between the two.
    Any thoughts?
    Thanks,
    Tom

    Hi Thomas,
    I wanted to do the same thing, and like you I can't get it to work.
    Like with you the table AGR_TCDTXT isn't filled. So this is of no use.
    Then I tried using this empty table as a sort of dummy table, linking TSTCT and AGR_TCODES, using "left outer joins". The joins are accepted in SAP, but as I expected it didn't work.
    Have you found the solution yet?
    Best,

  • DROP TABLE works through SSMS but not via T-SQL Query

    Hello All,
    I am trying to drop a number of tables (1,000+) in a particular database by scripting the actions in T-SQL. When I run the query I get error 3701 on every table which points to a permissions issue. However, I am able to delete tables one by one using
    the tree-view in the SSMS Object Explorer. 
    1. I have tried starting query sessions with both the DBO of the database and the SA account to no avail. (Both had the sysadmin role when I tried.)
    2. Both the DBO account and the SA account are able to drop tables using SSMS Object Explorer.
    Do I need a specific GRANT of permissions to use T-SQL versus SSMS or am I missing something even more fundamental?
    TIA, Simon
    <code>
    DECLARE @Company VARCHAR(max), 
    @ID VARCHAR(max), 
    @NAME VARCHAR(max), 
    @TABLE_CATALOG VARCHAR(max),
    @NAV_DATABASE VARCHAR(max),
    @TABLE_NAME VARCHAR(max), 
    @STATEMENT VARCHAR(max),
    @OBJECT_NAME VARCHAR(max),
    @OBJECT_NAME_BARE VARCHAR(max),
    @OBJECT_TYPE VARCHAR(max);
    SET @TABLE_CATALOG = 'NAV_PENTA_TEST_GAAP';
    SET @NAV_DATABASE = @TABLE_CATALOG
    IF @TABLE_CATALOG <> DB_NAME() 
    BEGIN
    DECLARE @ERRORMSG VARCHAR(max);
    SET @ERRORMSG =  'You are not in the correct database. You specified ' + @TABLE_CATALOG + ' but you are currently in a session for ' + db_name();
    RAISERROR(@ERRORMSG, 18, 1);
    RETURN;
    END;
    -- To hold the object names (tables) from Navision
    CREATE TABLE #NavisionObjects
    [CompanyName]
    VARCHAR(max),
    [ID] VARCHAR(max),
    [Name]
    VARCHAR(max),
    [TABLE_NAME]
    VARCHAR(max)
    -- To hold the object names (tables) from SQL only
    CREATE TABLE #NavisionSQLObjects
    [TABLE_NAME]
    VARCHAR(max)
    -- Holds the list of dependent objects
    CREATE TABLE #DependentObjects
    [name] VARCHAR(max),
    [type] VARCHAR(max)   
    WITH T AS (
    SELECT [Company Name],[ID],[Name],[Company Name]+'$'+[Name] AS TABLE_NAME 
    FROM [Object]   
    WHERE [Name] like '%IT IS%' AND [Company Name]>''
    UNION ALL
    SELECT [Company Name],[ID],[Name],[Name] AS TABLE_NAME 
    FROM [Object]   
    WHERE [Name] like '%IT IS%' AND [Company Name] IN ('',' ')
    INSERT INTO #NavisionObjects SELECT [Company Name],[ID],[Name],[TABLE_NAME] FROM T;
    UPDATE #NavisionObjects SET TABLE_NAME = TABLE_NAME+ID WHERE ID LIKE '1%';
    INSERT INTO #NavisionSQLObjects 
    SELECT TABLE_NAME from INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_CATALOG = @TABLE_CATALOG AND TABLE_NAME LIKE '%IT IS%' AND TABLE_TYPE='BASE TABLE';
    --SELECT * FROM #NavisionObjects where CompanyName like 'E15%' order by TABLE_NAME;
    --SELECT * FROM #NavisionSQLObjects where TABLE_NAME like 'E15%' order by TABLE_NAME;
    DECLARE cTables CURSOR FOR SELECT A.CompanyName,A.ID,A.[TABLE_NAME] FROM #NavisionObjects A
    INNER JOIN #NavisionObjects B ON B.[TABLE_NAME]=A.[TABLE_NAME]
    OPEN cTables;
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
    PRINT 'Storing dependencies for [' + @TABLE_NAME + ']';
    BEGIN TRY
    INSERT INTO #DependentObjects 
    EXEC sp_depends @TABLE_NAME;
    END TRY
    BEGIN CATCH
    PRINT 'Could not get dependencies for table [' + @TABLE_NAME + ']';
    END CATCH
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    END
    CLOSE cTables;
    Drop dependent objects first so that table drops are less likely to fail. 
    DECLARE cdo CURSOR FOR SELECT [Name],[Type] FROM #DependentObjects;
    OPEN cdo;
    FETCH NEXT FROM cdo INTO @OBJECT_NAME, @OBJECT_TYPE;
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
    BEGIN TRY
    SET @OBJECT_NAME_BARE = 
    CASE 
    WHEN CHARINDEX('dbo',@OBJECT_NAME) = 1
    THEN RIGHT(@OBJECT_NAME,LEN(@OBJECT_NAME)-4)
    ELSE @OBJECT_NAME
    END;
    SET @STATEMENT = 'DROP ' + @OBJECT_TYPE + ' [' + @OBJECT_NAME_BARE + ']';
    PRINT @STATEMENT;
    EXEC sys.sp_sqlexec @STATEMENT;
    END TRY
    BEGIN CATCH
    PRINT 'Could not DROP object [' + @OBJECT_NAME + '] of type ' + @OBJECT_TYPE + ', SQL Error ' + CAST(@@ERROR AS VARCHAR(max));
    END CATCH
    FETCH NEXT FROM cdo INTO @OBJECT_NAME, @OBJECT_TYPE;
    END
    CLOSE cdo;
    DEALLOCATE cdo;
    OPEN cTables;
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
    PRINT 'Removing [' + @TABLE_NAME + ']' ;
    BEGIN TRY
    SET @STATEMENT = 'TRUNCATE TABLE dbo.[' + @TABLE_NAME + ']';
    PRINT @STATEMENT;
    EXEC sys.sp_sqlexec @STATEMENT;
    END TRY
    BEGIN CATCH
    PRINT 'Could not truncate table [' + @TABLE_NAME + ']';
    END CATCH
    BEGIN TRY
    SET @STATEMENT = 'DROP TABLE dbo.[' + @TABLE_NAME + ']';
    PRINT @STATEMENT;
    EXEC sys.sp_sqlexec @STATEMENT;
    BEGIN TRY
    SET @STATEMENT = 'DELETE FROM [Object] WHERE [Company Name] = ' + CHAR(39) + @Company + CHAR(39) + ' AND [ID] = ' + CHAR(39) + @ID + CHAR(39) + ' AND [TABLE_NAME] = ' + CHAR(39) +
    @TABLE_NAME + CHAR(39) ;
    EXEC sys.sp_sqlexec @STATEMENT;
    print @STATEMENT;
    END TRY
    BEGIN CATCH
    PRINT 'Could not Delete Object [' + @TABLE_NAME + '], from Object table, SQL Error ' + CAST(@@ERROR AS VARCHAR(max));
    END CATCH
    END TRY
    BEGIN CATCH
    PRINT 'Could not DROP table [' + @TABLE_NAME + '], SQL Error ' + CAST(@@ERROR AS VARCHAR(max));
    END CATCH
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    END
    CLOSE cTables;
    DEALLOCATE cTables;
    DROP TABLE #DependentObjects;
    DROP TABLE #NavisionObjects;
    DROP Table #NavisionSQLObjects;
    </code>

    3701 = ...does not exist or you don't have permission.
    Most of the time it means the former. So there are probably some problems in your DROP TABLE statements. Since there is a whole lot about Navision in the script, I decline from trying to figure out what. But I encourage you to study the PRINT statements.
    I think that it would be a good idea to include the schema name, in cases these tables are not in dbo after all.
    Note: rather than writing:
       SET @STATEMENT = 'DROP ' + @OBJECT_TYPE + ' [' + @OBJECT_NAME_BARE + ']';
    write:
       SET @STATEMENT = 'DROP ' + @OBJECT_TYPE + quotename(@OBJECT_NAME_BARE)
    Somewhat briefer. And it works also when the object name includes a right bracket.
    sp_sqlexec is undocumented, use sp_executesql instead.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Mandatory for Visable field but not for hidden field

    Hi All,
    I have a couple of radio buttons (Yes and No) when the user selects Yes they are then prompted for the date this happend.
    How can i make the Date field mandatory if they select yes but not if they select no. I have tried making the date field mandatory but it throughs the obvious error if it is hidden.

    Hi George, thanks for your reply.
    The way i hide and show the date box at the moment is by using the Show/Hide field action under the properties of the radio buttons.
    Thx

  • SQVI - Join Table Graphical display

    Hello,
    In SQVI, when I enter to change the join table, the screen enter into "Classical Table Join Definition".
    How I can switch to "Graphical Table Join Definition"??
    In SQ02 it is on the setting menu, but I didn't found how to do it in SQVI.
    Could you help?
    Thanks
    BR
    Nazim

    Hai Nazmin,
    In SQVI click the Basis Mode icon in the left top
    Now it will show
    Layout Mode
    and in the right side
    Export as : select the Graphics
    and execute
    Regards,
    Mani

  • Bad exec plan when joining tables using primary keys together w/ Contains

    Hello all...this is something that confuzzles me....
    When joining 2 tables, the exec plan shows that the domain index is first accessed, before checking if there is a record in the other table using a highly selective index.
    create table users
    (userid varchar2(20),
    name varchar2(100),
    resume clob
    create table seeker
    (seekerid varchar2(20),
    userid varchar2(20),
    jobid varchar2(20)
    create index user_idx on users(userid)
    create index job_resume_index on users(resume)
    indextype is ctxsys.context
    create unique index seeker_unik on seeker(seekerid)
    create index seeker_index on seeker(jobid,userid)
    then sample records where inserted, then the text index was sync'ed.
    Query and Execution Plan:
    select u.userid, u.name
    from users u, seeker s
    where s.jobid = 'HJOBP000000000218627'
    and u.userid = s.userid
    and contains(resume,'texas') > 1
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=1 Bytes=72)
    1 0 NESTED LOOPS (Cost=3 Card=1 Bytes=72)
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'USERS' (Cost=2 Card=1
    Bytes=30)
    3 2 DOMAIN INDEX OF 'JOB_RESUME_INDEX' (Cost=0)
    4 1 INDEX (RANGE SCAN) OF 'SEEKER_INDEX' (NON-UNIQUE) (Cost=
    1 Card=1 Bytes=42)
    The problem with execution plan is if the domain index returns huge number of records i.e. 40k rows, then it has to check each userid with the SEEKER table, and returns only 10 rows. I can add a hint to specify the use of the user_idx instead of the domain index to improve performance.
    My question is how does the database determine when to use the domain index or to use other highly selective index with out the aid of a HINT. The trace file shows the use of "CTXSYS"."TEXTOPTSTATS".ODCIStatsIndexCost and "CTXSYS"."TEXTOPTSTATS".ODCIStatsFunctionCost. Are these used to compute and compare the cost of each index and decide on what index to used? If so, why does it return a lower cost for domain index when the btree index is more efficient? I have all statistics gathered for all tables and indexes (inc dr$ tables and its indexes)
    Thanks,
    jojo

    Hi,
    What I'm pasting here is actually from Ch9 of Expert PL/SQL. It shows what happens during a select with CONTAINS. It does not include a join with another table, or an additional column in the where clause. Hope it helps.
    ================================================
    By default, the Extensible Query Optimizer is enabled. When enabled, the Extensible Query Optimizer can determine the I/O and CPU cost associated with the CONTAINS predicate, find the cost of each call to the CONTAINS() function, and determine the selectivity of the CONTAINS predicate.
    To see this in action I ran the basic select earlier. Examining the SQL trace shows the steps.
    Step 1 - Determine the I/O and CPU cost of the CONTAINS() function:
    --Available online as part of contains_trace.doc
    "CTXSYS"."TEXTOPTSTATS".ODCIStatsFunctionCost(
    sys.ODCIFuncInfo('CTXSYS',
    'CTX_CONTAINS',
    'TEXTCONTAINS',
    2),
    cost,
    sys.ODCIARGDESCLIST(
    sys.ODCIARGDESC(
    2, 'DOCUMENT_REPOSITORY', 'PLSQL',
    '"DOCUMENT"', NULL, NULL, NULL),
    sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL)),
    NULL,
    'constitution',
    sys.ODCIENV(0,0,0,1));
    Step 2 – Determine the selectivity of the CONTAINS predicate
    -- Available online as part of contains_trace.doc
    "CTXSYS"."TEXTOPTSTATS".ODCIStatsSelectivity(
    sys.ODCIPREDINFO('CTXSYS',
    'CTX_CONTAINS',
    'TEXTCONTAINS',
    32),
    sel,
    sys.ODCIARGDESCLIST(
    sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL),
    sys.ODCIARGDESC(5, NULL, NULL, NULL, NULL, NULL, NULL),
    sys.ODCIARGDESC(2, 'DOCUMENT_REPOSITORY', 'PLSQL',
    "DOCUMENT"', NULL, NULL, NULL),
    sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL)),
    0,
    NULL,
    NULL,
    'constitution',
    sys.ODCIENV(0,0,0,1));
    Step 3: Determine the I/O and CPU cost of the CONTAINS predicate
    -- Available online as part of contains_trace.doc
    "CTXSYS"."TEXTOPTSTATS".ODCIStatsIndexCost(
    sys.ODCIINDEXINFO('PLSQL',
    'EXPERT_IDX',
    sys.ODCICOLINFOLIST(
    sys.ODCICOLINFO('PLSQL', 'DOCUMENT_REPOSITORY',
    '"DOCUMENT"', 'BFILE', NULL, NULL)),
    NULL,
    0,
    0),
    50.00000000,
    cost,
    sys.ODCIQUERYINFO(
    2,
    sys.ODCIOBJECTLIST(sys.ODCIOBJECT('SCORE', 'CTXSYS'))),
    sys.ODCIPREDINFO('CTXSYS', 'CONTAINS', NULL, 0),
    sys.ODCIARGDESCLIST(
    sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL),
    sys.ODCIARGDESC(5, NULL, NULL, NULL, NULL, NULL, NULL),
    sys.ODCIARGDESC(2, 'DOCUMENT_REPOSITORY', 'PLSQL',
    '"DOCUMENT"', NULL, NULL, NULL),
    sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL)),
    1,
    NULL,
    'constitution',
    sys.ODCIENV(0,0,0,1));
    Note: The 50.00000000 in this last call is the selectivity retrieved from step 2.
    Only after these three steps complete does the query actually get executed:
    -- Available online as part of contains_trace.doc
    SELECT score(1), title
    FROM document_repository
    WHERE CONTAINS(document, 'constitution', 1) > 0
    ORDER BY 1 DESC;
    This is not the end of the processing though. To retrieve the records, the $I table (the index data table) is queried as follows:
    -- Available online as part of contains_trace.doc
    SELECT /*+ INDEX(i) */ TOKEN_FIRST,TOKEN_LAST,TOKEN_COUNT,ROWID
    FROM "PLSQL"."DR$EXPERT_IDX$I" i
    WHERE TOKEN_TEXT = 'CONSTITUTION'
    AND TOKEN_TYPE = 0
    ORDER BY TOKEN_TEXT, TOKEN_TYPE, TOKEN_FIRST;
    Note: The search term is UPPERCASE when querying against the DR$EXPERT_IDX$I table because all of the tokens are stored in uppercase by default. The original SELECT was in lowercase. This automatic conversion to uppercase allows the Text index to provide case-insensitive searching.
    This query returns the following result:
    TOKEN_FIRST TOKEN_LAST TOKEN_COUNT ROWID
    1 2 2 AAAN54AAEAAAOvEAAo
    Finally, the $R table (the rowid table) is queried.
    -- Available online as part of contains_trace.doc
    SELECT data
    FROM "PLSQL"."DR$EXPERT_IDX$R"
    WHERE row_no = 0;
    Only now do I see the results of my query:
    SCORE(1) TITLE
    55 United States Constitution
    8 Bill of Rights
    Keep in mind that modifications to the query, such as the addition of other columns in the where clause or the addition of operators, will result in a different trace.
    ===============================

Maybe you are looking for

  • ICal to do list due date shows only day and year

    Trying to set up a few to do items for the future, I checked the "due date" box and it's showing today's date as 22/2013 as oppose to "01/22/2013". While I can change the "22" to a future day, I don't have the option to modify the month because it's

  • I need help on my macbook pro 13 2011

    i have theme problem when install a theme and i just don't like it after uninstalling it i have found out my menu bar show some purple yellow and transparent colour i've trying to get help and also when i right click the menu highlight is defferent f

  • BitmapData, get/setPixel on scaled data. Real get/setPixel exist?

    Ok... I've been staring at this all day long, so the answer might be screaming at me and I just don't see it.... Summary:  I need an Image to "show through" to the background, cutting through any other images that may be in it's way -- but not images

  • Just updated my 3gs with the new iOS5 software and my music is not on the phone

    I just updated my 3gs to the new iOS5, and my ipod library is gone. No music, or videos! What should i do to get them back? Tried syncing the music hoping it would work, and it did not. Any tips?

  • Customer Credit Balance

    Hello all, Does anyone know what the best way is to send a customer with a credit balance a dunning statement/account statement/letter to inform them of unclaimed assets.(escheatment)