Simple query plz help

hi experts
i have a variable in which i have stores a date
from that date i want to store only the month value in a seperate variable .
plz give me the code for this
thanks in advance .

Here is the code:
data: l_datum like sy-datum.
data: l_month(2) type c.
Assign value to L_DATUM
l_month = l_datum+4(2).
Hope this helps.
ashish

Similar Messages

  • Order by problem in my query - plz help me out

    Dear all,
    I have a query like this,
    Select Booking_No, Get_Bl_Number (Booking_No) Bl_No, Depot_Code
    From Booking_Table
    Where Booking_Mode = 'B'
    Order By Depot_Code, Bl_No, Booking_No
    i need the output like NULLs of Bl_No should come first..ie.,
    DEPOT_CODE BL_NO BOOKING_NO
    DEPOT01 BOOKING01
    DEPOT01 BL01 BOOKING02
    DEPOT03 BL04 BOOKING03
    DEPOT04 BOOKING04
    DEPOT05 BL05 BOOKING06
    since am using the function to get the Bl_No, am not getting the NULLs first...kindly help me out
    Thanx and Rgds,
    M Thiyagu

    You can use like this:
    Order By
       Depot_Code,
       Bl_No nulls first ,
       Booking_No

  • Nokia n8 hang - battery removal query - plz help

    Whenever the nokia n8 hangs, will I have to remove the battery everytime with a screw driver ?. if it is so won't it be irritating ?

    if you reomve battery you void your warranty,look in the pool of knowledge thread for a reset .
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • Really simple question PLZ help

    A very very simple method.
    User types input 3 times.
    First two times enters integer numbers. The third input has to be +, -, * or /.
    The method uses the third input as an operator to perform the addition if it is +, subtraction if - etc.
    How do i turn the user input into an operator?
    The method's parameters are three.
    public int performAction(int num1, int num2, ???operator???)
    It returns an int which is the result of : num1 operator num2
    Thank you.
    papei
    Edited by: papei on Oct 27, 2007 6:09 AM
    Edited by: papei on Oct 27, 2007 6:43 AM

    papei wrote:
    A very very simple method.
    User types input 3 times.
    First two times enters integer numbers. The third input has to be +, -, * or /.
    The method uses the third input as an operator to perform the addition if it is +, subtraction if - etc.
    How do i turn the user input into an operator?
    The method's parameters are three.
    public int performAction(int num1, int num2, ???operator???)
    It returns an int which is the result of : num1 operator num2
    Thank you.
    papei
    Edited by: papei on Oct 27, 2007 6:09 AM
    Edited by: papei on Oct 27, 2007 6:43 AMSo you want to make a calculator?
    .. and what have you done so far..?

  • Simple Problem- Plz help

    I want to know how to get number of attributes of an object???
    Can anyone help?.. Iam a starter in Java...

    Right now your class has 52 attributes, and each one has a name (of course) and a value that you set at some point, right? So, you could instead do it like this:Map columns = new LinkedHashMap();
    if(resultSet.next()) // or however you're getting your values
        columns.put("This Column",resultSet.getString(1));
        // etc for each column
    }Depending on your exact circumstances there may be a way to populate the map in a loop. At any rate, you would end up with all your column names and values in a map. This code may not be applicable, but you haven't said how you're populating your values so I don't know.

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • Plz help don't know how to create a query and link it to a UDF

    hi,
    i am new to business one and however hard i am trying to use a query to link it to a UDF, it is not working. i think i am doing the whole thing wrong,so ill just post one problem i have and if any one of u can explain to me in steps i may be able to learn to link other queries and UDFs.so plz help me out .
    problem:
    i want to display the account balance of every customer/vendor whenvever i open a marketing document. i have created a UDF for the marketing documents in the title with name and description 'account balance'.
    Now how do i link the customer/vendor name field to this UDF so that the query generated will show the account balance of the corresponding customer/vendor.plz tell me in steps as to what tables to choose ,what fields to choose, what conditions and relatoins to use in a query wizard
                                                                                    thank you

    hi,
    A/R invoice
    for name UDF:
    SELECT T0.CardName FROM OCRD T0 WHERE T0.CardCode = $[OINV.CardCode]
    for balance UDF:
    SELECT T0.Balance FROM OCRD T0 WHERE T0.CardCode = $[OINV.CardCode]
    A/P invoice
    for name UDF:
    SELECT T0.CardName FROM OCRD T0 WHERE T0.CardCode = $[OPCH.CardCode]
    for balance UDF:
    SELECT T0.Balance FROM OCRD T0 WHERE T0.CardCode = $[OPCH.CardCode]
    FOR OTHER FORMS ONLY CHANGE THE END OF THE QUERY    FOR Example
    $[OPCH.CardCode]
    OPCH  is the table name, change it to other table.
    save the query and set it to customer code for refresh in A/R invoice
    save the query and set it to Vendor code for refresh in A/P invoice
    regards
    sandip

  • Query on FBL3N................Urgent  plz help me on this.

    Hi Friends
         Here is my query,
    I am changing the tcode FBL3N to add one extra field into it and to display data in the name1 field for the spcific entries in the selection screen,
    After selecting the All item radio button and giving the range in the select-options when i am pressing F8 it is giving me the correct output,after that when i am trying to display the name1 field by selecting the ctrl+f8 button and pressing the apply button  it is giving me the error as
    "An internal error has arisen in the form routine ANALYZE_ACT_FIELDCAT
    for program RFITEM_INC.
    This is due to inconsistencies between table T021S (special fields) and
    structure RFPOSEXT."
    I changed everything to Y* but still it is giving the error.
    Plz help me in this if someone face the same prob or someone having idea on this.
    Thanks a lot in Advance
    Mrutyun^

    Hi Mrutyunjaya,
    Did you manage to resolve this error?
    Thanks and Regards
    Pras

  • Help with a simple query

    Hi ,
    I'm running the following simple query in sql*plus on ORACLE9i. But this query stopped running after 30minutes, and the sql*plus die at the same time .I have no idea about this. Could somebody tell me how I can solve this problem. Thank you very much for your help.
    Select Distinct PERSADDRUSE. ADDRUSECD as "Application", PERS.PERSNBR as "Account",
    (PERS.FIRSTNAME || ' '|| PERS.MDLINIT ||' ' || PERS.LASTNAME ) as "Name1",' 'as "Name2",' 'as "Name3",
    AL1.TEXT as "Address1",AL2.TEXT as "Address2",AL3.TEXT as "Address3",
    (ADDR.CITYNAME ||' ' || ' '||ADDR.STATECD ||' '||ADDR.ZIPCD||' '|| ADDR.ZIPSUF) as "CityStateZip"
    From PERSADDRUSE
    Join PERS
    ON PERS.PERSNBR = PERSADDRUSE.PERSNBR
    --AND  PERS.ADDDATE = '12-JAN-2005'
    AND PERSADDRUSE.ADDRUSECD = 'PRI'
    join ADDR
    ON PERSADDRUSE.ADDRNBR = ADDR.ADDRNBR
    left JOIN ADDRLINE AL1
    ON ADDR.ADDRNBR = AL1.ADDRNBR
    AND AL1.LINENBR = 1
    left JOIN ADDRLINE AL2
    ON ADDR.ADDRNBR = AL2.ADDRNBR
    AND AL2.LINENBR = 2
    left JOIN ADDRLINE AL3
    ON ADDR.ADDRNBR = AL3.ADDRNBR
    AND AL3.LINENBR = 3;

    Thanks for reply. I have some other query running for 45m and it seems fine. The following are the explain plan I print out. I'm new to PL/SQL.Could you guys give me some other ideas?
    BMS_XPLAN.DISPLAY()(PLAN_TABLE_OUTPUT)
    PERSADDRUSE | 5726 | 68712 | 183 |'), DBMS_XPLAN_TYPE('| 8 | TABLE ACCESS FULL| PERS | 161K| 2839K| 431 |'), DBMS_XPLAN_TYPE('| 9 | TABLE ACCESS FULL | ADDR | 239K| 5145K| 298 |'), DBMS_XPLAN_TYPE('| 10 | TABLE ACCESS FULL | ADDRLINE | 82087 | 1683K| 240 |'), DBMS_XPLAN_TYPE('| 11 | TABLE ACCESS FULL | ADDRLINE | 82087 | 1683K| 240 |'), DBMS_XPLAN_TYPE('| 12 | TABLE ACCESS FULL | ADDRLINE | 82087 | 1683K| 240 |'), DBMS_XPLAN_TYPE('------------------------------------------------------------------------'), DBMS_XPLAN_TYPE(' '), DBMS_XPLAN_TYPE('Note: cpu costing is off, PLAN_TABLE'' is old version'))

  • Plz help in tuning this query......

    SELECT "LAN","VEF_REF_NO","VF_TYPE_CODE","APPLICANT_TYPE","MANDATORY","OPTIONAL","COMPLETE","DT_COMPLETED","REFIRENO","ROLE","USER_ID","DT_LASTUPDATED","TEMPLATEFIRED"
    FROM T_VER_STRATEGY_DETAILS M
    WHERE VF_TYPE_CODE =1 AND
    APPLICANT_TYPE ='A' AND
    DT_LASTUPDATED=
    (SELECT MAX(DT_LASTUPDATED)
    FROM T_VER_STRATEGY_DETAILS
    WHERE LAN = M.LAN AND
    VF_TYPE_CODE =1 AND APPLICANT_TYPE ='A')
    This seems to be a correlated query.
    i tried using combined index on
    (VF_TYPE_CODE ,APPLICANT_TYPE ,DT_LASTUPDATED)
    and another index on
    (LAN,VF_TYPE_CODE ,APPLICANT_TYPE ) but the plan or cost remains unchained.
    plz help

    [url http://forums.oracle.com/forums/thread.jspa?threadID=501834&tstart=0]When your query takes too long...

  • Query On ABAPQuery ..........................plz help

    hi
      guys
    Here is my query regarding the ABAPQuery.
    I have create an infoset named ZPMPLN_ITEM under that there is three tables MPLA,MPOS
    I want to display some fields from MPOS TABLE IN MPLA TABLE , how can i achieve this .
    i have already joined both the table using SQ02 but i am not getting the procedure to insert the field from one table to another table .
    Plz help me if anybody having any idea on this.
    thanks a lot
    mrutyun^

    Thanks Jeff - you pointed me in the right direction. It was the Auto-Synchronize
    setting on the window layout.
    Nicky.

  • Help! no response when doing SIMPLE query!

    I meet a strange problem when I do a SIMPLE query on a table in Oracle 8.1.7, just like:
    SELECT id FROM person WHERE id='12345';
    Most of id values are ok to the query, except some values.
    Whether I use these values in sqlplus or JDBC, mostly, no response is returned!! And I find the session in Oracle always keeps the status 'Active'. But in few scenario I can get the result quickly.
    I don't know the reason. Help me please!
    Thanks a lot!
    Meyor

    I'm not sure if the 'id' column contains something else.
    When I shutdown and restart the database, the problem seems to be "solved". If the problem reoccurs again, I will try to use xTRIM functions.
    Thanks!
    Meyor

  • Plz help prob with a query and.. a trigger

    hi..
    1)i've created a view.gave the commit..
    now when i execute this query i get no rows selected...
    sql>select text from user_views where view_name='d1_v';even when i give sql>select * from user_views; all i see are column names and nothing else..
    do i need to grant my user any privilige. my user has create any view privilige.
    2)
    is it possible for me to create a trigger that updates records by itself for every 6 months by adding 1000 to the sal field
    i tried
    create or replace trigger after logon on emp ..............like that
    but i receive an error saying system triggers cannot be based on tables or views..
    plz help me out..
    thank u
    rajiv

    1. Try "select text from user_views where view_name='D1_V';
    BTW, no need to use "commit", CREATE VIEW is a DDL command, and DDLs do implicit commit.
    2. Why do you want to use triggers ? You can do that in at least two other ways : cron jobs and Oracle jobs.

  • Plz help Either new idea nor tune this query

    Hi,
    I had two queries like below(1 &2).And As per my requirement i need to merge two queries to as one query and i wrote that one using decode(please see Resulted query3).But it's taking too much time .PLease help to tune the
    3rd query or suggest me a new idea.
    1)
    select ts.institution_id,tsd.test_alias,count(1) from test_detail td,test_session_detail tsd,test_session ts where td.test_detail_id=tsd.test_detail_id and tsd.test_session_id=ts.test_session_id and TRUNC(test_start_date) BETWEEN to_date('02/01/2009', 'MM/DD/YYYY') AND to_date('08/04/2009', 'MM/DD/YYYY') group by ts.institution_id,tsd.test_alias
    2)
    select a.INST_SITE_ID, a.INSTITUTION_ID_DISPLAY, a.institution_name, a.SITE_ID_DISPLAY, a.site_name, a.region_name,CASE WHEN a.state_name = 'Other' THEN a.OTHER ELSE a.state_name END state_name from vueinstitutionsite a,(select distinct institution_id from test_session a,test_session_detail b where a.test_session_id=b.test_session_id and trunc(test_start_date) between to_date('08/01/2009','MM/DD/YYYY') and to_date('08/04/2009','MM/DD/YYYY'))b where a.inst_site_id=b.institution_id order by a.INSTITUTION_ID_DISPLAY
    Resulted query
    *3)*
    SELECT max(a.institution_id_display)institution_id
    ,max(a.institution_name)institution_name,max(a.site_id_display)site_id,
    max(a.site_name)site_name,max(a.region_name)region_name,
    count(decode(tsd.test_alias,'rd',tsd.test_alias))rd,
    count(decode(tsd.test_alias,'ss',tsd.test_alias))ss,
    count(decode(tsd.test_alias,'resk',tsd.test_alias))resk,
    count(decode(tsd.test_alias,'snmn',tsd.test_alias))snmn,
    count(decode(tsd.test_alias,'clm',tsd.test_alias))clm,
    count(decode(tsd.test_alias,'lgus',tsd.test_alias))lgus,
    count(decode(tsd.test_alias,'loeplis',tsd.test_alias))loeplis,
    count(decode(tsd.test_alias,'arit',tsd.test_alias))arit,
    count(decode(tsd.test_alias,'alge',tsd.test_alias))alge,
    count(decode(tsd.test_alias,'wp_i3',tsd.test_alias))wp_i3,
    count(decode(tsd.test_alias,'wp_esl',tsd.test_alias))wp_esl,
    count(decode(tsd.test_alias,'css',tsd.test_alias))css,
    count(decode(tsd.test_alias,'crd',tsd.test_alias))crd,
    count(decode(tsd.test_alias,'carit',tsd.test_alias))carit,
    count(decode(tsd.test_alias,'calge',tsd.test_alias))calge,
    count(decode(tsd.test_alias,'cclm',tsd.test_alias))cclm,
    count(decode(tsd.test_alias,'cresk',tsd.test_alias))cresk,
    count(decode(tsd.test_alias,'csnmn',tsd.test_alias))csnmn,
    count(decode(tsd.test_alias,'clgus',tsd.test_alias))clgus,
    count(decode(tsd.test_alias,'csp',tsd.test_alias))csp,
    count(decode(tsd.test_alias,'cspb',tsd.test_alias))cspb,
    count(decode(tsd.test_alias,'localtest',tsd.test_alias))localtest
    FROM test_detail td,test_session_detail tsd,test_session ts,vueinstitutionsite a
    WHERE td.test_detail_id = tsd.test_detail_id
    AND tsd.test_session_id = ts.test_session_id
    and a.inst_site_id = ts.institution_id
    AND TRUNC(test_start_date) BETWEEN to_date('08/27/2009', 'MM/DD/YYYY') AND to_date('09/02/2009', 'MM/DD/YYYY')
    GROUP BY ts.institution_id
    order by institution_id
    Plz help me ASAP
    thanks,
    Raj

    I'm posting DDL scripts as a two posts due to maximum exceeding length
    *5 tables are in Underlying view*
    1)INSTITUTION
      CREATE TABLE "CATTEMP"."INSTITUTION"
       (     "INSTITUTION_ID" NUMBER NOT NULL ENABLE,
         "LEVEL_TYPE_ID" NUMBER NOT NULL ENABLE,
         "REGION_CODE" VARCHAR2(4 BYTE) NOT NULL ENABLE,
         "BELONGS_TO" NUMBER NOT NULL ENABLE,
         "NAME" VARCHAR2(200 BYTE) NOT NULL ENABLE,
         "DESCRIPTION" VARCHAR2(200 BYTE),
         "ADDRESS_1" VARCHAR2(100 BYTE),
         "ADDRESS_2" VARCHAR2(100 BYTE),
         "CITY" VARCHAR2(30 BYTE),
         "STATE" VARCHAR2(30 BYTE),
         "ZIP" VARCHAR2(20 BYTE),
         "COUNTRY" VARCHAR2(30 BYTE),
         "LOCATION" VARCHAR2(30 BYTE),
         "PHONE" VARCHAR2(20 BYTE),
         "FAX" VARCHAR2(20 BYTE),
         "OTHER" VARCHAR2(30 BYTE),
         "INSTITUTION_CATEGORY" VARCHAR2(100 BYTE),
         "INSTITUTION_TYPE" VARCHAR2(30 BYTE),
         "IS_CB_MEMBER" CHAR(1 BYTE),
         "ATB_TESTING" CHAR(1 BYTE),
         "HOW_DID_YOU_HEAR" VARCHAR2(100 BYTE),
         "FIRST_LOGIN_DATE" DATE,
         "ACTIVE_STATUS" VARCHAR2(20 BYTE),
         "AVAILABLE_TEST_UNITS" NUMBER,
         "STUDENT_BODY_SIZE" VARCHAR2(30 BYTE),
         "CREATED_ON" DATE DEFAULT SYSDATE,
         "MODIFIED_ON" DATE DEFAULT SYSDATE,
         "CREATED_BY" NUMBER,
         "MODIFIED_BY" NUMBER,
         "ACCUPLACER_USER" CHAR(1 BYTE),
         "RESEND_MAIL_DATE" DATE,
         "LAST_ACTIVITY_DATE" DATE,
         "ACCT_ACTIVATION_DATE" DATE,
         "INSTITUTION_ID_DISPLAY" VARCHAR2(10 BYTE),
         "LAST_CB_UPDATE" DATE,
          CONSTRAINT "PK_INSTITUTION" PRIMARY KEY ("INSTITUTION_ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8001"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8002"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8003"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8004"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8005"
       TABLESPACE "CAT_IDX_TB5")  ENABLE,
          CONSTRAINT "UK_INSTITUTION" UNIQUE ("INSTITUTION_ID_DISPLAY")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT"  ENABLE,
          CONSTRAINT "FK_INSTITUTION1" FOREIGN KEY ("LEVEL_TYPE_ID")
           REFERENCES "CATTEMP"."LEVEL_TYPE_MASTER" ("LEVEL_TYPE_ID") ENABLE,
          CONSTRAINT "FK_INSTITUTION2" FOREIGN KEY ("REGION_CODE")
           REFERENCES "CATTEMP"."REGION" ("REGION_CODE") ENABLE,
          CONSTRAINT "FK_INSTITUTION3" FOREIGN KEY ("BELONGS_TO")
           REFERENCES "CATTEMP"."INSTITUTION" ("INSTITUTION_ID") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT)
      TABLESPACE "CAT_DATA"
      PARTITION BY HASH ("INSTITUTION_ID")
    (PARTITION "SYS_P8001"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8002"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8003"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8004"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8005"
       TABLESPACE "CAT_DATA") ;
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."LEVEL_TYPE_ID" IS 'IDENTIFIES WHETHER THIS IS AN INSTITUTION OR SITE';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."REGION_CODE" IS 'REGION TO WHICH THE INSTITUTION BELONGS TO';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."PHONE" IS 'PHONE NUMBER';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."FAX" IS 'FAX NUMBER';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."HOW_DID_YOU_HEAR" IS 'HOW DID YOU HEAR INFORMATION';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."FIRST_LOGIN_DATE" IS 'USED TO FIND FIRST LOGIN DATE INFORMATION';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."ACTIVE_STATUS" IS 'CURRENT ACTIVATION STATUS';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."AVAILABLE_TEST_UNITS" IS 'AVAILABLE TEST UNITS WITH THE INSITUTION';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."STUDENT_BODY_SIZE" IS 'STUDENT SIZE UNDER THE INSTITUTION';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."CREATED_ON" IS 'INSITUTION CREATION DATE';
       COMMENT ON COLUMN "CATTEMP"."INSTITUTION"."MODIFIED_ON" IS 'LAST MODIFIED DATE';
       COMMENT ON TABLE "CATTEMP"."INSTITUTION"  IS 'USED TO STORE THE DETAILS OF AN INSTITUTE (INSTITUTION, SITE)';
      CREATE INDEX "CATTEMP"."FK_INSTITUTION1_I" ON "CATTEMP"."INSTITUTION" ("LEVEL_TYPE_ID")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT" ;
      CREATE INDEX "CATTEMP"."FK_INSTITUTION2_I" ON "CATTEMP"."INSTITUTION" ("REGION_CODE")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT" ;
      CREATE INDEX "CATTEMP"."INSTITUTION_IDX1" ON "CATTEMP"."INSTITUTION" ("BELONGS_TO", "LEVEL_TYPE_ID", "ACTIVE_STATUS")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT" ;
      CREATE INDEX "CATTEMP"."INSTI_ID_NAME_COUN_DISP_IDX" ON "CATTEMP"."INSTITUTION" ("INSTITUTION_ID", "NAME", "COUNTRY", "INSTITUTION_ID_DISPLAY")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT_DATA" ;
      CREATE INDEX "CATTEMP"."INSTUTITION_NC_IDX" ON "CATTEMP"."INSTITUTION" ("NAME")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT_DATA" ;
      CREATE INDEX "CATTEMP"."INST_ID_DISP_IDX" ON "CATTEMP"."INSTITUTION" (SUBSTR("INSTITUTION_ID_DISPLAY",8,3))
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT_DATA" ;
      CREATE UNIQUE INDEX "CATTEMP"."PK_INSTITUTION" ON "CATTEMP"."INSTITUTION" ("INSTITUTION_ID")
      PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8001"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8002"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8003"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8004"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8005"
       TABLESPACE "CAT_IDX_TB5") ;
      CREATE UNIQUE INDEX "CATTEMP"."UK_INSTITUTION" ON "CATTEMP"."INSTITUTION" ("INSTITUTION_ID_DISPLAY")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT" ;2)COUNTRY
      CREATE TABLE "CATTEMP"."COUNTRY"
       (     "COUNTRY_CODE" VARCHAR2(10 BYTE) NOT NULL ENABLE,
         "COUNTRY_NAME" VARCHAR2(30 BYTE),
         "CREATED_ON" DATE DEFAULT SYSDATE,
         "MODIFIED_ON" DATE DEFAULT SYSDATE,
         "CREATED_BY" NUMBER,
         "MODIFIED_BY" NUMBER,
          CONSTRAINT "PK_COUNTRY" PRIMARY KEY ("COUNTRY_CODE")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P7936"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P7937"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P7938"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P7939"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P7940"
       TABLESPACE "CAT_IDX_TB5")  ENABLE,
          CONSTRAINT "UK_COUNTRY" UNIQUE ("COUNTRY_NAME")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT"  ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT)
      TABLESPACE "CAT_DATA"
      PARTITION BY HASH ("COUNTRY_CODE")
    (PARTITION "SYS_P7936"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P7937"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P7938"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P7939"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P7940"
       TABLESPACE "CAT_DATA") ;
      CREATE UNIQUE INDEX "CATTEMP"."PK_COUNTRY" ON "CATTEMP"."COUNTRY" ("COUNTRY_CODE")
      PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P7936"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P7937"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P7938"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P7939"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P7940"
       TABLESPACE "CAT_IDX_TB5") ;
      CREATE UNIQUE INDEX "CATTEMP"."UK_COUNTRY" ON "CATTEMP"."COUNTRY" ("COUNTRY_NAME")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT" ;
    3)REGION
      CREATE TABLE "CATTEMP"."REGION"
       (     "REGION_CODE" VARCHAR2(4 BYTE) NOT NULL ENABLE,
         "REGION_NAME" VARCHAR2(50 BYTE) NOT NULL ENABLE,
         "CREATED_ON" DATE DEFAULT SYSDATE,
         "MODIFIED_ON" DATE DEFAULT SYSDATE,
         "CREATED_BY" NUMBER,
         "MODIFIED_BY" NUMBER,
          CONSTRAINT "PK_REGION" PRIMARY KEY ("REGION_CODE")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8101"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8102"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8103"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8104"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8105"
       TABLESPACE "CAT_IDX_TB5")  ENABLE,
          CONSTRAINT "UK_REGION" UNIQUE ("REGION_NAME")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT"  ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT)
      TABLESPACE "CAT_DATA"
      PARTITION BY HASH ("REGION_CODE")
    (PARTITION "SYS_P8101"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8102"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8103"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8104"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8105"
       TABLESPACE "CAT_DATA") ;
      CREATE UNIQUE INDEX "CATTEMP"."PK_REGION" ON "CATTEMP"."REGION" ("REGION_CODE")
      PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8101"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8102"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8103"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8104"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8105"
       TABLESPACE "CAT_IDX_TB5") ;
      CREATE UNIQUE INDEX "CATTEMP"."UK_REGION" ON "CATTEMP"."REGION" ("REGION_NAME")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT" ;
    4)
    LEVEL_TYPE_MASTER
      CREATE TABLE "CATTEMP"."LEVEL_TYPE_MASTER"
       (     "LEVEL_TYPE_ID" NUMBER NOT NULL ENABLE,
         "LEVEL_TYPE_NAME" VARCHAR2(50 BYTE) NOT NULL ENABLE,
         "DESCRIPTION" VARCHAR2(100 BYTE),
         "CREATED_ON" DATE DEFAULT SYSDATE,
         "MODIFIED_ON" DATE DEFAULT SYSDATE,
         "CREATED_BY" NUMBER,
         "MODIFIED_BY" NUMBER,
          CONSTRAINT "PK_LEVEL_TYPE_MASTER" PRIMARY KEY ("LEVEL_TYPE_ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8031"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8032"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8033"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8034"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8035"
       TABLESPACE "CAT_IDX_TB5")  ENABLE,
          CONSTRAINT "UK_LEVEL_TYPE_MASTER" UNIQUE ("LEVEL_TYPE_NAME")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT"  ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT)
      TABLESPACE "CAT_DATA"
      PARTITION BY HASH ("LEVEL_TYPE_ID")
    (PARTITION "SYS_P8031"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8032"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8033"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8034"
       TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8035"
       TABLESPACE "CAT_DATA") ;
      CREATE UNIQUE INDEX "CATTEMP"."PK_LEVEL_TYPE_MASTER" ON "CATTEMP"."LEVEL_TYPE_MASTER" ("LEVEL_TYPE_ID")
      PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8031"
       TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8032"
       TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8033"
       TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8034"
       TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8035"
       TABLESPACE "CAT_IDX_TB5") ;
      CREATE UNIQUE INDEX "CATTEMP"."UK_LEVEL_TYPE_MASTER" ON "CATTEMP"."LEVEL_TYPE_MASTER" ("LEVEL_TYPE_NAME")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CAT" ;
    5)STATE
    CREATE TABLE "CATTEMP"."STATE"
    (     "STATE_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
         "STATE_CODE" VARCHAR2(10 BYTE),
         "COUNTRY_CODE" VARCHAR2(10 BYTE) NOT NULL ENABLE,
         "REGION_CODE" VARCHAR2(4 BYTE),
         "CREATED_ON" DATE DEFAULT SYSDATE,
         "MODIFIED_ON" DATE DEFAULT SYSDATE,
         "CREATED_BY" NUMBER,
         "MODIFIED_BY" NUMBER,
         CONSTRAINT "PK_STATE" PRIMARY KEY ("STATE_NAME", "COUNTRY_CODE")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(
    BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8131"
    TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8132"
    TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8133"
    TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8134"
    TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8135"
    TABLESPACE "CAT_IDX_TB5") ENABLE,
         CONSTRAINT "UK_STATE" UNIQUE ("STATE_CODE")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "CAT" ENABLE,
         CONSTRAINT "FK_STATE1" FOREIGN KEY ("COUNTRY_CODE")
         REFERENCES "CATTEMP"."COUNTRY" ("COUNTRY_CODE") ENABLE,
         CONSTRAINT "FK_STATE2" FOREIGN KEY ("REGION_CODE")
         REFERENCES "CATTEMP"."REGION" ("REGION_CODE") ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
    STORAGE(
    BUFFER_POOL DEFAULT)
    TABLESPACE "CAT_DATA"
    PARTITION BY HASH ("STATE_NAME","COUNTRY_CODE")
    (PARTITION "SYS_P8131"
    TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8132"
    TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8133"
    TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8134"
    TABLESPACE "CAT_DATA",
    PARTITION "SYS_P8135"
    TABLESPACE "CAT_DATA") ;
    CREATE INDEX "CATTEMP"."FK_STATE1_I" ON "CATTEMP"."STATE" ("COUNTRY_CODE")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "CAT" ;
    CREATE INDEX "CATTEMP"."FK_STATE2_I" ON "CATTEMP"."STATE" ("REGION_CODE")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "CAT" ;
    CREATE UNIQUE INDEX "CATTEMP"."PK_STATE" ON "CATTEMP"."STATE" ("STATE_NAME", "COUNTRY_CODE")
    PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(
    BUFFER_POOL DEFAULT) LOCAL
    (PARTITION "SYS_P8131"
    TABLESPACE "CAT_IDX_TB1",
    PARTITION "SYS_P8132"
    TABLESPACE "CAT_IDX_TB2",
    PARTITION "SYS_P8133"
    TABLESPACE "CAT_IDX_TB3",
    PARTITION "SYS_P8134"
    TABLESPACE "CAT_IDX_TB4",
    PARTITION "SYS_P8135"
    TABLESPACE "CAT_IDX_TB5") ;
    CREATE INDEX "CATTEMP"."STATE_NAME_CODE_IDX" ON "CATTEMP"."STATE" ("STATE_NAME", "STATE_CODE")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "CAT_DATA" ;
    CREATE INDEX "CATTEMP"."STATE_NAME_STATE_IDX" ON "CATTEMP"."STATE" ("STATE_NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "CAT_DATA" ;
    CREATE UNIQUE INDEX "CATTEMP"."UK_STATE" ON "CATTEMP"."STATE" ("STATE_CODE")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "CAT" ;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Plz help to make this query......very urgent

    I ve two tables <br>
    <br>
    First one is <b>grn_dtl</b> containing following fields     <br> <br> <br>
    <u><b>
    item_code        ent_dt       qty    doc_no </u></b><br>
    11001318        09/09/2003   5    56300501 <br>
    11001318        11/09/2004        9    56300502 <br>
    11001318        12/05/2005       2    56300503 <br>
    11001319        22/06/2004        0    56300504 <br>
    11001320        09/06/2005        0    56300505 <br>
    11001320        11/08/2004        8    56300506 <br>
    11001320        30/05/2005       4    56300507 <br>
    11001320        21/06/2003       1    56300508 <br>
    11001321        25/09/2004       1    56300509 <br>
    11001321        15/07/2004       1    56300510 <br>
    11001321        01/08/2004       2    56300511 <br>
    11001322        02/06/2004       1    56300512 <br>
    11001322        22/06/2004        2    56300513 <br>
    11001323        12/09/2004        1    56300514 <br>
    11001323        08/05/2004        4    56300515 <br>
    11001323        17/08/2004        5    56300516 <br>
    11001323        28/06/2004        2    56300517 <br>
    <br><br>
    second one is <b>item_mst</B> containing following fields     <br>
    <br>
    <u><b>          
    item_code         description         leadtim   kanbandate</u></b><br>
    11001318           aaaaaaaaaaa            15             22/04/2004<br>
    11001319           aaaaaaaaaaa           15             02/12/2004<br>
    11001320           aaaaaaaaaaa           15             14/07/2005<br>
    11001321           aaaaaaaaaaa           15              23/02/2004<br>
    11001322           aaaaaaaaaaa           15             05/10/2004<br>
    11001323           aaaaaaaaaaa           15             17/05/2004<br>
    11001324           aaaaaaaaaaa           15             27/12/2004<br>
    11001325           aaaaaaaaaaa           15             07/08/2004<br>
    <br><br><br><b>
    From the above two tables I want the combine SQL query which will display item_code its description ,kanbandate from item_mst table and will also display the minimum ent_dt of each corresponding item_code alongwith the qty and doc_no.the item_code should not be repeated .<br>
    I want to run the query from sql query analyzer</b><br><br>
    the result should be like this<br><br>
    <b></u>item_code  desc              ent_dt      qty    doc_no</b></u>
    <br>
    11001318       aaaaaaaaaaa        09/09/2003        5        56300501<br>
    11001319       aaaaaaaaaaa        22/06/2004       0        56300504<br>
    11001320       aaaaaaaaaaa        21/06/2003       1        56300508<br>
    11001321       aaaaaaaaaaa        15/07/2004        1       56300510<br>
    11001322       aaaaaaaaaaa        02/06/2004        1        56300513<br>
    11001323       aaaaaaaaaaa        08/05/2004        4       56300515<br>
    <br>
    <br>
    plz help me out ASAP
    null
    Message was edited by:
    aanchal_2008

    can you try this,
    SELECT DISTINCT im.item_code,
    im.descR,
    gd.ent_dt,
    gd.qty,
    gd.doc_no
    FROM item_mst im,
    grn_dtl gd
    WHERE im.item_code = gd.item_code (+)
    AND NOT EXISTS (
    SELECT 'later detail'
    FROM grn_dtl gd2
    WHERE gd2.item_code = gd.item_code
    AND gd2.ent_dt > gd.ent_dt)
    ITEM_CODE DESCR ENT_DT QTY DOC_NO
    11001318 aaaaaaaaaaa 2/12/2005 6 563005
    11001319 aaaaaaaaaaa 6/22/2004 0 563005
    11001320 aaaaaaaaaaa 6/9/2005 0 563005
    11001321 aaaaaaaaaaa 12/5/2005 5 563005
    11001322 aaaaaaaaaaa 6/22/2004 2 563005
    11001323 aaaaaaaaaaa 9/12/2004 1 563005
    11001324 aaaaaa
    11001325 aaaaaa
    8 rows selected

Maybe you are looking for

  • Problem in showing worksheet of discoverer in portal

    Hi All, I have created a worksheet in an user called BI. I have logged into Portal using user orcladmin. I have registered the portal provider. I have added the portlet in the portal page. I can see the public connect in the edit page. When i click n

  • I can't open Sony NEX-5 raw files with PS-CS6 and latest raw converter plug-in 7.1.

    When I try to open raw files from Sony NEX-5 instead of going to PhotoShop like all my NEF files, they go to another software suite that I have (On-One).  I am running MAC OS 10.7.5 with latest PS-CS6 and latest raw converter plug-in 7.1.  On-One see

  • How to specify for JVM the stack for ONE specific thread that invokes JNI

    Hello all! I'm 2 days now looking for a solution in several forums but even in Sun Java Forums nobody was able to come up with a solution. If you know a better forum to place it, please let me know. Description: I have an application that launches se

  • Customer exit - Web item

    Hi experts, BW 3.5 I have a question: The customer exit variable is the same in Bex Analyzer and in web item??? Because I have a message in step=3 and in the web item doesnt appear. any idea?

  • Text replacement in Maverick

    Text replacement in Maverick now requires a minimum of 2 characters so how does one replace a lower case "i" with an upper case "I"?