Wildcard search with catsearch on Oracle 10g

Wildcard search problem is being discussed many times, however the solutions provided did not solve the problem.
I am using catsearch to take its advantages and return results at a faster rate. Aim is to simulate a like '%abc%' using catsearch in 10g.
Following are the steps to reproduce the problem.
CREATE TABLE test
   (name VARCHAR2(60))
INSERT ALL
INTO test VALUES ('VCL Master')
  INTO test VALUES ('VCL Master S.')
  INTO test VALUES ('VCL Master S.A. Compartment 1')
  INTO test VALUES ('VCL MasterS.A. Compartment 2')
  INTO test VALUES ('VCL Master., S.A.')
  INTO test VALUES ('KCL Master Corp.')
  SELECT * FROM DUAL
begin
ctx_ddl.create_preference('Jylex', 'basic_lexer');
ctx_ddl.set_attribute('Jylex','SKIPJOINS','.-=[];\,/~!@#$%^&*+{}:"|<>?`§´¨½¼¾¤£€©®''');
end;
begin
    Ctx_Ddl.Create_Preference('wildcard_Jylex', 'BASIC_WORDLIST');
    ctx_ddl.set_attribute('wildcard_Jylex', 'wildcard_maxterms', 15000) ;
end;
CREATE INDEX test_inx ON test(NAME)
INDEXTYPE IS CTXSYS.CTXCAT
PARAMETERS('STOPLIST CTXSYS.EMPTY_STOPLIST
LEXER     Jylex
WORDLIST wildcard_Jylex')
problem1:
select * from test where catsearch(name, 'CL Mast*', NULL)>0 --- no results returned
problem 2:
when I run the following query on the actual column of my table with 3 million records,
select * from XXXX where catsearch (NAME, 'VCL Master S*', NULL) > 0
I get the following error.
DRG-51030: wildcard query expansion resulted in too many terms
I have used () and "". Did a lot of R&D and still I am not able to a solution that resolves both of the problems.
Suggestions will be much appreciated.
Thanks.

This post has nothing to do with Oracle Objects.  Perhaps some moderator will move it to the Oracle Text sub-forum/space, where it belongs.
Your search for 'CL Mast*' did not find any rows because there aren't any rows that match that criteria.  If you want to return rows that have that string, then you need to add a leading wildcard.  Technically CTXCAT indexes and CATSEARCH do not support leading wildcards, but you can use two asterisks as a workaround, so you can search for '**CL Mast*'.
Your wildcard_maxterms is set to 15000, so if there are more than 15000 words that begin with 's' in your 3 million records, then it will result in an error.  If you upgrade to Oracle 11g, then you can set the wildcard_maxterms higher or to unlimited by setting it to 0, but that may cause your system to run out of memory.  Most applications trap these errors and return a simple message to the user, indicating that the search for s* is too broad and to narrow the search.
I would use a CONTEXT index with CONTAINS instead of CTXCAT and CATSEARCH.  It supports leading wildcards and you can index substrings for faster searches.  If you want it to be like the CTXCAT index then you can make it transactional.

Similar Messages

  • Installing Discoverer with Database Version Oracle 10g Express Edition

    Hello,
    Is it possilbe to install Discoverer with database version Oracle 10g Express Edition? I have Oracle Fusion Middleware 11.1.1.1.0 on my Windows XP machine as well. If so, can someone please provide me a link to the Discoverer download.
    Regards,
    Kelly

    Note that the Personal Edition of the database is 'the most powerful' version, in that it contains all features and options of the Enterprise Edition (expect RAC and Enterprise Manager packs)
    As such, the Personal Edition, at a mere USD$400-500 is one of the most cost effective for-fee products that Oracle has in it's inventory. It is targeted at the developer. And it comes with the complete set of Sample Data, whereas XE has a very limited subset (since it does not support all functionality).
    Express Edition is indeed free, but it is not supported, and can not be patched. OTOH it does have a lighter footprint.
    Again, I am not sure whether Disco 11g is compatible with Express Edition. (It's on my schedule for December ...)

  • How can I send e-mail with attachment from oracle 10g?

    How can I send email with attachment from oracle 10g?

    hi you can achieve the same thing from database tier of unix.

  • Occi GetString causing a exception with ntdll.dll oracle 10g and MS 2005

    hi,
    I am getting an exception with using Visual Studio 2005(VC++8) and occi.h 10g client.
    When I run the release version I get an exception in ntdll.dll.
    The problem is in the getString(). The field in the oracle table is defined as a varchar2(300).
    I am new to oracle occi and need a solution because we cannot migrate to another version of the database.
    These are the solutions I have tried:
    download patches for MS Visual studio
    download patched for oracle 10g client
    Check that the charset it correct for std:string
    I see that others have had the same problem but no one has a solution. If anyone has a solution please email me because I have searched for days!
    Thanks
    Sheryl

    Aloha
    Thank you for your response, I am new to posting, occi and C++. Can I send you the files.
    Sorry didnt read this reply until today.
    The email is [email protected].
    This environment:
    1> windows xp
    2> MS Studio 5 VC++8
    3> OCCI 10.2.0.3.0 (patch 13)libraries for Microsoft Visual C++ 8
    4> I am using the Instant Client
    5> I am using /MD Multithreaded DLL
    6> Charset is oracle::occi::Environment::createEnvironment ("US7ASCII","AL16UTF16",Environment::DEFAULT);
    7> We running the application in release mode and getting this error with a bad memory reference on getString().
    I am getting a memory reference error on the getString(4).
    This is the code that is causing the error
    try
              string istmt ="SELECT FILE_ID,FILES.FTYP_ID,LTRIM(RTRIM(FILEPATH)),LTRIM(RTRIM(FILENAME)),TITLE FROM FILES,FILE_TYPES WHERE FILE_TYPES.EXTN = 'img'AND file_types.ftyp_id = files.ftyp_id AND FILES.HDR_SCAN_DATE IS NULL ORDER BY FILEPATH, FILENAME ";
              ResultSet * set = db->select(istmt);
              if (set == NULL)
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"No file to process occured in : %s ", methodName.c_str());
                   return;
              LogT::Get()->log(Logger::LOG_LEVEL_INFO,"Did select in : %s ", methodName.c_str());     
              while (set->next())
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"Doing a set next in : %s ", methodName.c_str());
                   if (set->isNull(1) || set->isNull(2) || set->isNull(4) || set->isNull(3))
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"a value is null continue in : %s ", methodName.c_str());
                        continue;
                   try {
                        LogT::Get()->log(Logger::LOG_LEVEL_INFO,"About to get string 3 in : %s ", methodName.c_str());
                        std::string test(set->getString(3));
                        fname.assign(test);
                        LogT::Get()->log(Logger::LOG_LEVEL_INFO,"File name: %s in : %s ",fname.c_str(), methodName.c_str());
                   } catch (exception ex9) {     
                        LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Exception in get string msg: occured in : %s ",ex9.what(), methodName.c_str());
                        continue;
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"getting int 1 in : %s ", methodName.c_str());
                   fid = set->getInt(1);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"getting string 4 in : %s ", methodName.c_str());
                   fn.assign(set->getString(4));
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"after getting string 4 in : %s ", methodName.c_str());
                   //dont append a slash if not need
                   size_t pos = fname.find_last_of("\\");
                   if(pos != fname.length()-1)
                        fname.append("\\");
                   fname.append(fn);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"adding %s to map in : %s ",fname.c_str(), methodName.c_str());
                   fnames.insert (std::pair<unsigned int,std::string>(fid,fname));
    //               int ftype = set->getInt(2);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"got fid:%d, fname:%s fn: %s to map in : %s ",fid,fname.c_str(),fn.c_str(), methodName.c_str());
         catch (SQLException ex)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Sql Exception code: %d message: %s occured in : %s ",ex.getErrorCode(),ex.getMessage().c_str(), methodName.c_str());
              db->exceptionHandler("SELECT PARAMS",ex.getErrorCode(),ex.getMessage());
              throw;
         catch (exception ex3)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Exception occured message: %sin : %s ", ex3.what(),methodName.c_str());
              db->exceptionHandler("SELECT PARAMS",1,ex3.what());
              throw;
         catch (...) {
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Error occured in : %s ", methodName.c_str());
    This is the code for the select in occi
    /* Select statement for oracle occi*/
    void * OraDb::select(std::string& sqlStr,std::map<std::string,VALUES,classcomp> & val) {
         string methodName = "OraDb::select";
         ResultSet *selectRset;
         try {
              this->stmt->setSQL(sqlStr);
              this->bind(val);
              selectRset = this->stmt->executeQuery ();
              oracle::occi::Statement::Status res = this->stmt->status();
              while(res != oracle::occi::Statement::RESULT_SET_AVAILABLE) {
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"the results set isnt ready");
                   res = this->stmt->status();
         catch (SQLException ex)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Sql Error in %s code: %d Message:%s",methodName.c_str(),ex.getErrorCode(),ex.getMessage().c_str());
              //Add error to error log                          
              this->exceptionHandler(methodName,ex.getErrorCode(),ex.getMessage());
              throw;
         catch (exception ex3)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Error in %s Message:%s",methodName.c_str(),ex3.what());
              this->exceptionHandler(methodName,1,ex3.what());
              //Add error to errorlog
              throw;
    return selectRset;
    This is the logs I get
    ParamsTb::selectImgParams
    in method OraDb::select this is the statement:SELECT FILE_ID,FILES.FTYP_ID,LTRIM(RTRIM(FILEPATH)),LTRIM(RTRIM(FILENAME)),TITLE FROM FILES,FILE_TYPES WHERE FILE_TYPES.EXTN = 'img'AND file_types.ftyp_id = files.ftyp_id AND FILES.HDR_SCAN_DATE IS NULL
    Did select in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\\foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    got fid:4766408, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\\foeHeaderAirplane.img fn: foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\\foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    got fid:4778728, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\\foeHeaderAirplane.img fn: foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\\netwlan5.img to map in : FilesTb::selectImgFiles
    got fid:4873869, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\\netwlan5.img fn: netwlan5.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\rwolfshagen\c\Resp-C4\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    I dumped a few things from last night’s Dr. Watson run, shown below, which may help:
    manifest.txt
    Server=watson.microsoft.com
    UI LCID=1033
    Flags=1672016
    Brand=WINDOWS
    TitleName=ImgHeaderLoader.exe
    DigPidRegPath=HKLM\Software\Microsoft\Windows NT\CurrentVersion\DigitalProductId
    ErrorText=This error occurred on 6/25/2009 at 1:47:02 AM.
    HeaderText=ImgHeaderLoader.exe encountered a problem and needed to close.
    Stage1URL=/StageOne/ImgHeaderLoader_exe/0_0_0_0/ntdll_dll/5_2_3790_4455/0002b67d.htm
    Stage2URL=/dw/stagetwo.asp?szAppName=ImgHeaderLoader.exe&szAppVer=0.0.0.0&szModName=ntdll.dll&szModVer=5.2.3790.4455&offset=0002b67d
    DataFiles=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\ImgHeaderLoader.exe.mdmp|C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\appcompat.txt
    Heap=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\ImgHeaderLoader.exe.hdmp
    ErrorSubPath=ImgHeaderLoader.exe\0.0.0.0\ntdll.dll\5.2.3790.4455\0002b67d
    DirectoryDelete=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00
    appcompat.txt
    <?xml version="1.0" encoding="UTF-16"?>
    <DATABASE>
    <EXE NAME="ImgHeaderLoader.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="common.dll" SIZE="6656" CHECKSUM="0xA0D33EDD" MODULE_TYPE="WIN32" PE_CHECKSUM="0x8ADC" LINKER_VERSION="0x0" LINK_DATE="06/25/2009 00:44:47" UPTO_LINK_DATE="06/25/2009 00:44:47" />
    <MATCHING_FILE NAME="FileLoader.exe" SIZE="65536" CHECKSUM="0x15C68C49" MODULE_TYPE="WIN32" PE_CHECKSUM="0x16CC5" LINKER_VERSION="0x0" LINK_DATE="06/23/2009 02:29:33" UPTO_LINK_DATE="06/23/2009 02:29:33" />
    <MATCHING_FILE NAME="FileLoaderOriginal.exe" SIZE="65536" CHECKSUM="0x6672AE23" MODULE_TYPE="WIN32" PE_CHECKSUM="0x17E45" LINKER_VERSION="0x0" LINK_DATE="06/20/2009 03:34:40" UPTO_LINK_DATE="06/20/2009 03:34:40" />
    <MATCHING_FILE NAME="ImgHeaderLoader.exe" SIZE="118784" CHECKSUM="0xBA94D6AE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x20F4B" LINKER_VERSION="0x0" LINK_DATE="06/24/2009 22:42:49" UPTO_LINK_DATE="06/24/2009 22:42:49" />
    <MATCHING_FILE NAME="x.exe" SIZE="65536" CHECKSUM="0x66982AE3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x103FD" LINKER_VERSION="0x0" LINK_DATE="06/18/2009 23:55:27" UPTO_LINK_DATE="06/18/2009 23:55:27" />
    </EXE>
    <EXE NAME="ntdll.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="ntdll.dll" SIZE="774144" CHECKSUM="0x74ACB78F" BIN_FILE_VERSION="5.2.3790.4455" BIN_PRODUCT_VERSION="5.2.3790.4455" PRODUCT_VERSION="5.2.3790.4455" FILE_DESCRIPTION="NT Layer DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.2.3790.4455 (srv03_sp2_gdr.090203-1205)" ORIGINAL_FILENAME="ntdll.dll" INTERNAL_NAME="ntdll.dll" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xC2B9D" LINKER_VERSION="0x50002" UPTO_BIN_FILE_VERSION="5.2.3790.4455" UPTO_BIN_PRODUCT_VERSION="5.2.3790.4455" LINK_DATE="02/09/2009 11:02:56" UPTO_LINK_DATE="02/09/2009 11:02:56" VER_LANGUAGE="English (United States) [0x409]" />
    </EXE>
    <EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="1038336" CHECKSUM="0x7EFD9E0D" BIN_FILE_VERSION="5.2.3790.4480" BIN_PRODUCT_VERSION="5.2.3790.4480" PRODUCT_VERSION="5.2.3790.4480" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.2.3790.4480 (srv03_sp2_gdr.090321-1244)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x101B44" LINKER_VERSION="0x50002" UPTO_BIN_FILE_VERSION="5.2.3790.4480" UPTO_BIN_PRODUCT_VERSION="5.2.3790.4480" LINK_DATE="03/21/2009 17:08:26" UPTO_LINK_DATE="03/21/2009 17:08:26" VER_LANGUAGE="English (United States) [0x409]" />
    </EXE>
    </DATABASE>
    THANKS!!!!!

  • Requesting help with pivot in Oracle 10g

    Hey all,
    I have this table, let's call it table GRID that has the following columns:
    OBJECT_KEY             DATE_KEY               SEGMENT_ID             COLUMN_NAME COMMITTEDVIRTUALMEMORYSIZE_AVG
    619                    3371                   1                      M1100       593589862.4                   
    619                    3371                   1                      M1105       593611434.67                  
    620                    3371                   1                      M1100       592354508.8                   
    620                    3371                   1                      M1105       592376263.11                  
    621                    3371                   1                      M1100       731433369.6                   
    621                    3371                   1                      M1105       731455943.11What would it take to pivot the column names ('M1100', 'M1105') with the metric value volumn: 'COMMITTEDVIRTUALMEMORYSIZE_AVG' so much that this query would result in an output like this:
    OBJECT_KEY             DATE_KEY               SEGMENT_ID             M1100          M1105
    619                    3371                   1                      593589862.4     593611434.67                          
    620                    3371                   1                      592354508.8     592376263.11                          
    621                    3371                   1                      731433369.6     731455943.11Any help would be much appreciated!
    Again, Oracle 10g, not 11g so I don't have the PIVOT function to work with.
    Regards,
    TimS

    Hi,
    Search for Pivot:, or see the example below, for how to do a basic pivot. (This was called "pivot" long before Oracle 11.)
    The example below uses COUNT as the aggregate function; you'll probably wnat SUM instead.
    If you don't know how many pivoted columns there will be (two, in the example you posted), or what their unique values are ('M1100' and 'M1105') ahead of time, then you will need dynamic SQL. As dynamic SQL goes, this is pretty easy; you can do it in either SQL*Plus or PL/SQL.
    --     How to Pivot a Result Set (Display Rows as Columns)
    --     For Oracle 10, and earlier
    --     Actually, this works in any version of Oracle, but the
    --     "SELECT ... PIVOT" feature introduced in Oracle 11
    --     is better.  (See Query 2, below.)
    --     This example uses the scott.emp table.
    --     Given a query that produces three rows for every department,
    --     how can we show the same data in a query that has one row
    --     per department, and three separate columns?
    --     For example, the query below counts the number of employess
    --     in each departent that have one of three given jobs:
    PROMPT     ==========  0. Simple COUNT ... GROUP BY  ==========
    SELECT     deptno
    ,     job
    ,     COUNT (*)     AS cnt
    FROM     scott.emp
    WHERE     job     IN ('ANALYST', 'CLERK', 'MANAGER')
    GROUP BY     deptno
    ,          job;
    Output:
        DEPTNO JOB              CNT
            20 CLERK              2
            20 MANAGER            1
            30 CLERK              1
            30 MANAGER            1
            10 CLERK              1
            10 MANAGER            1
            20 ANALYST            2
    PROMPT     ==========  1. Pivot  ==========
    SELECT     deptno
    ,     COUNT (CASE WHEN job = 'ANALYST' THEN 1 END)     AS analyst_cnt
    ,     COUNT (CASE WHEN job = 'CLERK'   THEN 1 END)     AS clerk_cnt
    ,     COUNT (CASE WHEN job = 'MANAGER' THEN 1 END)     AS manager_cnt
    FROM     scott.emp
    WHERE     job     IN ('ANALYST', 'CLERK', 'MANAGER')
    GROUP BY     deptno;
    --     Output:
        DEPTNO ANALYST_CNT  CLERK_CNT MANAGER_CNT
            30           0          1           1
            20           2          2           1
            10           0          1           1
    --     Explanation
    (1) Decide what you want the output to look like.
         (E.g. "I want a row for each department,
         and columns for deptno, analyst_cnt, clerk_cnt and manager_cnt)
    (2) Get a result set where every row identifies which row
         and which column of the output will be affected.
         In the example above, deptno identifies the row, and
         job identifies the column.
         Both deptno and job happened to be in the original table.
         That is not always the case; sometimes you have to
         compute new columns based on the original data.
    (3) Use aggregate functions and CASE (or DECODE) to produce
         the pivoted columns. 
         The CASE statement will pick
         only the rows of raw data that belong in the column.
         If each cell in the output corresponds to (at most)
         one row of input, then you can use MIN or MAX as the
         aggregate function.
         If many rows of input can be reflected in a single cell
         of output, then use SUM, COUNT, AVG, STRAGG, or some other
         aggregate function.
         GROUP BY the column that identifies rows.
    PROMPT     ==========  2. Oracle 11 PIVOT  ==========
    WITH     e     AS
    (     -- Begin sub-query e to SELECT columns for PIVOT
         SELECT     deptno
         ,     job
         FROM     scott.emp
    )     -- End sub-query e to SELECT columns for PIVOT
    SELECT     *
    FROM     e
    PIVOT     (     COUNT (*)
              FOR     job     IN     ( 'ANALYST'     AS analyst
                             , 'CLERK'     AS clerk
                             , 'MANAGER'     AS manager
    NOTES ON ORACLE 11 PIVOT:
    (1) You must use a sub-query to select the raw columns.
    An in-line view (not shown) is an example of a sub-query.
    (2) GROUP BY is implied for all columns not in the PIVOT clause.
    (3) Column aliases are optional. 
    If "AS analyst" is omitted above, the column will be called 'ANALYST' (single-quotes included).
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Oracle Clustre, Oracle Cluster with RAC and Oracle 10g

    Is there a difference between Oracle Cluster and Oracle Cluster with RAC? Please explain. Do existing database codes run unmodified in Cluster or Cluster with RAC environment? What needs to be modified to make existing SQL codes RAC-aware. How to achieve 'all automatic' in case of failure and resubmission of Queries from failed instance to a running instance?
    In 10g environment, do we need to consider licensing of RAC as a separate product? What are additional features one derives in 10g that is not in Cluster +RAC?
    Your comments and pointers to comparison study and pictorial clarification will be very helpful.

    Oracle cluster like failsafe before or Veritas Cluster or other vendor's cluster is meant for HA (high availability) purpose. Which 2 nodes or more can see a shared disk with 1 active node. Whenever this active node failed through heartbeat other machine will know and will take the database over from there.
    Oracle RAC is more for HA and load balance. In Oracle RAC 2 or more nodes are accessing the database at the same time so it spread load across all these nodes.
    I believe Oracle 10g RAC still need seperate license for it. But you need to call Oracle or check the production document to verify it.
    Oracle 10g besides improvement in RAC. It's main improvement is on the build in management of the database itself. It can monitored and selftune itself to much furthur level then before and give DBA much more information to determine the cause of the problem as well. Plus improvement on lots of utility as well like RMAN , data pump etc... I don't want to get into too much detail on this you can check on their 10g new features for more detail view.
    Hope this help. :)

  • Need Urgent Help with trigger in Oracle 10g

    Hello frd,
    I am working on my DBMS Project in VB 6.0 that is Tollbooth management system
    i have to insert one trigger for my project so i had decided to insert time trigger.
    I have total 3 table UserLogin, Vehice and Vehicle_Data
    the 3rd table Vehicle data contain the following fields
    Vehicle_Type, Vehicle_No, Tax_Time, Source, Destination and Tax
    Now i had done coding for tax when you select Vehicle Type, Source and Destination the Tax Field will automatically fillup and all the data will Saved in Oracle table but now my problem is that i want to create trigger for Tax_Time column When any new data inserted current time will stored in that column
    I had create one but it gives error
    create trigger time after insert on vehicle_Data
    for each row
    begin
    insert into Vehicle_Data(Tax_Time) values(to_char(sysdate, 'HH:MI:SSAM DD_MON_YYYY'));
    end;
    Note: I am Using VB 6.0 and Oracle 10g Express Edition

    I had create one but it gives errorWelcome to the forum and many many thanks for not posting the full error message, that is really helpful, since we're all a 100% sure what's going on now (yes, that was ironic ;) ).
    Let me guess: a mutating table error?
    Read:
    http://www.oracle-base.com/articles/9i/MutatingTableExceptions.php
    http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936
    But before that, actually you should read:
    http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html

  • Something´s going wrong with select distinct (Oracle 10g)

    Our database is oracle 10g release 2 and the query statement is:
    select distinct last_name
    from students;
    and the query returns all of the last_names without an specific order..
    If I execute the same query in oracle 9i the query returns all of the last_name in alphabetic order.
    Why is it different on Oracle 10g?

    See also this blog entry from Mr. Kyte.
    C.

  • Problems with the installation Oracle 10g 10202 - Platform x86 - Sol 5.10

    Hi,
    I am trying to install Oracle 10g R10202 in plataform x86 Solaris 5.10. I did all the tasks of preinstallation, and when I execute runInstaller, the following error appears ==>
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be 5.10. Actual 5.10
    Passed
    Checking Temp space: must be greater than 250 MB. Actual 7622 MB Passed
    Checking swap space: must be greater than 500 MB. Actual 1761 MB Passed
    Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /opt/tmp/OraInstall2007-08-26_09-18-08PM. Please wait ...warning [../stage/Components/oracle.swd.jre/1.4.2.0.0/1/DataFiles/filegroup2.jar]: 1 extra byte at beginning or within zipfile
    (attempting to process anyway)
    file #0: bad zipfile offset (local header sig): 1
    (attempting to re-compensate)
    error: invalid compressed data to inflate /opt/tmp/OraInstall2007-08-26_09-18-08PM/jre/1.4.2/lib/sparc/libjvm.so
    file #516: bad zipfile offset (local header sig): 23197903
    (attempting to re-compensate)
    Error in writing to directory /opt/tmp/OraInstall2007-08-26_09-18-08PM. Please ensure that this directory is writable and has atleast 69 MB of disk space. Installation cannot continue.
    : Error 0
    Obviously it is not a problem of space in the directory/tmp.
    I have tried other options as ==>
    *-Run runInstaller con el parameter ignoreSysPrereqs
    *-Setting  others variables of environment like,  TMP =/opt/tmp
    and TMPDIR =/opt/tmp.
    But I don't fix the problem.
    Someone has some idea of like solving this bug or problem?
    Thanks in Advance.
    Best Regards.
    NSV

    Error is on small caps but it is straight forward:
    ".. error: invalid compressed data to inflate ..."
    Your oracle media is corrupt. Redownload it and verify the downloaded zip file.
    ~ Madrid

  • System.ServiceModel.FaultException`1 error reuturns when trying to perform the wildcard search with (*)

    Hi All,
    I'm using Sharepoint 2010, and when I try to search word like 'win*', below error message logged.
    Any suggestion will be appreciated.
    02/02/2015 21:35:21.17  w3wp.exe (0x1B60)                        0x1428 SharePoint Foundation        
     Monitoring                     b4ly High     Leaving Monitored Scope (ExecuteWcfOperation:http://tempuri.org/ISearchQueryServiceApplication/Execute).
    Execution Time=6740.1301 1f87d2ef-c878-469e-9f05-d7207dee4833
    02/02/2015 21:35:21.17  w3wp.exe (0x1B60)                        0x1428 SharePoint Foundation        
     Monitoring                     b4ly High     Leaving Monitored Scope (Execute). Execution Time=6741.375 1f87d2ef-c878-469e-9f05-d7207dee4833
    02/02/2015 21:35:21.17  w3wp.exe (0x1B60)                        0x1428 SharePoint Server Search       Query                        
     dka5 High     SearchServiceApplicationProxy::Execute--Error occured: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Exception from HRESULT: 0x80041606 (Fault Detail is equal to An ExceptionDetail,
    likely created by IncludeExceptionDetailInFaults=true, whose value is: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80041606    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode,
    IntPtr errorInfo)     at Microsoft.Office.Server.Search.Query.FullTextSqlQueryInternal.Execute()     at Microsoft.Office.Server.Search.Query.QueryInternal.Execute(QueryProperties properties)     at
    Microsoft.Office.Server.Search.Administration.SearchServiceApplication.Execute(QueryProperties properties)     at SyncInvokeExecute(Object , Object[] ... 1f87d2ef-c878-469e-9f05-d7207dee4833
    02/02/2015 21:35:21.17* w3wp.exe (0x1B60)                        0x1428 SharePoint Server Search       Query                        
     dka5 High     ..., Object[] )     at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)     at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&
    rpc)     at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)     at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)...). 1f87d2ef-c878-469e-9f05-d7207dee4833
    02/02/2015 21:35:21.17  w3wp.exe (0x1B60)                        0x1428 SharePoint Server Search       Query                        
     dn6x High     Exception caught in QueryService.Query method.  Exception message: Exception from HRESULT: 0x80041606.  Stack:   Server stack trace:      at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message
    reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)     at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)    
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
    methodCall, ProxyOperationRuntime operation)     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage mes... 1f87d2ef-c878-469e-9f05-d7207dee4833
    02/02/2015 21:35:21.17* w3wp.exe (0x1B60)                        0x1428 SharePoint Server Search       Query                        
     dn6x High     ...sage)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
    msgData, Int32 type)     at Microsoft.Office.Server.Search.Query.ISearchQueryServiceApplication.Execute(QueryProperties properties)     at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.<>c__DisplayClass4.<Execute>b__3(ISearchServiceApplication
    serviceApplication)     at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.DoSpLoadBalancedUriWsOp[T](WebServiceBackedOperation`1 webServiceCall, Int32 timeoutInMilliseconds, Int32 wcfTimeoutInMilliseconds, String
    operationName)     at Microsoft.Office.Server.Search.Administration.... 1f87d2ef-c878-469e-9f05-d7207dee4833
    02/02/2015 21:35:21.17* w3wp.exe (0x1B60)                        0x1428 SharePoint Server Search       Query                        
     dn6x High     ...SearchServiceApplicationProxy.DoWebServiceBackedOperation[T](String operationName, Int32 timeoutInMilliseconds, Int32 wcfTimeoutInMilliseconds, WebServiceBackedOperation`1 webServiceCall)    
    at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.Execute(QueryProperties properties)     at Microsoft.Office.Server.Search.Query.Query.Execute()     at Microsoft.Office.Server.Search.Query.QueryService.DoQuery(QueryMethod
    queryMethod, String queryXml, String& domain, String& queryId, Int32& startAt, Boolean& fStandardResults, StringCollection& querySuggestions)     at Microsoft.Office.Server.Search.Query.QueryService.Query(String queryXml). 1f87d2ef-c878-469e-9f05-d7207dee4833
    02/02/2015 21:35:21.17  w3wp.exe (0x1B60)                        0x1428 SharePoint Foundation        
     Monitoring                     b4ly Medium   Leaving Monitored Scope (Request (POST:http://cy1mssvkbleix01:10000/_vti_bin/search.asmx)).
    Execution Time=6767.0049 1f87d2ef-c878-469e-9f05-d7207dee4833

    Hi Lemon,
    For your issue, it can be caused by that a keyword matches more words than the allowed maximum of 10000 words in a wildcard search. You can overcome the 10000 default search results limit as below:
    http://www.silver-it.com/node/97
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Help with Installation of Oracle 10g !!!

    Hi,
    I got a HP Mini notebook from a friend and it have windows 7 starter installed. When i try to install Oracle 10g, i get this message:
    Abnormal program termination. An internal error has
    occured. Please provide the following files to Oracle
    Support:
    "Unknown"
    "Unknown"
    "Unknown"
    Kindly please provide some expert advice that why this message has occurred and what does it mean and how it can be resolved.
    Thanks.
    Regards,
    ZAHID RASHEED.

    Hi Zahid,
    This OS is a basic home version of Windows 7 ? It's not supported.
    You should install (or virtualize) some free version of Linux (openSuse or OEL) : it would save you much time.
    Best regards
    Phil

  • Problem using associative arrays in vb6 with ORAOLEDB for Oracle 10g

    The following vb6-code works fine with MS OLEDB (in MDAC 2.8) but not with Oracles OLEDB for 10g. Any suggestions for making it work?
    'vb6-code:
    Set rs = New ADODB.Recordset
    Set rs.ActiveConnection = oConn 'oConn is already initiaded - code not included here.
    rs.Source = "{call PCK_PW_RF_PERSON.P_PW_BIRTHDAY('BURSDAG','2008','01',{resultset 200000, PARAM1,PARAM2,PARAM3})}"
    rs.LockType = vntLockType
    rs.CursorLocation = adUseClient
    rs.CursorType = vntCursorType
    rs.Open
    Databaseobjects involved:
    PACKAGE "PCK_PW_RF_PERSON" IS
    TYPE     tpv_param1     IS TABLE OF VARCHAR2     INDEX BY BINARY_INTEGER;
    TYPE     tpv_param2     IS TABLE OF VARCHAR2     INDEX BY BINARY_INTEGER;
    TYPE     tpv_param3     IS TABLE OF VARCHAR2     INDEX BY BINARY_INTEGER;
    PROCEDURE P_PW_BIRTHDAY
         pv_i_sreportid          IN VARCHAR2,
         pv_i_year          IN VARCHAR2,
         pv_i_month          IN VARCHAR2,
         PARAM1               OUT tpv_param1,
         PARAM2               OUT tpv_param2,
         PARAM3               OUT tpv_param2
    IS
         CURSOR X IS select '1' AS PARAM1,'2' AS PARAM2,'3' AS PARAM3 FROM DUAL;
         i NUMBER DEFAULT 1;
    BEGIN
         FOR c IN X LOOP
              PARAM1(i)           := c.PARAM1;
              PARAM2(i)           := c.PARAM2;
              PARAM3(i)          := c.PARAM3;
              i := i + 1;
         END LOOP;
    END P_PW_BURSDAG;

    I receive this error:
    "ORA-06550: line 1, column 111:
    PLS-00201: identifier 'PARAM1' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored"

  • "Problem with links in Oracle 10g Express Edition Application Interface"

    Hi.
    Under Object_Interface>Browse>Procedure the "edit" and "compile" links are not working.Also I am unable to see my code when I click on one of the procedures. Kindly help me out.
    Thanks & Regards
    Sri

    My laptop didn't start this morning. Can you help me out?
    (Go to the Express Edition forum at Oracle Database Express Edition (XE) and give them some hints about what the problem is. )
    At the very least you will need to tell people: operating system, browser, whether you have Firewall turned on, whether you are using anti0virus, whether yo have upgraded the Application Express interface.
    You can volunteer that information, or you can wait until people ask for it, but you will need to provide that information. And if you force people to ask - it's quite likely they will get bored with your problem.

  • Issues with rman in oracle 10g

    Hi,
    [oracle@proddb12]$ rman
    it does not shows anything.. what can be done to solve this. is anything else should be provided to oracle user? It is urgent, thanks in advance, please help me out.
    Oracle: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 7)
    and how do i know rman version in my db?
    /MR
    Edited by: user612078 on Sep 17, 2008 2:28 AM

    Hi!
    Try the following
    find / -name rman
    This command looks for a file called rman. These file should normaly be located in $ORACLE_HOME/bin. If it is not then it may be deleted or something. Try to reinstall it (copy all the files of the bin directory from another oracle installation).
    Hope this helps!

  • Queries with respect to Oracle 10g RAC - Primary & Standby DB environment

    Hi,
    Please guide in the following queries:
    On my 3 Node RAC with Primary DB, I have configured database backup (using Flashback) every 30min and I keep only one copy at a time. I also have a Physical Standby in the environment which has redo applied from primary with 30min delay.
    1. During recovery, is it possible to do recovery, on to the Primary DB, to a point-in-time which is 2 hr in past using the same flashback databse?
    2. Is it possible to restore the flashback database backup (taken from 3 Node RAC with Primary DB) into a NEW oracle setup which is different from the 3 Node RAC setup with Primary DB?
    3. If the Storage Device of 3 Node RAC setup fails, can I point the 3 Node instances on to a new Storage Device which has the backup of PrimaryDb restored from a StandBy db?
    Regards

    Is there anybody who can help on this?

Maybe you are looking for