Using IN Operator in Query Parameter querying an Oracle dataset

I have created a main data set querying from Oracle in which I have two query parameters that are multi-valued lists.  I created a data set for each of those multi-valued lists.  These two parameters are configured to be multi-valued and selected
from the query.  On the main data set, the parameters are set to an expression: = Join(Parameter.Field.Value, ",").  If I sent just one value as a default in each of those parameters, works great.  If I select "Select All"
in my drop down and rerun the report then I get "Query execution failed for dataset" and "rsErrorExecutingCommand".  I am using Report Builder 3.0.  I have seen some older posts saying you have to use a stored procedure to generate
a string from the selects to be passed to the parameter?  I don't get this.  Obviously I want to stick with using a query parameter for the performance gain.  Is there an easy way to make this work?
Grateful for any help!  Laurie

Laurie, you are right that the execution time is too long.  Your instinct is correct to put the burden on the database to return the correct resultset, rather than filtering it in the report.  
I think I wasn't clear about my explanation and you may have made this more complicated than it needs to be.  The functionality that you want is already in ReportBuilder.  Please check out this example from MS:
http://technet.microsoft.com/en-us/library/aa337396(v=sql.105).aspx
This is the correct syntax:
AND soh.SalesPersonID IN (@BusinessPersonID)
 Is this how you have your query configured? If not, could you supply an example.
Hope that helps,
Mark

