ODBC driver hangs for two table joining

Hi,
I was trying to access two tables with the following statements. I used Oracle 8 ODBC driver to access Oracle 9 database. Statement 1 and 2 are working fine but executing Statement 3 will hangs the program.
Statement1: SELECT (fields from two table) from (table1 and table 2) where table1.key=123
Statement2: SELECT (fields from two table) from (table1 and table 2) where table2.key=345
Statement3: SELECT (fields from two table) from (table1 and table 2) where table1.key=table2.key
In the tables 1 and 2 there was no match key, but it should return NULL or nothing.. instead it hangs...
Anyone encounter this problem before? Thanks a lot for replying me...
Keith

Hi,
I have updated driver to the latest 8.1.7.8.10 which is availiable at the oracle-> download... but the problem still exit... execute sql statment 3 still hangs... :(...
Thanks for your advice..

Similar Messages

  • Using SQLBindParameter, SQLPrepare and SQLExecute to insert a Decimal(5,3) type fails with SQLSTATE: 22003 using ODBC Driver 11 for SQL Server

    Hello everyone.
    I'm using SQL Server 2014, and writting on some C++ app to query and modify the database. I use the ODBC API.
    I'm stuck on inserting an SQL_NUMERIC_STRUCT value into the database, if the corresponding database-column has a scale set.
    For test-purposes: I have a Table named 'decTable' that has a column 'id' (integer) and a column 'dec' (decimal(5,3))
    In the code I basically do:
    1. Connect to the DB, get the handles, etc.
    2. Use SQLBindParameter to bind a SQL_NUMERIC_STRUCT to a query with parameter markers. Note that I do include the information about precision and scale, something like: SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_NUMERIC, SQL_NUMERIC, 5, 3, &numStr,
    sizeof(cbNum), &cbNum);
    3. Prepare a Statement to insert values, something like: SQLPrepare(hstmt, L"INSERT INTO decTable (id, dec) values(?, ?)", SQL_NTS);
    4. Set some valid data on the SQL_NUMERIC_STRUCT
    5. Call SQLExecute to execute. But now I get the error:
    SQLSTATE: 22003; nativeErr: 0 Msg: [Microsoft][ODBC Driver 11 for SQL Server]Numeric value out of range
    I dont get it what I am doing wrong. The same code works fine against IBM DB2 and MySql. I also have no problems reading a SQL_NUMERIC_STRUCT using SQLBindCol(..) and the various SQLSetDescField to define the scale and precision.
    Is there a problem in the ODBC Driver of the SQL Server 2014?
    For completeness, here is a working c++ example:
    // InsertNumTest.cpp
    // create database using:
    create a table decTable with an id and a decimal(5,3) column:
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE[dbo].[decTable](
    [id][int] NOT NULL,
    [dec][decimal](5, 3) NULL,
    CONSTRAINT[PK_decTable] PRIMARY KEY CLUSTERED
    [id] ASC
    )WITH(PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON[PRIMARY]
    ) ON[PRIMARY]
    GO
    // Then create an odbc DSN entry that can be used:
    #define DSN L"exOdbc_SqlServer_2014"
    #define USER L"exodbc"
    #define PASS L"testexodbc"
    // system
    #include <iostream>
    #include <tchar.h>
    #include <windows.h>
    // odbc-things
    #include <sql.h>
    #include <sqlext.h>
    #include <sqlucode.h>
    void printErrors(SQLSMALLINT handleType, SQLHANDLE h)
        SQLSMALLINT recNr = 1;
        SQLRETURN ret = SQL_SUCCESS;
        SQLSMALLINT cb = 0;
        SQLWCHAR sqlState[5 + 1];
        SQLINTEGER nativeErr;
        SQLWCHAR msg[SQL_MAX_MESSAGE_LENGTH + 1];
        while (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)
            msg[0] = 0;
            ret = SQLGetDiagRec(handleType, h, recNr, sqlState, &nativeErr, msg, SQL_MAX_MESSAGE_LENGTH + 1, &cb);
            if (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)
                std::wcout << L"SQLSTATE: " << sqlState << L"; nativeErr: " << nativeErr << L" Msg: " << msg << std::endl;
            ++recNr;
    void printErrorsAndAbort(SQLSMALLINT handleType, SQLHANDLE h)
        printErrors(handleType, h);
        getchar();
        abort();
    int _tmain(int argc, _TCHAR* argv[])
        SQLHENV henv = SQL_NULL_HENV;
        SQLHDBC hdbc = SQL_NULL_HDBC;
        SQLHSTMT hstmt = SQL_NULL_HSTMT;
        SQLHDESC hdesc = SQL_NULL_HDESC;
        SQLRETURN ret = 0;
        // Connect to DB
        ret = SQLAllocHandle(SQL_HANDLE_ENV, NULL, &henv);
        ret = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER);
        ret = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
        ret = SQLConnect(hdbc, (SQLWCHAR*)DSN, SQL_NTS, USER, SQL_NTS, PASS, SQL_NTS);
        if (!SQL_SUCCEEDED(ret))
            printErrors(SQL_HANDLE_DBC, hdbc);
            getchar();
            return -1;
        ret = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
        // Bind id as parameter
        SQLINTEGER id = 0;
        SQLINTEGER cbId = 0;
        ret = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &id, sizeof(id), &cbId);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        // Bind numStr as Insert-parameter
        SQL_NUMERIC_STRUCT numStr;
        ZeroMemory(&numStr, sizeof(numStr));
        SQLINTEGER cbNum = 0;
        ret = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_NUMERIC, SQL_NUMERIC, 5, 3, &numStr, sizeof(cbNum), &cbNum);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        // Prepare statement
        ret = SQLPrepare(hstmt, L"INSERT INTO decTable (id, dec) values(?, ?)", SQL_NTS);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        // Set some data and execute
        id = 1;
        SQLINTEGER iVal = 12345;
        memcpy(numStr.val, &iVal, sizeof(iVal));
        numStr.precision = 5;
        numStr.scale = 3;
        numStr.sign = 1;
        ret = SQLExecute(hstmt);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        getchar();
        return 0;

    This post might help:
    http://msdn.developer-works.com/article/12639498/SQL_C_NUMERIC+data+incorrect+after+insert
    If this is no solution try increasing the decimale number on the SQL server table, if you stille have the same problem after that change the column to a nvarchar and see the actual value that is put through the ODBC connector for SQL.

  • Sample coding for multiple table join

    Hi,
    i need a sample coding for multiple table join. can anyone help me out.
    regards
    Gokul

    SELECT AVBELN AFKDAT AVTWEG ASPART AWAERK AKURRF AKUNAG AKNUMV
             BPOSNR BFKIMG BNETWR BMATNR
             DBEGRU ELABOR E~MATKL
             INTO CORRESPONDING FIELDS OF TABLE ITAB
             FROM VBRK AS A INNER JOIN VBRP AS B
                  ON AVBELN EQ BVBELN
             INNER JOIN J_1IEXCHDR AS C
                  ON AVBELN EQ CRDOC
             INNER JOIN KNVV AS D
                  ON DKUNNR EQ AKUNAG  AND
                     DVKORG EQ AVKORG  AND
                     DSPART EQ ASPART  AND
                     D~BEGRU NE SPACE
             INNER JOIN MARA AS E
                  ON EMATNR EQ BMATNR
             WHERE A~FKDAT IN S_FKDAT AND
                   A~FKART EQ 'F2'    AND
                   A~VTWEG IN S_VTWEG AND
                   A~SPART IN S_SPART AND
                   A~KUNAG IN S_KUNAG AND
                   A~FKSTO NE 'X'     AND
                   B~WERKS IN S_WERKS AND
                   C~TRNTYP = 'DLFC'  AND
                   E~LABOR IN S_LABOR AND
                C~SRGRP IN ('01','02','03','31','32','33','41','42','43',
                            '81','82','83','95','55','45', '48') AND
                   B~MATNR IN S_MATNR AND
                   D~BEGRU IN S_BEGRU AND
                   E~MATKL IN S_MATKL.
    but my suggestion not to use more than 2 table in inner join it will affect in performance use for all entries instead of join.
    regards
    shiba dutta

  • Unable to generate spool for two tables in report output

    Hi,
    I created report with two custom containers displaying two tables in output. When I execute the report in background spool is created only for one table in top custom container.
    What should be done to generate spool for both the tables in two different custom containers.
    Thanks,
    Abhiram.

    Hi,
    Check the bellow link for your requirement.
    <<link removed>>
    Regards,
    Goutam Kolluru.
    Edited by: kishan P on Feb 2, 2012 1:50 PM

  • How to use the TableSorter for two tables at the same view?

    Hello,
    I am using the TableSorter object in order to sort Dynpro tables.
    Suppose I have two tables at the same view, is it possible to use it seperatly for both of them?
    I assume that at the wdModifyView method I will need to catch the table that the user clicked on, yet I don't have an idea of how to do it...

    Hi Roy,
    Constructor of TableSorter
    public TableSorter(IWDTable table, IWDAction sortAction, Comparator[] comparators)
    So, you have to create instance of TableSorter class for each table on the view.
    best regards, Maksim Rashchynski.

  • IMac erase OS hard drive hangs for hours - powered off now only get a spinning cog whatever I do

    I have a 27 inch 2011 iMac that I have been trying to totally wipe and reinstall the OS (Mountain Lion) by erasing it with Command + R. It has a 2TB drive in it and the problem is that at the end the erase hard drive hangs on last bit for hours on end. I (probably stupidly) held down the power button and tried doing it again.
    Since then every time all that has happened is the Apple logo comes on and the cog constantly spins.
    Holding the command key on startup cos spins then eventually brings up a blank screen. If I press the C key with a CD in there it starts making CD reading noises for a few minutes then does nothing - the cog just spins forever.
    I am really worried that I have totally messed this thing up forever and dont want to have to start taking it apart at all if possible.
    Any help is greatly appreciated!
    Thanks

    Hi kant3r,
    Thanks for visiting Apple Support Communities.
    If your iMac is only booting to a gray screen or Apple logo with a "spinning gear," try these troubleshooting steps first:
    Disconnect, test peripheral devices and network cables
    Note: "Peripheral devices" refers to external devices other than what came with your Mac, such as hard drives, printers, or hubs that you connect via a USB or FireWire cable.
    Shut down your Mac. If necessary, hold your Mac's power button for several seconds to force it to power down.
    Disconnect all peripheral devices such as external hard drives or printers (leave only the display, a keyboard, and mouse connected).
    Disconnect any Ethernet cables.
    Start up your Mac.
    If you are using a desktop Mac with a third-party keyboard and/or mouse device, and the issue still occurs, try starting up with an Apple keyboard and mouse connected instead. Try starting with no keyboard and mouse connected, then connect them after start up. Also, try a different USB port on your Mac.
    If the gray screen issue persists with no devices connected, go to the next section (with the peripherals still disconnected).
    Perform a Safe Boot
    Simply performing a Safe Boot may resolve this issue.
    Shut down your Mac. If necessary, hold your Mac's power button for several seconds to force it to power down.
    Start your Mac, then immediately hold the Shift key. This performs a Safe Boot. Advanced tip: If you want to see the status of a Safe Boot as it progresses, you can hold Shift-Command-V during start up (instead of just Shift).
    Note: A Safe Boot takes longer than a typical start up because it includes a disk check and other operations.
    If your Mac starts up as expected, immediately try restarting.
    If the Safe Boot does not work, or the restart after a successful Safe Boot does not work, go to the next section.
    Reset the NVRAM / PRAM
    Shut down your Mac. If necessary, hold your Mac's power button for several seconds to force it to power down.
    Reset the NVRAM / PRAM.
    The information above can be found here:
    Mac OS X: Gray screen appears during startup
    http://support.apple.com/kb/TS2570
    After performing these steps, try again to boot to OS X Recovery or the original OS X install disc that came with your iMac.
    Best Regards,
    Jeremy

  • How to query for two tables

    Hi,
    I have this problem, How can query a two table?
    Table A ->  Table B
    id               table-a_id
    name          table_b_name
    the relationship is one-to-many
    How can I get the result?
    Hope my question make sense
    cheers.
    thanks a lot.

    I bet you have more luck looking for an answer in a SQL forum.

  • Inner join for two tables

    Hello All
    i have these to tables
    country: name,population
    borders: country1,country2
    every country have some neghbors, in borders table,
    now i should calculate sum of pupulation of all neighbors of every country
    thank u so much for ur help
    I use oracle 11g
    best

    This is the SQL to create the table
    now i hope i will get an answer
    --  File created - Tuesday-April-30-2013  
    --  DDL for Table BORDERS
      CREATE TABLE "intern"."BORDERS" ("COUNTRY1" CHAR(2), "COUNTRY2" CHAR(2), "LENGTH" NUMBER)
       COMMENT ON COLUMN "intern"."BORDERS"."COUNTRY1" IS 'a country code'
       COMMENT ON COLUMN "intern"."BORDERS"."COUNTRY2" IS 'a country code'
       COMMENT ON COLUMN "intern"."BORDERS"."LENGTH" IS 'length of the border between country1 and country2'
       COMMENT ON TABLE "intern"."BORDERS"  IS 'informations about neighboring countries'
    REM INSERTING into intern.BORDERS
    SET DEFINE OFF;
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ad','es',63);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('md','ua',939);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mk','yu',221);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ml','mr',2237);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ml','ne',821);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ml','sn',419);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mm','th',1800);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mn','ru',3543);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mr','sn',813);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mw','mz',1569);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mw','tz',475);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mw','zm',837);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mx','us',3141);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('my','th',506);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','sz',105);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','tz',756);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','za',491);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','zm',419);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','zw',1231);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('na','za',967);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('na','zm',233);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ne','ng',1497);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ne','td',1175);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ng','td',87);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('no','ru',196);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('no','se',1619);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('om','sa',676);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('om','ye',288);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('pl','ru',206);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('pl','sk',444);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('pl','ua',526);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('qa','sa',60);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ro','ua',531);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ro','yu',476);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ru','ua',1576);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('rw','tz',217);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('rw','ug',169);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sa','ye',1458);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sd','td',1360);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sd','ug',435);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sk','ua',97);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sy','tr',822);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sz','za',430);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tj','uz',1161);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tm','uz',1621);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tz','ug',396);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tz','zm',338);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('za','zw',225);
    Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('zm','zw',797);
    --  DDL for Index BORDERS_KEY
      CREATE UNIQUE INDEX "intern"."BORDERS_KEY" ON "intern"."BORDERS" ("COUNTRY1", "COUNTRY2")
    --  Constraints for Table BORDERS
      ALTER TABLE "intern"."BORDERS" ADD CONSTRAINT "BORDERS_KEY" PRIMARY KEY ("COUNTRY1", "COUNTRY2") ENABLE
      ALTER TABLE "intern"."BORDERS" ADD CONSTRAINT "BORDERS_LENGTH_CHECK" CHECK (
                 Length > 0
            ) ENABLE
    --  File created - Tuesday-April-30-2013  
    --  DDL for Table COUNTRY
      CREATE TABLE "intern"."COUNTRY" ("NAME" VARCHAR2(40), "CODE" CHAR(2), "CAPITAL" VARCHAR2(40), "PROVINCE" VARCHAR2(40), "POPULATION" NUMBER, "AREA" NUMBER)
       COMMENT ON COLUMN "intern"."COUNTRY"."NAME" IS 'the country name'
       COMMENT ON COLUMN "intern"."COUNTRY"."CODE" IS 'the internet country code (two letters)'
       COMMENT ON COLUMN "intern"."COUNTRY"."CAPITAL" IS 'the name of the capital'
       COMMENT ON COLUMN "intern"."COUNTRY"."PROVINCE" IS 'the province where the capital belongs to'
       COMMENT ON COLUMN "intern"."COUNTRY"."POPULATION" IS 'the population number'
       COMMENT ON COLUMN "intern"."COUNTRY"."AREA" IS 'the total area'
       COMMENT ON TABLE "intern"."COUNTRY"  IS 'the countries of the world with some data'
    REM INSERTING into intern.COUNTRY
    SET DEFINE OFF;
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Andorra','ad','Andorra la Vella','Andorra la Vella',69865,468);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('United Arab Emirates','ae','Abu Dhabi','Abu Dhabi',2523915,82880);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Afghanistan','af','Kabul','Kabul',28513677,647500);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Antigua and Barbuda','ag','Saint Johns','Saint John',68320,442.6);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Netherlands','nl','Amsterdam','Noord-Holland',16318199,41526);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Norway','no','Oslo','Akershus',4574560,324220);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Nepal','np','Kathmandu','Kathmandu',27070666,140800);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Nauru','nr',null,null,12809,21);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Niue','nu',null,null,2156,260);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('New Zealand','nz','Wellington','Wellington',3993817,268680);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Oman','om','Muscat','Muscat',2903165,212460);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Panama','pa','Panama','Panama',3000463,78200);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Peru','pe','Lima','Lima y Callao',27544305,1285220);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('French Polynesia','pf','Papeete','Iles du Vent',266339,4167);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Papua New Guinea','pg','Port Moresby','National Capital District',5420280,462840);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Philippines','ph','Manila','National Capital Region',86241697,300000);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Pakistan','pk','Islamabad','Federal Capital Area',159196336,803940);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Poland','pl','Warsaw','Mazowieckie',38626349,312685);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saint Pierre and Miquelon','pm','Saint-Pierre','Saint-Pierre',6995,242);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Pitcairn Islands','pn',null,null,46,47);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Puerto Rico','pr','San Juan','San Juan',3897960,9104);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Palestine','ps','Ramallah','Gaza Strip',3762005,6220);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Portugal','pt','Lisbon','Lisboa e Vale do Tejo',10524145,92391);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Palau','pw','Koror','Koror',20016,458);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Paraguay','py','Asuncion','Asuncion',6191368,406750);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Qatar','qa','Doha','Doha',840290,11437);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Reunion','re','Saint-Denis','Saint-Denis',766153,2517);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Romania','ro','Bucharest','Bucharest',22355551,237500);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Russia','ru','Moscow','Moscow',143782338,17075200);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Rwanda','rw','Kigali','Ville de Kigali',7954013,26338);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saudi Arabia','sa','Riyadh','Riyadh',25795938,1960582);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Solomon Islands','sb','Honiara','Guadalcanal',523617,28450);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Seychelles','sc',null,null,80832,455);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sudan','sd','Khartoum','Khartoum',39148162,2505810);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sweden','se','Stockholm','Stockholm',8986400,449964);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Singapore','sg',null,null,4353893,692.7);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saint Helena','sh','Jamestown','Saint Helena',7415,410);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Slovenia','si','Ljubljana','Osrednjeslovenska',2011473,20273);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Svalbard','sj','Longyearbyen','Svalbard',2756,62049);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Slovakia','sk','Bratislava','Bratislavsky',5423567,48845);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sierra Leone','sl','Freetown','Western',5883889,71740);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('San Marino','sm','San Marino','San Marino',28503,61.2);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Senegal','sn','Dakar','Dakar',10852147,196190);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Somalia','so','Mogadishu','Banadir',8304601,637657);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Suriname','sr','Paramaribo','Paramaribo',436935,163270);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sao Tome and Principe','st','Sao Tome','Agua Grande',181565,1001);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('El Salvador','sv','San Salvador','San Salvador',6587541,21040);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Syria','sy','Damascus','Damascus',18016874,185180);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Swaziland','sz','Mbabane','Hhohho',1169241,17363);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Turks and Caicos Islands','tc',null,null,19956,430);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Chad','td','NDjamena','Chari-Baguirmi',9538544,1284000);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Togo','tg','Lome','Maritime',5556812,56785);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Thailand','th','Bangkok','Bangkok Metropolitan Area',64865523,514000);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tajikistan','tj','Dushanbe','Dushanbe',7011556,143100);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tokelau','tk',null,null,1405,10);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Turkmenistan','tm','Asgabat','Asgabat',4863169,488100);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tunisia','tn','Tunis','Tunis',9974722,163610);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tonga','to','Nukualofa','Tongatapu',110237,748);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('East Timor','tp','Dili','Dili',1019252,15007);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Turkey','tr','Ankara','Ankara',68893918,780580);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Trinidad and Tobago','tt','Port of Spain','Port of Spain',1096585,5128);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tuvalu','tv','Vaiaku','Funafuti',11468,26);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Taiwan','tw','Taipei','Taipei Hsien',22749838,35980);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tanzania','tz','Dar es Salaam','Dar es Salaam',36588225,945087);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Ukraine','ua','Kiev','Kiev',47732079,603700);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Uganda','ug','Kampala','Central',26404543,236040);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('United Kingdom','uk','London','England',60270708,244820);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('United States','us','Washington','District of Columbia',293027571,9631418);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Uruguay','uy','Montevideo','Montevideo',3399237,176220);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Uzbekistan','uz','Tashkent','Tashkent',26410416,447400);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Holy See','va',null,null,921,0.44);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saint Vincent and the Grenadines','vc','Kingstown','Saint George',117193,389);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Venezuela','ve','Caracas','Distrito Capital',25017387,912050);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('British Virgin Islands','vg','Road Town','Tortola',22187,153);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Virgin Islands','vi','Charlotte Amalie','Saint Thomas',108775,352);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Vietnam','vn','Ha Noi','Dong Bang Song Hong',82689518,329560);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Vanuatu','vu','Vila','Shefa',202609,12200);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Wallis and Futuna','wf','Matautu','Hahake',15880,274);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Samoa','ws','Apia','Apia Urban Area',177714,2944);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Yemen','ye','Sana','Amanah al-Asmah',20024867,527970);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Mayotte','yt','Mamoudzou','Mayotte',186026,374);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Serbia and Montenegro','yu','Belgrade','Central Serbia',10825900,102350);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('South Africa','za','Pretoria','Gauteng',42718530,1219912);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Zambia','zm','Lusaka','Lusaka',10462436,752614);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Zimbabwe','zw','Harare','Harare',12671860,390580);
    --  DDL for Index COUNTRY_KEY
      CREATE UNIQUE INDEX "intern"."COUNTRY_KEY" ON "intern"."COUNTRY" ("CODE")
    --  DDL for Index COUNTRY_NAME_UNIQUE
      CREATE UNIQUE INDEX "intern"."COUNTRY_NAME_UNIQUE" ON "intern"."COUNTRY" ("NAME")
    --  Constraints for Table COUNTRY
      ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_AREA_CHECK" CHECK (
                 Area >= 0
            ) ENABLE
      ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_KEY" PRIMARY KEY ("CODE") ENABLE
      ALTER TABLE "intern"."COUNTRY" MODIFY ("NAME" CONSTRAINT "COUNTRY_NAME_NOTNULL" NOT NULL ENABLE)
      ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_NAME_UNIQUE" UNIQUE ("NAME") ENABLE
      ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_POPULATION_CHECK" CHECK (
                 Population >= 0
            ) ENABLE

  • Partition pruning not working for partitioned table joins

    Hi,
    We are joining  4 partitioned tables on partition column & other key columns. And we are filtering the driving table on partition key. But explain plan is showing that all tables except the driving table are not partition pruning and scanning all partitions.Is there any limitation that filter condition cannot be dynamic?
    Thanks a lot in advance.
    Here are the details...
    SELECT a.pay_prd_id,
                  a.a_id,
                  a.a_evnt_no
      FROM b,
                c,
                a,
                d
    WHERE  (    a.pay_prd_id = b.pay_prd_id ---partition range all
                AND a.a_evnt_no  = b.b_evnt_no
                AND a.a_id       = b.b_id
       AND (    a.pay_prd_id = c.pay_prd_id---partition range all
            AND a.a_evnt_no  = c.c_evnt_no
            AND a.a_id       = c.c_id
       AND (    a.pay_prd_id = d.pay_prd_id---partition range all
            AND a.a_evnt_no  = d.d_evnt_no
            AND a.a_id       = d.d_id
       AND (a.pay_prd_id =  ---partition range single
               CASE '201202'
                  WHEN 'YYYYMM'
                     THEN (SELECT min(pay_prd_id)
                                      FROM pay_prd
                                     WHERE pay_prd_stat_cd = 2)
                  ELSE TO_NUMBER ('201202', '999999')
               END
    DDLs.
    create table pay_prd
    pay_prd_id number(6),
    pay_prd_stat_cd integer,
    pay_prd_stat_desc varchar2(20),
    a_last_upd_dt DATE
    insert into pay_prd
    select 201202,2,'OPEN',sysdate from dual
    union all
    select 201201,1,'CLOSE',sysdate from dual
    union all
    select 201112,1,'CLOSE',sysdate from dual
    union all
    select 201111,1,'CLOSE',sysdate from dual
    union all
    select 201110,1,'CLOSE',sysdate from dual
    union all
    select 201109,1,'CLOSE',sysdate from dual
    CREATE TABLE A
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    A_ID        NUMBER(9) NOT NULL,
    A_EVNT_NO    NUMBER(3) NOT NULL,
    A_DAYS        NUMBER(3),
    A_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION A_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE A ADD CONSTRAINT A_PK PRIMARY KEY (PAY_PRD_ID,A_ID,A_EVNT_NO) USING INDEX LOCAL;
    insert into a
    select 201202,1111,1,65,sysdate from dual
    union all
    select 201202,1111,2,75,sysdate from dual
    union all
    select 201202,1111,3,85,sysdate from dual
    union all
    select 201202,1111,4,95,sysdate from dual
    CREATE TABLE B
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    B_ID        NUMBER(9) NOT NULL,
    B_EVNT_NO    NUMBER(3) NOT NULL,
    B_DAYS        NUMBER(3),
    B_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION B_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE B ADD CONSTRAINT B_PK PRIMARY KEY (PAY_PRD_ID,B_ID,B_EVNT_NO) USING INDEX LOCAL;
    insert into b
    select 201202,1111,1,15,sysdate from dual
    union all
    select 201202,1111,2,25,sysdate from dual
    union all
    select 201202,1111,3,35,sysdate from dual
    union all
    select 201202,1111,4,45,sysdate from dual
    CREATE TABLE C
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    C_ID        NUMBER(9) NOT NULL,
    C_EVNT_NO    NUMBER(3) NOT NULL,
    C_DAYS        NUMBER(3),
    C_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION C_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE C ADD CONSTRAINT C_PK PRIMARY KEY (PAY_PRD_ID,C_ID,C_EVNT_NO) USING INDEX LOCAL;
    insert into c
    select 201202,1111,1,33,sysdate from dual
    union all
    select 201202,1111,2,44,sysdate from dual
    union all
    select 201202,1111,3,55,sysdate from dual
    union all
    select 201202,1111,4,66,sysdate from dual
    CREATE TABLE D
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    D_ID        NUMBER(9) NOT NULL,
    D_EVNT_NO    NUMBER(3) NOT NULL,
    D_DAYS        NUMBER(3),
    D_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION D_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE D ADD CONSTRAINT D_PK PRIMARY KEY (PAY_PRD_ID,D_ID,D_EVNT_NO) USING INDEX LOCAL;
    insert into c
    select 201202,1111,1,33,sysdate from dual
    union all
    select 201202,1111,2,44,sysdate from dual
    union all
    select 201202,1111,3,55,sysdate from dual
    union all
    select 201202,1111,4,66,sysdate from dual

    Below query generated from Business Objects and submitted to Database (the case statement is generated by BO). Cant we use Case/Subquery/Decode etc for the partitioned column? We are assuming that  the case causing the issue to not to dynamic partition elimination on the other joined partitioned tables (TAB_B_RPT, TAB_C_RPT).
    SELECT TAB_D_RPT.acvy_amt,
           TAB_A_RPT.itnt_typ_desc,
           TAB_A_RPT.ls_typ_desc,
           TAB_A_RPT.evnt_no,
           TAB_C_RPT.pay_prd_id,
           TAB_B_RPT.id,
           TAB_A_RPT.to_mdfy,
           TAB_A_RPT.stat_desc
      FROM TAB_D_RPT,
           TAB_C_RPT fee_rpt,
           TAB_C_RPT,
           TAB_A_RPT,
           TAB_B_RPT
    WHERE (TAB_B_RPT.id = TAB_A_RPT.id)
       AND (    TAB_A_RPT.pay_prd_id = TAB_D_RPT.pay_prd_id -- expecting Partition Range Single, but doing Partition Range ALL
            AND TAB_A_RPT.evnt_no    = TAB_D_RPT.evnt_no
            AND TAB_A_RPT.id         = TAB_D_RPT.id
       AND (    TAB_A_RPT.pay_prd_id = TAB_C_RPT.pay_prd_id -- expecting Partition Range Single, but doing Partition Range ALL
            AND TAB_A_RPT.evnt_no    = TAB_C_RPT.evnt_no
            AND TAB_A_RPT.id         = TAB_C_RPT.id
       AND (    TAB_A_RPT.pay_prd_id = fee_rpt.pay_prd_id -- expecting Partition Range Single
            AND TAB_A_RPT.evnt_no    = fee_rpt.evnt_no
            AND TAB_A_RPT.id         = fee_rpt.id
       AND (TAB_A_RPT.rwnd_ind = 'N')
       AND (TAB_A_RPT.pay_prd_id =
               CASE '201202'
                  WHEN 'YYYYMM'
                     THEN (SELECT DISTINCT pay_prd.pay_prd_id
                                      FROM pay_prd
                                     WHERE pay_prd.stat_cd = 2)
                  ELSE TO_NUMBER ('201202', '999999')
               END
    And its explain plan is...
    Plan
    SELECT STATEMENT ALL_ROWS Cost: 79 K Bytes: 641 M Cardinality: 3 M
    18 HASH JOIN Cost: 79 K Bytes: 641 M Cardinality: 3 M
    3 PART JOIN FILTER CREATE SYS.:BF0000 Cost: 7 K Bytes: 72 M Cardinality: 3 M
    2 PARTITION RANGE ALL Cost: 7 K Bytes: 72 M Cardinality: 3 M Partition #: 3 Partitions accessed #1 - #1048575
    1 TABLE ACCESS FULL TABLE TAB_D_RPT Cost: 7 K Bytes: 72 M Cardinality: 3 M Partition #: 3 Partitions accessed #1 - #1048575
    17 HASH JOIN Cost: 57 K Bytes: 182 M Cardinality: 874 K
    14 PART JOIN FILTER CREATE SYS.:BF0001 Cost: 38 K Bytes: 87 M Cardinality: 914 K
    13 HASH JOIN Cost: 38 K Bytes: 87 M Cardinality: 914 K
    6 PART JOIN FILTER CREATE SYS.:BF0002 Cost: 8 K Bytes: 17 M Cardinality: 939 K
    5 PARTITION RANGE ALL Cost: 8 K Bytes: 17 M Cardinality: 939 K Partition #: 9 Partitions accessed #1 - #1048575
    4 TABLE ACCESS FULL TABLE TAB_C_RPT Cost: 8 K Bytes: 17 M Cardinality: 939 K Partition #: 9 Partitions accessed #1 - #1048575
    12 HASH JOIN Cost: 24 K Bytes: 74 M Cardinality: 957 K
    7 INDEX FAST FULL SCAN INDEX (UNIQUE) TAB_B_RPT_PK Cost: 675 Bytes: 10 M Cardinality: 941 K
    11 PARTITION RANGE SINGLE Cost: 18 K Bytes: 65 M Cardinality: 970 K Partition #: 13 Partitions accessed #KEY(AP)
    10 TABLE ACCESS FULL TABLE TAB_A_RPT Cost: 18 K Bytes: 65 M Cardinality: 970 K Partition #: 13 Partitions accessed #KEY(AP)
    9 HASH UNIQUE Cost: 4 Bytes: 14 Cardinality: 2
    8 TABLE ACCESS FULL TABLE PAY_PRD Cost: 3 Bytes: 14 Cardinality: 2
    16 PARTITION RANGE JOIN-FILTER Cost: 8 K Bytes: 106 M Cardinality: 939 K Partition #: 17 Partitions accessed #:BF0001
    15 TABLE ACCESS FULL TABLE TAB_C_RPT Cost: 8 K Bytes: 106 M Cardinality: 939 K Partition #: 17 Partitions accessed #:BF0001
    Thanks Again.

  • X-fi XtremeMusic - Full Installation Option - Windows hangs for two minutes on shutdo

    I chose the full installation option for the x-fi xtrememusic soundcard, it installs fine, however after I restart my computer or shutdown, it hangs at "saving your settings" for about two minutes. I checked the "event viewer" in Windows XP Home SP2 and it has a entry stating:
    Windows saved user SONY\"My User" registry while an application or service was still using the registry during log off. The memory used by the user's registry has not been freed. The registry will be unloaded when it is no longer in use.
    This is often caused by services running as a user account, try configuring the services to run in either the LocalService or NetworkService account.
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    However, I then tried the minimum install, and it doesn't hang on shutdown/restart.

    If I don't manage to fix this, I will reinstall windows xp but I hope I don't have to go to all that trouble.

  • Ideas for 3 tables joins

    Hi all,
    We will need to join 3 tables: Bidder_table, key_person_table, and contact_person_table.
    The requirements:
    1. All the data in the Bidder_table should display;
    2. For key_person_table, only display first name, last name, and title;
    3. For contact_person_table, only display first_name, last_name, and title;
    4. The join should be based on a common column called bidder_id.
    Please see the table structures below:
    1. Bidder_table
    SQL> desc BIDDER_TABLE;
    Name                         Null?    Type
    BDDR_ID                      NOT NULL NUMBER(38)
    BDDR_TYPE_TXT                         VARCHAR2(23)
    BDDR_NTWRK_NAME                       VARCHAR2(50)
    NSC_NUM                               NUMBER(10)
    APRVR_LAST_NAME                       VARCHAR2(30)
    PRVR_1ST_NAME                         VARCHAR2(20)
    SYS_LAST_UPDT_USER_ID                 NOT NULL CHAR(7)
    SYS_LAST_UPDT_TS                      NOT NULL TIMESTAMP(6)
    2. Key_person_table
    SQL> desc KEY_PERSON_TABLE;
    Name                         Null?    Type
    BDDR_ID                      NOT NULL NUMBER(38)
    KEY_LAST_NAME                NOT NULL VARCHAR2(30)
    KEY_1ST_NAME                 NOT NULL VARCHAR2(20)
    Key_TITLE_TXT                         VARCHAR2(20)
    SUPLR_DATA_STUS_TXT                   VARCHAR2(20)
    SYS_LAST_UPDT_USER_ID                 NOT NULL CHAR(7)
    SYS_LAST_UPDT_TS                      NOT NULL TIMESTAMP(6)
    3. Contact_person_Table
    SQL> desc CONTACT_PERSON_TABLE
    Name                          Null?    Type
    BDDR_ID                       NOT NULL NUMBER(38)
    CNTCT_1ST_NAME                NOT NULL VARCHAR2(20)
    CNTCT_LAST_NAME               NOT NULL VARCHAR2(30)
    CNTCT_TITLE_TXT                        VARCHAR2(20)
    CNTCT_TEL_NUM                          NUMBER(10)
    CNTCT_EMAIL_ADR                        VARCHAR2(50)
    SUPLR_DATA_STUS_TXT                    VARCHAR2(20)
    SYS_LAST_UPDT_USER_ID         NOT NULL CHAR(7)
    SYS_LAST_UPDT_TS              NOT NULL TIMESTAMP(6)All the data from the Bidder_table is required, and we need to selectively join some data from both the key_person_table and contact_person_table.
    Any ideas for accomplishing this?
    Your help is greatly appreciated!
    Thanks!

    Use OUTER JOIN

  • Select statment for two tables

    I need a sql query which retrieves all the values from tblemp , tbldept, which have the same deptno effectively even if there are no rows in tblemp for an deptno
    my statement is
    select empno,ename,sal ,dname from emp,dept where e.deptno =d.deptno=10
    works if deptno 10 exists in both tables .how to do it even if there are no rows in tblemp for this deptno keeping nulls in rest of the three.

    outer join
    SQL> SELECT empno, ename, sal, dname
      2    FROM EMP e, DEPT d
      3   WHERE e.dno(+) = d.deptno;
         EMPNO ENAME             SAL DNAME
          7369 SMITH           800.2 RESEARCH
          7499 ALLEN            1600 SALES
          7521 WARD             1250 SALES
          7566 JONES            2975 RESEARCH
          7654 MARTIN           1250 SALES
          7698 BLAKE            2850 SALES
          7782 CLARK            2450 ACCOUNTING
          7788 SCOTT            3000 RESEARCH
          7839 KING             5000 ACCOUNTING
          7844 TURNER           1500 SALES
          7876 ADAMS            1100 RESEARCH
          7900 JAMES             950 SALES
          7902 FORD             3000 RESEARCH
          7934 MILLER           1300 ACCOUNTING
                                     OPERATIONS
                                     LOGISTIC

  • Anyconnect client and clientless connections hang for two users

    ASA 5525, v. 9.1(5)19
    Anyconnect client 3.1.02026
    I have two users who are unable to connect via the AC client or clientless through the web portal. Using the client, it will get stuck in a loop of "checking for updates". On the portal, the connection will proceed to the point of "Cisco Secure Desktop successfully validated... Success.. Reloading..please wait." Then it hangs there.
    The issue occurs for the user regardless of which company laptop she logs onto. A help desk tech can use her laptop and successfully connect, but she cannot connect on her own laptop or on another laptop. (Same for the other user.) So the issue doesn't seem to be related to her laptop or the AC installation. (Help desk did reimage her machine early in the troubleshooting process before they realized that the issue seemed to follow the user.)
    I've updated the hostscan file - no change in results.  Client and clientless connections seem to be working fine for all other users. We're stumped.  Suggestions, anyone?  thanks!

    The LDAP should be server folks -- Active Directory.  Chances are whoever manages the ASA's should have access to at least look in Active Directory to look that up.  If they don't they need it.
    I obviously don't know a lot about what devices you are using, but if you are using ISE, there should be some type of MNT device (Monitoring and Troubleshooting) -- which is collecting the logs and, hopefully, sending them to some type of syslog aggregate collection tool (splunk?).
    Otherwise, there should be a device called a CAM (Clean Access Manager) that is collecting logs -- which may also be propagated to a syslog aggregate tool -- although with CAM's, you can pull the reports right out of them in a comma deliminated file (.csv) and go through them that way.
    -- The thing that gets me is that it happens to two users no matter what computer they try to connect from, no matter what network they connect from, and other users can authenticate and gain network access on those same devices.
    -- That is why it is rather perplexing.  Pretty much saying it has to be something with:
    - the IP pool they are getting an IP from
    - their AD credentials
    - their username
    - something along those lines, if the information provided was fully accurate.

  • How to use different parameters for two tables(chart and Table) in one report in SSRS?

    Hi,
    Here is my requirement, i have 7 parameters in my report(Site,Account,LOB,year,Month,WeekDay and Date_Filter),
    and in my report i have one table and one Chart,
    my requirement is the table in the report has to show the data for 6 parameters only i.e(Site,Account,LOB,year,Month and WeekDay).so the table has to consider only 6 parameters, and it has ignore the 7th parameter, table should not consider Date_Filter parameter.
    And Chart has to consider all 7 parameters.
    so, when we preview the report table has to show the data for only 6 parameters and chart has to show the data for all 7 parameters.
    if there is a way to get this Please reply me ASAP, it is an urgent requirement.
    Thanks in Advance,
    Naveen

    Hi Naveen,
    Refer below link to create multiple datasets as suggested by Gnanadurai
    http://technet.microsoft.com/en-us/library/ff714047(v=sql.105).aspx
    Thanks
    Swapna

  • Two Tables Join

    I'm trying to add one column from another table and its adding extra data to my query. Can someone point me in the right direction.
    Here is my code.
    select * from xxx_ute_lineitem = That code returns about 85,000 lines
    SELECT
    xxx_ute_lineitem.tse_employee_name,
    xx_ute_lineitem.shell_timecodeter8_shell,
    DECODE (xx_us_tc.uuu_shell_status, 0,'Inactive',1,'Active',2,'On-Hold') as status,
    xx_ute_lineitem.tse_weekendsunday_date,
    xx_ute_lineitem.tse_hours2_dec AS Monday,
    xx_ute_lineitem.tse_hours3_dec AS Tuesday,
    xx_ute_lineitem.tse_hours4_dec AS Wednesday,
    xx_ute_lineitem.tse_hours5_dec AS Thursday,
    xx_ute_lineitem.tse_hours6_dec AS Friday,
    xx_ute_lineitem.tse_hours7_dec AS Saturday,
    xx_ute_lineitem.tse_hours_dec AS Sunday,
    xx_ute_lineitem.tse_totalhours_dec AS Total_Hours
    FROM xx_ute_lineitem,xx_us_tc
    where xx_ute_lineitem.shell_timecodeter8_shell ( +) = xx_us_tc.shell_timecodeter8_shell
    Now this code will return back over 90,000 lines.
    Edited by: 902598 on Dec 15, 2011 7:56 AM

    Thanks for more info. Run this code (in DEV) and see if this what you want to do:
    create table timecode ( timecode number(10), status varchar2(10))
    create table lineitem (lineitem number(10), timecode number(10), hours_worked number(10,2))
    Insert into CUSTOMER.TIMECODE (TIMECODE, STATUS) Values (1, 'active');
    Insert into CUSTOMER.TIMECODE (TIMECODE, STATUS) Values (2, 'active');
    Insert into CUSTOMER.TIMECODE (TIMECODE, STATUS) Values (3, 'active');
    Insert into CUSTOMER.TIMECODE (TIMECODE, STATUS) Values (4, 'active');
    Insert into CUSTOMER.TIMECODE (TIMECODE, STATUS) Values (5, 'inactive');
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (1, 1, 2);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (2, 1, 2.5);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (3, 1, 4.5);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (1, 2, 4.5);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (2, 2, 1.5);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (1, 3, 10);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (2, 3, 3.5);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (1, 4, 3.5);
    Insert into CUSTOMER.LINEITEM (LINEITEM, TIMECODE, HOURS_WORKED) Values (2, 4, 5.5);
    COMMIT;
    select a.timecode, a.status, sum(b.hours_worked)
    from timecode a, lineitem b
    where a.timecode = b.timecode
    group by a.timecode, a.status

Maybe you are looking for