Home » SQL & PL/SQL » SQL & PL/SQL » would i be able to run this query
would i be able to run this query [message #601798] Mon, 25 November 2013 23:17 Go to next message
nataliafoster26
Messages: 64
Registered: October 2013
Member
my toad for oracle is not right now i have to fix something,
but just wondering how i would run this query
begin  
        with       
            base_prop as (                                     
                select /*+ MATERIALIZE */ property_id, priority  
                from   PM_EXCHANGE_PROPERTY_PRIORITY ppp  
                where  ppp.exchange_affiliation = g_proc_name  
                and    ppp.master_property_id in (select ppp2.master_property_id  
                                                             from   P_PM_PROPERTY ppp1, PM_EXCHANGE_PROPERTY_PRIORITY ppp2  
                                                             where  ppp1.rci_id_number = rci_dep_rec.resort_id  
                                                             and    ppp1.property_active = 'Y'  
                                                            and    ppp1.exchange_affiliation = ppp.exchange_affiliation  
                                                             and    ppp2.property_id = ppp1.property_id)  
                union  
                select property_id, 99999  
                from   P_PM_PROPERTY ppp  
                where  ppp.rci_id_number = rci_dep_rec.resort_id  
                and    ppp.property_active = 'Y'  
                and    not exists (select 1 from PM_EXCHANGE_PROPERTY_PRIORITY ppp1 where ppp1.property_id = ppp.property_id)   
                order by 2  
            )  
        select pput.pm_unit_type_id  
      bulk collect into pm_unit_type_ids  
       from   P_PM_UNIT_TYPE pput, S_PM_EXCHANGE_MAPPING spem, base_prop bp  
       where  spem.exchange_affiliation = g_proc_name  
       and    spem.resortcode = rci_dep_rec.resort_id  
       and    ((spem.unitnumber = rci_dep_rec.unit_no and rci_dep_rec.resv_type = 'WEEKS')  
              or  (spem.unitnumber = rci_dep_rec.unit_type and rci_dep_rec.resv_type = 'POINTS'))  
       and    rci_dep_rec.start_dt between spem.begin_date and spem.end_date  
       and    pput.property_id = spem.property_id  
       and    pput.pm_unit_type_active = 'Y'  
       and    instr(spem.unittypecode, pput.pm_unit_type) > 0  
       and    spem.property_id = bp.property_id  
       ORDER BY bp.priority,pput.pm_unit_type_priority;  
    end;  


i was able to run this query before my toad went down,
select /*+ MATERIALIZE */ property_id, priority  
                from   PM_EXCHANGE_PROPERTY_PRIORITY ppp  
                where  ppp.exchange_affiliation = 'EZY'  
                and    ppp.master_property_id in (select ppp2.master_property_id  
                                                             from   P_PM_PROPERTY ppp1, PM_EXCHANGE_PROPERTY_PRIORITY ppp2  
                                                             where  ppp1.rci_id_number = '8789'  
                                                             and    ppp1.property_active = 'Y'  
                                                            and    ppp1.exchange_affiliation = 'RCI,II'  
                                                             and    ppp2.property_id = 'VDR')  
           
        union  
                select property_id, 99999  
                from   P_PM_PROPERTY ppp  
                where  ppp.rci_id_number ='8789'  
                and    ppp.property_active = 'Y'  
                and    not exists (select 1 from PM_EXCHANGE_PROPERTY_PRIORITY ppp1 where ppp1.property_id = 'VDR')   
                order by 2  

not sure how i would set up the first query to see the results, any tips would be appreciated
Re: would i be able to run this query [message #601799 is a reply to message #601798] Mon, 25 November 2013 23:26 Go to previous messageGo to next message
BlackSwan
Messages: 23065
Registered: January 2009
Senior Member
>my toad for oracle is not right now i have to fix something,
Problem Exists Between Keyboard And Chair

Please post TOAD issues in any TOAD forum; not here
Re: would i be able to run this query [message #601816 is a reply to message #601799] Tue, 26 November 2013 00:16 Go to previous message
Littlefoot
Messages: 19823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
nataliafoster26
how i would run this query

Do you have any other client available? SQL Developer? SQL*Plus? If so, use it instead of TOAD.
Previous Topic: ORA-01001: invalid cursor
Next Topic: get data from column name with "รถ" (M$ SQL, JDBC) and import it with sqlldr to Oracle
Goto Forum:
  


Current Time: Fri Nov 28 14:35:54 CST 2014

Total time taken to generate the page: 0.07882 seconds