Similar Messages

  • Using OR operator in the WHERE clause in Oracle BI

    Hi, i am using Oracle BI EE 10.1.3.3.3.
    I construct the simple report in BI Answers on the Accounts presentation layer, and use the following filter clause:
    "WHERE (AccountNum BETWEEN '441' and '473') OR (БалСчет1Порядка BETWEEN '501' and '519')"
    Then i look in the cursor cache and find the real query which is going to database, and it's "where" clause now is:
    "where ( (T45172.BA >= '441' or T45172.BA >= '501') and
    (T45172.BA >= '441' or T45172.BA <= '519') and
    (T45172.BA >= '501' or T45172.BA <= '473') and
    (T45172.BA <= '473' or T45172.BA <= '519') ) "
    Why BI create so many expressions instead of the source 2 expressions?
    How can i force BI to use the source expressions?

    I have the same settings too.
    I post the following query in the Administration web interface, and set the maximum logging level (7):
    SELECT "Plan Account"."Balance Account" saw_0
    FROM "Plan Account"
    WHERE ("Plan Account"."Balance Account" between '441' and '473')
    OR ("Plan Account"."Balance Account" between '501' and '519')
    ORDER BY saw_0
    And got the following BI execution plan:
    RqList <<5619441>> [for database 0:0,0] distinct D1.c1 as c1 [for database 3023:44913,46]
    Child Nodes (RqJoinSpec): <<5619450>> [for database 3023:44913:DB,46]
    RqList <<5619277>> [for database 3023:44913:DB,46]
    D1.c1 as c1 GB [for database 3023:44913,46]
    Child Nodes (RqJoinSpec): <<5619360>> [for database 3023:44913:DB,46]
    RqList <<5619284>> [for database 3023:44913:DB,46]
    Dim - Plan Account.BA as c1 GB [for database 3023:44913,46]
    Child Nodes (RqJoinSpec): <<5619350>> [for database 3023:44913:DB,46]
    TB_PLAN_ACCOUNT T45172
    DetailFilter: (not Dim - Plan Account.BA < '441' or not Dim - Plan Account.BA < '501') and (not Dim - Plan Account.BA < '441' or not '519' < Dim - Plan Account.BA) and (not Dim - Plan Account.BA < '501' or not '473' < Dim - Plan Account.BA) and (not '473' < Dim - Plan Account.BA or not '519' < Dim - Plan Account.BA) [for database 0:0]
    ) as D1
    ) as D1
    OrderBy: c1 asc [for database 0:0,0]
    and following query sent to database:
    -------------------- Sending query to database named DB (id: <<5619277>>):
    select distinct D1.c1 as c1
    from
    (select distinct T45172.BA as c1
    from
    TB_PLAN_ACCOUNT T45172 /* Dim - Plan Account */
    where ( (T45172.BA >= '441' or T45172.BA >= '501') and (T45172.BA >= '441' or T45172.BA <= '519') and (T45172.BA >= '501' or T45172.BA <= '473') and (T45172.BA <= '473' or T45172.BA <= '519') )
    ) D1
    So, i got the same bad where clause...
    What can you advice?

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

  • Can a single quote be used at the beginning of a query string parameter

    Hi all,
    I am a relative newbie and have a newbie question.
    Can a single quote be used at the beginning of a query string parameter passed to a jsp page? Are there any inherant problems with this? Is there a comprehensive list of characters that must be escaped in a query string parameter?
    Example: http://mysite.com/myjsp.jsp?param1='nghdh
    Thanks

    You'll have to escape most non-letter characters before you can pass them as a URL. I don't know if it's necessary for a single quote, but better safe than sorry.
    Either use java.net.URLEncoder(...) or use javax.servlet.http.HttpServletResponse.encodeURL(String). I wouldn't recommend using unescaped characters in your URLs, that might cause pretty funny behavior that's sometimes hard to trace back. Don't worry about decoding it, your JSP/Servlet container will do it when you call javax.servlet.http.HttpServletRequest.getParameter(String).

  • SSRS countrow Aggregate error(Aggregate and lookup functions cannot be used in query parameter expressions.)

    Below expression works fine with text box but gives error in dataset expression.
    ="SET FMTONLY OFF select  "+ join(Parameters!Column.Value,",") +" FROM pamcustom.dbo.vw_HFL_HFD_HotfileData INNER JOIN pamcustom.dbo.HFL_HFB_HotFileBatch  on BatchID = HFB_intBatchID where BatchID ="+Parameters!BatchId.Value+"
    and "+Parameters!cmbTranType.Value+" "+ iif(CountRows("DS_Aml_Mnr_Iss_Desc")=Parameters!Mnr_Iss_Desc.count," "," and aml_mnr_iss_desc in "+"('" & join(Parameters!Mnr_Iss_Desc.Value,"','")
    & "')")+iif(CountRows("ds_ReportingCategory")=Parameters!ReportingCategory.count," "," and ReportingCategory in "+"('" & join(Parameters!ReportingCategory.Value,"','") & "')")+iif(CountRows("ds_NAICSubGroup")=Parameters!NAICSubGroup.count,"
    "," and naicsubgroup in "+"('" & join(Parameters!NAICSubGroup.Value,"','") & "')")+iif(CountRows("ds_PortTrading")=Parameters!PortTrading.count," "," and porttrading in "+"('"
    & join(Parameters!PortTrading.Value,"','") & "')")+iif(CountRows("ds_GL_LE")=Parameters!GL_LE.count," "," and gl_le in "+"('" & join(Parameters!GL_LE.Value,"','") &
    "')")+iif(CountRows("ds_coagroup")=Parameters!cmbCoaGrp.count," "," and coagroup in "+"('" & join(Parameters!cmbCoaGrp.Value,"','") & "')")+iif(CountRows("Portfolio")=Parameters!cmbPort.count,"
    "," and portfolio in "+"('" & join(Parameters!cmbPort.Value,"','") & "')")+IIf(IsNothing(Parameters!txtSecID.Value)," "," and secid in ('"+Replace(Parameters!txtSecID.Value,",","','")+"')")+iif(IsNothing(Parameters!minPortFilter.Value)
    and IsNothing(Parameters!MinPort.Value)," "," and portfolio "+Parameters!minPortFilter.Value+Parameters!MinPort.Value)+iif(IsNothing(Parameters!maxPortFilter.Value) and IsNothing(Parameters!MaxPort.Value)," ","
    and portfolio "+Parameters!maxPortFilter.Value+Parameters!MaxPort.Value)+iif(IsNothing(Parameters!minCoaFilter.Value) and IsNothing(Parameters!txtMinCoa.Value)," "," and portfolio "+Parameters!minCoaFilter.Value+Parameters!txtMinCoa.Value)+iif(IsNothing(Parameters!maxCoaFilter.Value)
    and IsNothing(Parameters!txtMaxCoa.Value)," "," and portfolio "+Parameters!maxCoaFilter.Value+Parameters!txtMaxCoa.Value)
    I guess the error " Aggregate and lookup functions cannot be used in query parameter expressions." is because I am using CountRow to ensure that if all values of multi select all selected i will not use that filter in where clause.
    Pls. guide...

    Hi, Include your parameter total count in the dataset for parameter and instead of using countrows() function use the count from dataset in the expression.
    Hope this helps.........
    Ione

  • Problem when using About Operator in Contains Query

    Hi,
    I'm new to Oracle and this forums too. I have a problem when using about operator in contains query.
    I create a table with some records and then create a context index on 'name' column.
    CREATE TABLE my_items (
      id           NUMBER(10)      NOT NULL,
      name         VARCHAR2(200)   NOT NULL,
      description  VARCHAR2(4000)  NOT NULL,
      price        NUMBER(7,2)     NOT NULL
    ALTER TABLE my_items ADD (
      CONSTRAINT my_items_pk PRIMARY KEY (id)
    CREATE SEQUENCE my_items_seq;
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Car', 'Car description', 1);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Train', 'Train description', 2);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Japan', 'Japan description', 3);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'China', 'China description', 4);
    COMMIT;
    EXEC ctx_ddl.create_preference('english_lexer','basic_lexer');
    EXEC ctx_ddl.set_attribute('english_lexer','index_themes','yes');
    EXEC ctx_ddl.set_attribute('english_lexer','theme_language','english');
    CREATE INDEX my_items_name_idx ON my_items(name) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('lexer english_lexer');
    EXEC ctx_ddl.sync_index('my_items_name_idx');Then I perform contains query to retrieve record :
    SELECT count(*) FROM my_items WHERE contains(name, 'Japan', 1) > 0;
    COUNT(*)
          1
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Japan)', 1) > 0;
    COUNT(*)
          1But the problem is when I using ABOUT operator like in Oracle's English Knowledge Base Category Hierarchy it return 0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Asia)', 1) > 0;
    COUNT(*)
          0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(transportation)', 1) > 0;
    COUNT(*)
          0I can't figure out what 's wrong in my query or in my index.
    Any help will be appreciated.
    Thanks,
    Hieu Nguyen
    Edited by: user2944391 on Jul 10, 2009 3:25 AM

    Hello (and welcome),
    You'd be best asking this question in the Oracle Text forum, here:
    Text
    And by the way, it will help others to analyse if you put {noformat}{noformat} (lowercase code in curly brackets) before and after your code snippets.
    Good luck!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to use a subquery in query parameter in exp command

    I am trying to export certain rows of a table using exp command
    exp TRA/simple@TRA consistent=y indexes=n constraints=n tables=TRA$EMPL query=\"where deptid in \(select objectid from Person\)\" file=/dbase/dump/archv.2009-10-2917:24:00.dmp
    but im getting an error
    LRM-00112: multiple values not allowed for parameter 'query'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully

    On what OS you are trying to do that ?
    What oracle version ?
    Did you try to use parameter file ?
    Have in mind that when using parameter file , special characters don't need to be escaped.

  • Export using a QUERY parameter

    I am trying to export a subset of data using the following parms:
    FILE=C:\EXPORT\ADM_ACCESS_LOG.DMP
    GRANTS=Y
    INDEXES=Y
    DIRECT=N
    ROWS=Y
    CONSISTENT=N
    TRIGGERS=Y
    CONSTRAINTS=Y
    FEEDBACK=1000
    TABLES=(THRESHER.ADM_ACCESS_LOG)
    QUERY=\"WHERE LOGIN_DT='31-JUL-2005'\"
    The table exists as does the column, however, I get the following error:
    LRM-00101: unknown parameter name 'LOGIN_DT'
    I have everything spelled correctly and I am logging into export as thresher.
    What am I doing wrong?
    Thanks

    use the query parameter like this
    QUERY="WHERE to_char(dte,'mm/dd/yyyy')='07/31/2005'"
    or
    QUERY="WHERE to_char(dte,'dd-mon-yyyy')='31-JUL-2005'"
    --thedba                                                                                                                                                                                                                                                                                                                                           

  • How to use 'about' operator in Full text search query?

    Hi all,
    I have to search the following string in full text index using 'about' operator.
    'Advertisment(Cosmetics) Assets'
    If use the following query
    SELECT keyword_id
    FROM mam_keyword_languages
    WHERE contains(fts_text_uc, convert('about(Advertisment(Cosmetics) Assets)',
    'WE8MSWIN1252', 'WE8MSWIN1252')) > 0
    ORDER BY nlssort(text, 'NLS_SORT=EEC_EUROPA3')
    It gives following error.
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-50901: text query parser syntax error on line 1, column 37
    How can i do this search? Is there any other way?
    Thanx in advance.
    T.Umapathy

    Sum((postab.subtotal)*(loc.royalty)/100)
    Is there any other way to take product of two
    attributs? your help will be greatly appreciated as
    it is really stumbling block in my project. Thanks in
    advanceSuch a stumbling block should have inspired more activity on your part.
    I'd try rewriting it like this:
    sum(postab.subtotal*loc.royalty/100)[/b]%

  • Writing query using UNION Operator

    Question -
    (1)
    Write an SQL Statement to list the following items: Customer ID, Customer Name, number of invoices, sum of total for invoices. Ensure that all customers are returned in the result set.
    Answer for the above is written as below by one person. That seams to be correct. Is there another way of writing this same query.;
    select c.CUSTOMER_ID,c.NAME,i.cnt,i.s
    from gee_customer c,(select customer_id,count(*) as cnt, sum(TOTAL) as s
    from gee_invoice
    group by customer_id) i
    where c.CUSTOMER_ID = i.customer_id (+)
    (2)
    My other question is How to write the above answer (or what you sugest) using UNION operator ?
    Any ideas please
    Message was edited by:
    user483578

    In fact the outer join means you use the union of two result sets - usual join result
    and the rows from the outer table for which there is not any row in the inner table.
    SQL> select d.deptno, e.ename from emp e, dept d
      2  where d.deptno = e.deptno(+)
      3  order by 1,2
      4  /
        DEPTNO ENAME
            10 CLARK
            10 KING
            10 MILLER
            20 ADAMS
            20 FORD
            20 JONES
            20 SCOTT
            20 SMITH
            30 ALLEN
            30 BLAKE
            30 JAMES
            30 MARTIN
            30 TURNER
            30 WARD
            40
    15 rows selected.
    SQL> select d.deptno,e.ename from emp e, dept d
      2  where d.deptno = e.deptno
      3  union
      4  select deptno, null
      5  from dept d where not exists (select null from emp e where e.deptno = d.deptno)
      6  order by 1,2
      7  /
        DEPTNO ENAME
            10 CLARK
            10 KING
            10 MILLER
            20 ADAMS
            20 FORD
            20 JONES
            20 SCOTT
            20 SMITH
            30 ALLEN
            30 BLAKE
            30 JAMES
            30 MARTIN
            30 TURNER
            30 WARD
            40
    15 rows selected.In your example something like (NOT tested !)
    with i as (select customer_id,count(*) as cnt, sum(TOTAL) as s
    from gee_invoice group by customer_id)
    select c.CUSTOMER_ID,c.NAME,i.cnt,i.s
    from gee_customer c, i
    where c.CUSTOMER_ID = i.customer_id
    union
    select c.CUSTOMER_ID,c.NAME,null,null
    from gee_customer c
    where not exists (select null from i where c.CUSTOMER_ID = i.customer_id)
    Rgds.

  • How to pass variable into lov sql query using like operator

    hi.
    i want to use a lov where i want to pass a variable using like operator.
    my query is
    select empno,name from table where empno like ':ed%';
    my empno is A001 TO A199 AND B001 TO B199 so i want show either A% or B% empno
    how can i do this ?
    reagrds

    kindly press Shift+F1 at a time you face this error to see the exact Oracle error message.
    and provide us with that detail
    and its better if you start new topic for that error... because that will be new error,,,
    -- Aamir Arif
    Edited by: Aamiz on Apr 7, 2010 12:27 PM

  • Using XML Operation Tags to query by date

    Problem 1:
    When I use timestamps from items' XML to form queries on repositories, I receive SQL errors.
    Problem 1 Example:
    Query the PublishingRepository to find all active projects created on August 16.
    In Dynamo Administration, navigate to /atg/epub/PublishingRepository
    In the box labeled "Run XML Operation Tags on the Repository," enter the following tag:
        <query-items item-descriptor="project">status = "Active" AND creationDate = "08/16/2013"</query-items>
    Result: java.sql.SQLDataException: ORA-01843: not a valid month
    Problem 1 Solution:
    Use this query instead:
    <query-items item-descriptor="project">
    status = "Active"
    AND
    creationDate = date("2013-08-16")
    </query-items>
    Problem 2:
    Using the "<" operator to construct a less-than argument doesn't work.
    Problem 2 Example:
    Query the PublishingRepository to find all active projects created before August 16.
    In Dynamo Administration, navigate to /atg/epub/PublishingRepository
    In the box labeled "Run XML Operation Tags on the Repository," enter the following tag:
        <query-items item-descriptor="project">status = "Active" AND creationDate < date("2013-08-16")</query-items>
    Result: SOURCE:org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
    Problem 2 Solution:
    For some reason, the ">" greater-than operator seems to work fine, even when the "<" less-than operator won't. You can switch around the order of the query to get the desired result:
    <query-items item-descriptor="project">
    status = "Active"
    AND
    date("2013-08-16") > creationDate
    </query-items>

    Problem 1:
    When I use timestamps from items' XML to form queries on repositories, I receive SQL errors.
    Problem 1 Example:
    Query the PublishingRepository to find all active projects created on August 16.
    In Dynamo Administration, navigate to /atg/epub/PublishingRepository
    In the box labeled "Run XML Operation Tags on the Repository," enter the following tag:
        <query-items item-descriptor="project">status = "Active" AND creationDate = "08/16/2013"</query-items>
    Result: java.sql.SQLDataException: ORA-01843: not a valid month
    Problem 1 Solution:
    Use this query instead:
    <query-items item-descriptor="project">
    status = "Active"
    AND
    creationDate = date("2013-08-16")
    </query-items>
    Problem 2:
    Using the "<" operator to construct a less-than argument doesn't work.
    Problem 2 Example:
    Query the PublishingRepository to find all active projects created before August 16.
    In Dynamo Administration, navigate to /atg/epub/PublishingRepository
    In the box labeled "Run XML Operation Tags on the Repository," enter the following tag:
        <query-items item-descriptor="project">status = "Active" AND creationDate < date("2013-08-16")</query-items>
    Result: SOURCE:org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
    Problem 2 Solution:
    For some reason, the ">" greater-than operator seems to work fine, even when the "<" less-than operator won't. You can switch around the order of the query to get the desired result:
    <query-items item-descriptor="project">
    status = "Active"
    AND
    date("2013-08-16") > creationDate
    </query-items>

  • How to write the given query using 'ANY ' operator

    Hi,
    How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
    SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
    And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
    1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
    2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
    3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
    thanks
    rincy

    Hi,
    One thing I understood my your issue is you want to perform, execution of query once or fetch the results sets my minimizing the number of times executions of queries. It would be hard for us to check in this way, atleast provide some temporary data and some business rules. Only I can IN, >, < (queries logical conditons on inner query)
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

  • To re-write query using 'ANY' operator

    Hi,
    How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
    SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
    And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
    1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
    2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
    3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
    thanks
    rincy

    Tubby is correct that data and create statements are required to analyze it correctly.
    Still I worked on it and created something using WITH clause
    with grd_query
    as
    (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade')
    ,grd_mst_query
    as
    (SELECT grd_code, grd_osm_code FROM grade_master)
    SELECT dsg_code, dsg_name, dsg_grade
      FROM designation_master
    WHERE dsg_orgn = '&&Orgn'
       AND dsg_ctry = '&&ctry'
       AND dsg_loc = '&&loc'
       AND dsg_oru = '&&oru'
       AND dsg_grade in   
       decode('&&radio_group',1, (SELECT grd_code FROM grd_mst_query WHERE grd_osm_code in (select * from grd_query)),
    2, (SELECT grd_code FROM grd_mst_query WHERE grd_osm_code > (select * from grd_query)),
    3, (SELECT grd_code FROM grd_mst_query WHERE grd_osm_code < (select * from grd_query)))this should avoid multiple scans on same table.
    thanks

  • Problem in using query parameter in exp(9.2)

    Hi Folks,
    I'm not able to take export from a table with query option on a Solaris machine. here is my parameter file which has query parameter in it. I'm also posting error message.
    file=utf_exp_raw_citation.dmp
    log=utf_exp_raw_citation.log
    owner=utf8admin
    statistics=none
    tables=raw_citation
    query=\"where nvl(source,'AAA') in ('EMC','HMD','HSR','KIE','NASA','PIP','AAA')"\
    rows=y
    Error:-*
    $ exp utf8admin/[email protected] parfile=exp_raw_citation_07_01_2011_new.dat
    LRM-00116: syntax error at ')' following 'AAA'
    LRM-00113: error when processing file 'exp_raw_citation_07_01_2011_new.dat'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully
    Please help me in this.
    regards
    Krishna Prasad Donepudi

    I suggest you utilize a parameter file to avoid the shell messing with metacharacters on command line

Maybe you are looking for

  • Phantom managed originals

    I've got a very interesting situation with managed originals I didn't think was possible - the database seems to have lost track of them; I've got originals in my aperture library package which don't show in the library in aperture. Those particulars

  • How does Time Capsule handle the same files on multiple computers?

    I'm a writer who works on my MacBook Pro, the family's desktop PC and soon hope to have my own Apple desktop. Is it possible to have the most current document(s) available no matter which machine I'm on? Does Time Capsule go to each computer, find th

  • Problem while generating pertner profile

    hi , all. while sending master data through ale we need to configure bd64(model view) and go to menu-environment-generate partner profiles--when i am doing that i am getting a message as   NO MESSAGE HAVE  BEEN DEFINED FOR SELECTION CONDITION IN THE

  • Custom AxisRenderer's?

    I'm trying to roll my own custom AxisRenderer and am a bit overwhelmed by the bizarre gutter computations.  Does anyone have examples or advice on how to define the size and placement of the rendererers?  The best I've been able to do is have a singl

  • Error message -1202 in iTunes unable to actviate iPhone

    Apple is useless and clueless on helping. After they had me uninstall iTunes and re-install still same issue. Now that it was past 10 pm EST both Apple & ATT were closed. Now I have no phone because ATT disconnected my 3GS without verifing that my ne