Advertisement

10.01.2008 at 11:03PM PDT, ID: 23780602
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Procedure for the " multiple in" parameter  in the query

Asked by kambleamar in Oracle 10.x, Oracle 8.x, Oracle 9.x

Tags:

Hello , Good evening
in Orcale 10g,
i am trying to write a dynamic query that sends a multple in paratemter to a Query ,
i will be using these query further in package  and execute it thru vb6.

please refer below , "pin_AircraftStatus" can have more then one value,
 currently i am trying to only print it it as the Expected output( i want the output given below at end)

declare

vstr_sql_query    VARCHAR2 (2500);
pin_AgreementId  VARCHAR2 (200);
pin_AircraftStatus VARCHAR2 (200);

begin    
    pin_AgreementId :='1';
    pin_AircraftStatus := 'FIR,PRO';
   
 vstr_sql_query :=  'SELECT cic.bcag_standard_designator |'|| '|-|' ||'|cic.common_customer_name as Customer,
                aag.adv_account_number as "Account Number",
                aag.purchase_agreement_num|'||'| - SA |'||'|arv.adv_sa_num as "Agreement Number"                
            FROM adv_aircraft_status aas,
                 customer_info_ccid cic,
                 adv_agreement aag,
                 adv_revision arv,
                 adv_aircraft aac,
                 adv_block abk
            WHERE cic.customer_reference_number = aag.customer_reference_number
             AND aas.adv_aircraft_status = aac.adv_aircraft_status
             AND aag.adv_agreement_id = aac.adv_agreement_id
             AND arv.adv_agreement_id = aac.adv_agreement_id
             AND aag.adv_agreement_id ='|| pin_AgreementId ||
             'AND aas.adv_aircraft_status IN ('|| pin_AircraftStatus || ')';
           
            dbms_output.put_line(vstr_sql_query);
end;
----------------------------------------------------------------------------------------------
Expected output
check the 1st and third line i want single quotes  around the "-" , example
cic.bcag_standard_designator || ' - ' ||cic.common_customer_name
Finallly the output Query also should execute in the normal Editor , you can try to by putting comma instead of "-"  for temporary. hope this explanation is satisfactory
----------------------------------------------------------------------------------------------

SELECT cic.bcag_standard_designator ||-||cic.common_customer_name as Customer,
                aag.adv_account_number as "Account Number",
                aag.purchase_agreement_num|| - SA ||arv.adv_sa_num as "Agreement Number"                
            FROM adv_aircraft_status aas,
                 customer_info_ccid cic,
                 adv_agreement aag,
                 adv_revision arv,
                 adv_aircraft aac,
                 adv_block abk
            WHERE cic.customer_reference_number = aag.customer_reference_number
             AND aas.adv_aircraft_status = aac.adv_aircraft_status
             AND aag.adv_agreement_id = aac.adv_agreement_id
             AND arv.adv_agreement_id = aac.adv_agreement_id
             AND aag.adv_agreement_id =1
            AND aas.adv_aircraft_status IN (FIR,PRO) ------> probelm lies here i cannot run the query with multiple input

Start Free Trial
 
Loading Advertisement...
 
[+][-]10.02.2008 at 04:21AM PDT, ID: 22623006

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 04:50AM PDT, ID: 22623182

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 06:10AM PDT, ID: 22623799

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 06:19AM PDT, ID: 22623896

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 09:36PM PDT, ID: 22631165

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 10:04PM PDT, ID: 22631279

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 10:38PM PDT, ID: 22631375

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Oracle 10.x, Oracle 8.x, Oracle 9.x
Tags: Oracle SQL
Sign Up Now!
Solution Provided By: GGuzdziol
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628