Use only entered parameters in query

Hi friends I am defining 6 parameters for my sql.
  Select Trart Tbnum Nltyp Nlpla Vltyp Vlpla
    Into Corresponding Fields Of Wa_Itab
    From Ltbk
    Where Statu <> 'E'
      And Lgnum = PALGNUM
      And Nlpla = PaNlpla
      And Vltyp = PaVltyp
      And Trart = PaTrart
      And Tbnum = PaTbnum.
But when I am not entered any value for PaVltyp. But when I execute this query sql looking Vltyp = ''
Generally I am using IN operator for this. But this variable is not a range or internal table.
How can I execute my query without free parameters?
Sorry for my bad english. I wish you can understand me ?

Hi mehmet,
1. For Free selection,
    we have to compulsarily use IN (and not =)
2. For that we have to use SELECT-OPTIONS
  (We can Make select option
   LOOK JUST LIKE PARAMETER)
  and use IN inside the sql.
3. To get a taste of it, just copy paste
4.
report abc.
TABLES : MARA.
SELECT-OPTIONS : MATNR FOR MARA-MATNR
<b>NO INTERVALS NO-EXTENSION.</b>
regards,
amit m.

Similar Messages

  • How to query on a single row form using only one page

    Hi APEX experts, I am just a beginner in apex and I face several problems on development. Despite that the forum helps me a lot and your answers to other people are valuable , I have stacked into something. Could you please someone tell me : if there is a way to define a single row form page based on table in which I could query and update without using a tabular page (to call the single row form). I want only to use only one page. Does APEX has this functionality? Thank you very much?

    I haven't tried it, but I am going to guess that yes it's possible (or if I were going to do this, this is what I'd try and I suspect it will work).
    If you take a moment and step back and look at what the wizard does when building a "form on a table with report", all it does is build two pages with page 1 (report overview with drill-down Edit button or link usually) calling page 2 (form) and setting the PK field on the page 2 form with an automated row fetch process and built-in DML processes. It's not that hard.
    Page 2 really doesn't care what the calling page was in order to query a single row; it just cares that ANY caller sets the primary key value for the ARF process to fetch a row. So I would just make page 2 call itself. This is what I'd do (and you might have to fine-tune little things that I might not have forseen but I think this will work).
    For the sake of example, let's say our table is PARTS and in it is a PART_ID, PART_NUMBER, PART_DESCRIPTION, PART_COST, etc. Assume PART_ID is the primary key and sequentially assigned by the DB in a trigger and is functionally meaningless to the user and is for PK purposes only. Let's assume PART_NUMBER is a unique key (although not the PK) by which the user will "know" a unique row (since the PK of PART_ID is more internal and not meaningful to the user). Assume PART_DESCRIPTION, PART_COST, etc. are just attributes.
    1. Use the wizard and build a "form on a table with report". This is just to get the handy dandy ARF process and DML processes, validations, etc. all generated for you. Let's assume the report page is Page 1 and the form is Page 2.
    2. When done, delete the report page entirely (so delete page 1).
    3. Edit the form page (page 2) and change any branch references from the nonexistent page 1 to now be page 2.
    Now here's the part where something has to set the internal P2_PART_ID field when page 2 is run. So why not set it from itself from something the user will uniquely enter?
    4. Create a P2_PART_NUMBER_FETCH item (text item is fine or if you want a LOV or whatever that's good too....whatever works. For clarity, you might even want to create a separate "search" or "query" region separate and above your existing form region to set this field apart visually so users know it's a search field. Source for this field should be "only when current value in session state is null".
    5. Created some sort of "GO" button to go along with the P2_PART_NUMBER_FETCH field.
    6. Make sure none of your existing post-submit processes fire when GO is pressed (edit all of the computations and validations and processes and ensure that they have conditions such that they do not fire when the submit value is "GO", so like a PL/SQL expression and set to v('REQUEST')<> 'GO').
    7. Add a new validation to your page that only fires when GO is pressed. Have it validate only when GO is pressed. Have it validate that P2_PART_NUMBER_FETCH is not null.
    8. Add a new PL/SQL process to your post-submit processing that only fires when GO is pressed. Have it look up to the database based on P2_PART_NUMBER_FETCH and get the PART_ID that corresponds to the part number the user entered and set the part number, something like this (even better for style and reusability if you embed this in a DB package function and call it):
    SELECT part_id
    INTO :P2_PART_ID
    FROM PARTS
    WHERE PART_NUMBER = :P2_PART_NUMBER_FETCH;
    9. Not sure if the branches that were generated will suffice for this (might need to add a new one...review what you have and see) but the bottom line is that the page should branch to itself (page 2) and not clear the cache.
    10. When the page repaints, since :P2_PART_ID is now populated in session state (again, page 2 should not care how it got populated...only should care that it did get populated by anything (including itself)), the automated row fetch (ARF) should fire and query up the row from the database for editing.

  • Problem of using Parameters in Query templates

    Hi,
      how do use parameter values in SQL query in query templates? i have 2 field database no1, no2. i want to filter it by no2 by using param. i gave in filter field of query template as order1.no2 like '[Param.1]' and in parameters as % and clicked set. when i test it, it is showing error..
    help me.
    - senthil

    Hi,
       I tried that mode is query, filter expr is order1.no2 like '[Param.1]'  and  in parameters % . It is showing all the cols.
    -vijaya

  • Multi Row Selector using Generic Column Names (parse query at runtime only)

    Hi,
    I created a tabular report which had a multi row select in it - got the deleting working fine.
    Am now creating a second tabular report, but because of the SQL:
    select
    "ID",
    "ID" ID_DISPLAY,
    "RESNUMBER",
    "RESDESCRIPTION",
    decode(RESTYPE,'R','Right Party','W','Wrong Party'),
    decode(DMCFLAG,'Y','Yes','N','No'),
    decode(SALEFLAG,'Y','Yes','N','No')
    from "CALL_RESULTS"
    I have to select the option Use Generic Column Names (parse query at runtime only) otherwise I cannot save the form.
    My problem is I am now unable to add a multi row selector to the tabular form. If I do and run the form I get the following error - failed to parse SQL query: ORA-00904: "COL11": invalid identifier. Also when I go back and edit the form the multi row selector has been removed.
    Can anyone tell me why I can't add a row selector like I previously could?
    Regards
    Simon

    Arie,
    I added aliases and to the decode columns, and I can now add a row selector to the form without any problems.
    Thank you very much for your help.
    Regards
    Simon

  • I'm using my new imac and now my safari is redirecting me to a russian search engine which is "yandex.ru" !! I can only enter a few websites without being redirected... !!! is that a virus and if yes how can I delete it and get! Do I have to have AV !

    I'm using my new imac and now my safari is redirecting me to a russian search engine which is "yandex.ru" !! I can only enter a few websites without being redirected... !!! is that a virus and if yes how can I delete it and get! Do I have to have Anti virus !
    Please help me ASAP!
    Thanks
    Dee

    safari is redirecting me
    Dee....
    It's not a virus.
    Your ISP (Internet Service Provider) is redirecting your browser. Use Open DNS to avoid that. Open DNS adds security and anti phishing filters and it's free.
    Open System Preferences / Preferences then select the Network tab. Click the Advanced tab then click the DNS tab.
    Click +
    Enter these numbers exactly as you see them here.
    208.67.222.222
    Click +
    208.67.220.220
    Then click OK.
    More about OpenDNS here.
    Topic : Manually provided DNS server addresses are higher priority than DHCP's
    http://www.opendns.com/newsletter

  • We used to only need to enter a password to login, but we need to enter user name too now. how can we only enter password?

    we used to only need to enter a password to login, but we need to enter user name too now. how can we only enter password?

    Open the Accounts or Users & Groups pane of System Preferences and set the login options to show the list of users.
    (67582)

  • Identify the planning layout used to enter data.

    Hi,
      I am using BI - IP Planning solution. I have a planning solution with 5 different templates. I have a Infoobject ZSOURCE in my planning cube. I would like to update this field based on the planning layout I used to enter the data.
    I cannot include this field in the planning query or Filter because the actuals do not have this field. I am planning to use Characteristic Derivations to update this field. Does any have any idea on how to access input query parameters during the Charateristic Derivation Exit class?
    Or, Is there a better way to achieve this functionality ?
    Thanks 
    Murthy

    Hi Murthy,
    whether a field is filled or not should only depend on the data model, not on a query. This is why characteristic relationships are assigned to real-time InfoCubes, not aggregation levels or queries.
    So my questions is, what is the 'real' criterion to fill ZSOURCE (in some queries and in others not). As I understand, ZSOURCE is not in the aggregation levels so it can be derived based on some criterion. But why is this criterion the used query?
    By design of characteristic relationships you don't get this information in an exit class; though you might 'abuse' a variable exit implementation to read the query name from I_S_RKB1D-COMPID, store in ABAP memory and read the value in your exit implementation. This may work in your case but is not very nice.
    Regards,
    Gregor

  • Multiple Qaawses but use only one Qaaws at a time

    Hi,
    In Dashboard , I have two Qaawses (Qaaws1 and Qaaws2). When I am trying to generate SWF file both the qaawses are running. My requirement is, in Excel file I will set a flag value in one cell (0/1).
    If the cell value is '0' then the Dashboard should use only Qaaws1.
    If the cell value is '1' then the Dashboard should use only Qaaws2.
    In essence my requirement is, even though multiple Qaawses are present in Dashboard, the Dashboard should be able to use only one Qaaws at a time based on my requirement (i.e., based on flag bit value 0/1).
    Can any one suggest,  solution for this?
    Thanks in advance.
    Regards,
    M. N. Kishore Babu.

    Hi David,
    Thank you very much for the response and sorry for the delay.
    Our actual scenario is a s follows:
    We pass customer id and shipper Group Id as an input parameters to the flash variables from front end (through Java program). And these two values will written in Excel cells (let say Customer id in A1, and Shipper Group Id in B1)
    Now there are two Qaawses, Qaaws1 and Qaaws2 in the xlf in addition to flash variables.
    Qaaws 1 query is as follows :
    select * from shp_details where customer id = A1
    Qaaws 2 query is as follows :
    select * from shp_details where customer id = A1 and ShipperGroup_id = B1
    On front end we have two drop downs, Dropdown1  is for customer id and Dropdown2 is for Shipper Group Id.
    When we select an item in Dropdown1, from front end we pass only Customer Id and when we select an item in Dropdown2, we pass both Customer Id and Shipper Group Id.
    Our requirement is,
    When we select Dropdown1 (we are passing only customer id), we expect only Qaaws1 to be executed.
    When we select Dropdown2 (we are passing  both customer id and shipper Group Id), we expect only Qaaws2 to be executed.
    Please let me know, if I need to provide any further clarification.
    Thanks & Regards,
    M. N. Kishore Babu.

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • How can I select properties from dropdown lists using only the keyboard?

    Hi,
    I am using SAP Netweaver Studio and when modifying UI elements in views, I want to select the value for a property from the corresponding dropdown list in the Properties view using only the keyboard.
    When a property row is selected, "Enter" toggles to Edit mode, Alt+ArrowDown expands the list, but ArrowUp or ArrowDown directly selects the previous/next item list and changes to Selected mode.  Which key is used to navigate between the list items without selecting them immediately?
    Thanks a lot. I deal with lots of views and this would save me quite a few massage hours
    Maria
    Edited by: Maria Marinova on Feb 14, 2008 9:40 AM
    Edited by: Maria Marinova on Feb 14, 2008 9:40 AM

    Thanks Andrew. When creating an external table does it requires an access to SQL*Loader?
    CREATE TABLE dept_external (
       deptno     NUMBER(6),
       dname      VARCHAR2(20),
       loc        VARCHAR2(25)
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY admin
    ACCESS PARAMETERS
    RECORDS DELIMITED BY newline
    BADFILE 'ulcase1.bad'
    DISCARDFILE 'ulcase1.dis'
    LOGFILE 'ulcase1.log'
    SKIP 20
    FIELDS TERMINATED BY ","  OPTIONALLY ENCLOSED BY '"'
    deptno     INTEGER EXTERNAL(6),
    dname      CHAR(20),
    loc        CHAR(25)
    LOCATION ('ulcase1.ctl')
    REJECT LIMIT UNLIMITED;

  • Using [SD]/[ED] parameters in queries. xMII 12.1.1

    Hi All,
    I've been investigating usage of "[SD]" and "[ED]" parameters in Query Templates and now have some statements either for confirmation or for disproof.
    - Values only in XML-datetime format should be assigned to StartDate & EndDate parameters in xMII transactions?
      If SD & ED are unparsable I noticed that xMII assigns the following values: EndDate = datenow, StartDate = datenow - 1hour.
    - if EndDate is not in XML-datetime format it is built as StartDate + 1 hour?
    - EndDate which is earlier than StartDate is ignored and StartDate value is assigned to EndDate?
    - InternalDateFormat setting defines how the dates (SD/ED) are sent to the database server (in a SQL query) and to avoid localization problems (e.g. mm/dd/yyyy vs. dd/mm/yyyy) it should be used in conjunction with corresponding DatePrefix and DateSuffix.
    Thanks for your comments,
    Dmitry

    - Values only in XML-datetime format should be assigned to StartDate & EndDate parameters in xMII transactions?
    If SD & ED are unparsable I noticed that xMII assigns the following values: EndDate = datenow, StartDate = datenow - 1hour.
    By using the DateTime format for the transaction inputs it keeps your variable types consistent and all of the use cases within your transaction thereby have a known starting point for conversions.  In addition if you use an XacuteQuery template to call the TRX the Mapped Start/End Date properties will allow you to use the MII query time engine just like you would with [SD] and [ED] in a sql query and when using an applet it will allow the full time control bar to be used.  You'll also notice numerous action blocks, like the Document and Query actions have properties for direct linking these properties.  In the case of the query actions all of formatting is handled by the action block and you can link from Transaction.SD to SQLAction.QueryStartDate and it will automatically convert from the XML date format to the query template's DateFormat and assign to the StartDate parameter. (so in other words you have less work and hard coded string formatting to mess with - way more dynamic).
    - If EndDate is not in XML-datetime format it is built as StartDate + 1 hour?
    This depends a bit on where / how you are using the dates within the query or TRX
    - EndDate which is earlier than StartDate is ignored and StartDate value is assigned to EndDate?
    There is no time machine for going backwards and the Start must always come before the end, so when time is not chronological it will lock the dates to each other.
    - InternalDateFormat setting defines how the dates (SD/ED) are sent to the database server (in a SQL query) and to avoid localization problems (e.g. mm/dd/yyyy vs. dd/mm/yyyy) it should be used in conjunction with corresponding DatePrefix and DateSuffix.
    If your query is SELECT * FROM Table WHERE DateColumn BETWEEN [SD] and [ED] the query going through the DB driver will take the relevant date string format it with DatePrefix + Token converted into InternalDateFormat + DateSuffix (where the settings come from the Data Server settings).  SQL Server is simpler with single quotes and more forgiving for the date format, whereas with Oracle you have to deal with the format and the TO_CHAR prefixing, so this allows simpler queries to be built, and by using the date tokens in conjunction with the MII query time engine allow all of the formatting and conversions to be handled by the data server itself.

  • Is it possible that my update stats used only correct tables?

    Whenever there is a schedule maintenance run I receive a error:
    Executing the query "UPDATE STATISTICS [Perf].[PerfHourly_F65954CD35A54..." failed with the following error: "Table 'PerfHourly_F65954CD35A549E886A48E53F148F277' does not exist.". Possible failure reasons: Problems with the query, "ResultSet"
    property not set correctly, parameters not set correctly, or connection not established correctly.
    Is it possible that my update stats used only correct  tables?
    Thanks

    Use below script ...(change if required)
    USE [dbname]
    go
    DECLARE @mytable_id INT
    DECLARE @mytable VARCHAR(100)
    DECLARE @owner VARCHAR(128)
    DECLARE @SQL VARCHAR(256)
    SELECT @mytable_id = MIN(object_id)
    FROM sys.tables WITH(NOLOCK)
    WHERE is_ms_shipped = 0
    WHILE @mytable_id IS NOT NULL
    BEGIN
     SELECT @owner = SCHEMA_NAME(schema_id), @mytable = name
     FROM sys.tables
     WHERE object_id = @mytable_id
     SELECT @SQL = 'UPDATE STATISTICS '+ QUOTENAME(@owner) +'.' + QUOTENAME(@mytable) +' WITH ALL, FULLSCAN;'
     Print @SQL
     EXEC (@SQL)
     SELECT @mytable_id = MIN(object_id)
     FROM sys.tables WITH(NOLOCK)
     WHERE object_id > @mytable_id
      AND is_ms_shipped = 0
    END
    Or use below for required table only but it will not execute only generate script, make change as per ur requirements:
    SELECT X.*,
      ISNULL(CASE
        WHEN X.[Total Rows]<=1000
        THEN
          CASE
            WHEN [Percent Modified] >=20.0
            THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name] + ' WITH ALL, FULLSCAN  --20% Small Table Rule'
          END
        WHEN [Percent Modified] = 100.00
        THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  --100% No real Stats Rule'
        --WHEN X.[Rows Modified] > 1000
        --THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  --1000 Rows Modified Rule'
        ELSE
          CASE
            WHEN X.[Total Rows] > 1000000000 --billion rows
            THEN CASE
                   WHEN [Percent Modified] > 0.1
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 1B Big Table Rule'
                 END
            WHEN X.[Total Rows] > 100000000  --hundred million rows
            THEN CASE
                   WHEN [Percent Modified] > 1.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 100M Big Table Rule'
                 END
            WHEN X.[Total Rows] > 10000000   --ten million rows
            THEN CASE
                   WHEN [Percent Modified] > 2.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 10M Big Table Rule'
                 END
            WHEN X.[Total Rows] > 1000000    --million rows
            THEN CASE
                   WHEN [Percent Modified] > 5.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 1M Big Table Rule'
                 END
            WHEN X.[Total Rows] > 100000     --hundred thousand rows
            THEN CASE
                   WHEN [Percent Modified] > 10.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 100K Big Table Rule'
                 END
            WHEN X.[Total Rows] > 10000      --ten thousand rows
            THEN CASE
                   WHEN [Percent Modified] > 20.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 10K Big Table Rule'
                 END
            END
      END,'') AS [Statistics SQL]
    FROM (
    SELECT  DISTINCT
            DB_NAME()   AS [Database],
            S.name      AS [Schema Name],
            T.name      AS [Table Name],
            I.rowmodctr AS [Rows Modified],
            P.rows      AS [Total Rows],
            CASE
              WHEN I.rowmodctr > P.rows
              THEN 100
              ELSE CONVERT(decimal(8,2),((I.rowmodctr * 1.0) / P.rows * 1.) * 100.0)
            END AS [Percent Modified]
    FROM
            sys.partitions P
            INNER JOIN sys.tables  T ON P.object_Id = T.object_id
            INNER JOIN sys.schemas S ON T.schema_id = S.schema_id
            INNER JOIN sysindexes  I ON P.object_id = I.id
    WHERE P.index_id in (0,1)
      AND I.rowmodctr > 0
    ) X
    WHERE [Rows Modified] > 1000
    ORDER BY [Rows Modified] DESC
    Please click "Propose As Answer"
    if a post solves your problem, or "Vote As Helpful" if a post has been useful
    to you

  • Using chars entered in field in FMS invoked on the field

    Hi
    I have an FMS linked to a field. Basically, works perfect.
    I now want to be able to enter some chars before invoking the FMS (Shift+F2) and using the entered chars to narrow down the results (.. WHERE ... 'chars').
    Can somebody help me on getting this together?
    How can I use the chars in the field in the FMS?
    Thanks
    Franz

    Query:
    SELECT T1.DocNum AS 'PA-Nummer', T1.ItemCode AS 'Artikelnummer', T1.U_SIA_Rev AS 'Revision', T0.ItemName AS 'Artikelbeschreibung', T1.PlannedQty AS 'Planmenge', T1.CmpltQty AS 'Fertigmenge' FROM  [dbo].[OITM] T0 ,  [dbo].[OWOR] T1  WHERE T0.ItemCode = T1.ItemCode  AND  T1.Status <> N'L'
    This query is linked as FMS (Shift+F2) to the field DocNum in the production order. Basically works and I get a list of the open orders only from which i can chose to open.
    I now want to enter part of the ItemCode (AVB for instance) before invoking the FMS with Shift+F2 and the query should be added by something like:
    AND T1.ItemCode = +AVB+
    I just don't know I get the string entered into the query.
    Franz

  • How to use multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • Export Report to PDF after user has entered parameters

    Hi All,
    I have a problem exporting a report to PDF using "ReportExportControl" after a user has entered parameters, instead of showing the download prompt, it displays the report using the parameters as if it was using "CrystalReportViewer"
    If I program the input fields using "ParameterFieldController" then the exporter works as expected.
    Is there anything in particular needed in order to export a report with user inputted parameters?
    Thanks in advance.
    Michael

    Hi Ted, thanks for your reply,
    What I am seeing at the moment is as follows
    The report requires parameters from the user in order to generate the report, and a webpage asking the user to inputs is shown, the same one that is shown by "CrystalReportViewer" function, once the user has inputted the parameters they click the "OK" button and the report generates on screen, using the parameters entered, behaving like "CrystalReportViewer" function, what I need is once the user click "OK" it will prompt for download as attachment, which is not happening.
    For your suggestion, I already have that coded and its still not working, Please find my code attached
    // Create a exporter object
    ReportExportControl exportControl = new ReportExportControl();
    exportControl.setReportSource(clientDoc.getReportSource());
    // Exporter Options
    ExportOptions exportOptions = new ExportOptions();
    exportControl.setExportOptions(exportOptions);
    exportControl.setExportAsAttachment(true);
    exportOptions.setExportFormatType(ReportExportFormat.PDF);
    // Process the http request to export the report
    exportControl.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
    // Dispose of the exporter object
    exportControl.dispose();
    with the above code the report will display on screen, but if i include this before the code
    //Use the ParameterFieldController to pass parameter values to the report
    ParameterFieldController paramController;
    paramController = clientDoc.getDataDefController().getParameterFieldController();
    paramController.setCurrentValue("", "Parameter name", Val);
    the report doesnt show the input screen and generates as attachment
    Hope this makes my situation abit clearer
    Thanks and regards
    Michael

Maybe you are looking for

  • How to download camera raw 5.5 for lightroom 5.6

    I have several versions of camera raw on my lightroom 5.6 but it skips from 5.4 to 6.6 to 7.1. I need camera raw 5.5 to support my d3000 tethering.

  • Active Sync For Z30

    Does anyone have a problem with Sync time using ActiveSync using Z30. I have been on the phone with Blackberry support and they are clueless and don't have a resolution. I spoke with Network Solutions and was informed this is a constant complaint. It

  • [svn:osmf:] 17499: Partial fix for FM-990: prevent RTE when attempting smoothing for an image where a policy file was not available

    Revision: 17499 Revision: 17499 Author:   [email protected] Date:     2010-08-27 11:05:22 -0700 (Fri, 27 Aug 2010) Log Message: Partial fix for FM-990: prevent RTE when attempting smoothing for an image where a policy file was not available Ticket Li

  • Where can I find programming and packaging guidelines?

    I work on an open source project of mine. It's not ready yet. Since I never created a real-world application before, I need some guidelines about general system integration. Where should I put the config files? What should be their syntax? What shoul

  • Airport Extreme and USB Hard Disk

    I did the following 1. Plugged the Maxtor Basics 3200 into my MacbookPro USB port 2. Formatted it FAT32 3. Unplugged it. 4. Plugged it into AEBS USB port, put around 50g of files on it. Now, from my MacbookPro I can see the drive, but not the files.