Differet Load query based on parameter input

Hi all,
I'm developing my first application with HTML DB and I have a problem. I have a table with no primary key and a unique index on three columns and only one of these can be null. I'm building a form with my events that execute a query based on the data passed from another page.
My problem is that I have two queries (one with the clause column_a is null and another one with column_a=value) but I'm not able to condition the execution on more than one item values; I'd like to know how to express into conditional processing section
PXXvariable_1 is null and PXXvariable_2 is not null.
I can use a workaround in the query using nvl but I'm wondering if is possible to expresso such constraints in constional processing section.
Thanks to all,
Giovanni

Giovanni,
See this section of the documentation on the HTML DB URL syntax:
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10992/mvl_fund.htm#sthref447
You want something like this:
f?P=101:<page ID>:&APP_SESSION.::::PXXPARAM_1,PXXPARAM2:VAL,
Here, PXXPARAM_1 will be set to VAL and will be set to NULL
Sergio

Similar Messages

  • Run query based on parameter

    Hi,
    I have a report where i'm selecting values based on parameter entered by user. There are only 2 options e.g A or B.
    If A then select *
    where name = A
    or if B then select *
    where name != A basically select everything apart from A.
    Can anyone please tell me how to do this. Thanks.

    There are many ways to do this .
    easy way that i use.
    in the "where clause" of sql query statement
    SELECT decode(SUBSTR(TO_CHAR(FIELD_NAME),1,3),'EFT','IND','USA')
    FROM TABLE
    WHERE decode(SUBSTR(TO_CHAR(FIELD_NAME),1,3),'EFT','IND','USA')=
    NVL(:P_SOURCE,decode(SUBSTR(TO_CHAR(FIELD_NAME),1,3),'EFT','IND','USA')
    Then you have to add these'IND and 'USA' in parameter form( drop down list)
    note: use only required functions.

  • Executing SQL-query based on user input in text-box on APEX page

    Hi,
    I'm new to developing in APEX, and I encountered a problem...
    Is it even possible to make such thing: use text area for input of some SQL-query and then execute it on my schema and show results in report item? And if the answer is yes, can somebody provide me tips on how to do that?
    Thanks in advance.

    Denes Kubicek wrote:
    I think this example shows something similar:
    https://apex.oracle.com/pls/apex/f?p=31517:91
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------I see there is executing stored queries example, and text area showing executed one, but not quite understand how to sent sql-query directly from text input, based on your example :/

  • Query Based On User Input

    Hello,
    Is there a way that I can get Discoverer to run different queries based on user input? In other words, I have two parameters "A" and "B". If the user enters a value for "A", execute QUERY1. If the user enters a value for "B", execute QUERY2. If both parameters are left blank, execute QUERY3. If the user enters values for "A" and "B", execute QUERY4.
    I'm fairly new to Discoverer so any help that I can receive on this matter will be greatly appreciated.
    Thank You

    Denes Kubicek wrote:
    I think this example shows something similar:
    https://apex.oracle.com/pls/apex/f?p=31517:91
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------I see there is executing stored queries example, and text area showing executed one, but not quite understand how to sent sql-query directly from text input, based on your example :/

  • How do I change the query based on parameter value

    hi,
    Based on parameter value I want to change my query. If paramter value is 'O' i want the 'order by depno' in query if the value is null i don't want the order by clause.
    How do I achieve this.
    Thanks
    Ram

    U can use lexical parameter
    i.e u create one user parameter and in query
    u use this parameter with &param_name
    ex.
    select val,prize from stock where sr_no > :srno
    orderby &ord_by
    here ord_by is lexical parameter
    and set its intial value to 'sr_no'
    so u can get result order by sr_no
    this parameter is set from form so u will give condition in form and depending
    on condition u will pass this parameter from form.

  • How to execute PL/SQL query based on given input parameter

    Hi all,
    I have a pl/sql code which is in Region source. It extracts data from database. I want to execute the code based on input I give. I have to give date as a input parameter.
    e.g.
    If I give date1 as a parameter, then following code should executed
    select col1, col2,..... from Table where date1 between '01-jan-2010' and '31-jan-2010'
    If I give date2 as a parameter, then following code should executed
    select col1, col2,..... from Table where date2 between '01-jan-2010' and '31-jan-2010'
    Your help is very much appreciated.
    Leo

    Check the datatemplate,lexicals and beforeTrigger for this in documentation.
    check this
    Lexical reference issue in EBS

  • Executing query based on parameter.

    Hi, iam new to Oracle Reports and need some help on handling multiple queries.
    I have 2 queries A,B where A is a subset of B ( B has some extra columns to be included in the select and where clause).
    Now i need to execute A and B according to a parameter value which i select using a list box.
    For example there are two values open and close in the list box.
    If i select open, query A should execute and if i select close, B should execute and report be diaplayed accodingly...Please let me know how this should be done.
    Thanx

    In the data model you can not have a variable number of columns based on the parameter selection. You need to bring the maximum number of columns in the data model, and then show or hide certain columns in the layout model using format triggers based on the parameters.

  • Select query based on userinput

    Hi Folks...
    I posted this in another forum, but no reply,so I am posting it here too. I am trying to make a select query based on a user input. Earlier I was having probelms making a select query and printing out the result in the stack trace,with the advice given, I managed to solve that. I am now modifying that code to make a query based on user input, however it's not working, following is the code:
    String userId = request.getRemoteUser();  String sql = "SELECT hoursused FROM sysuser WHERE iduser = ?";    try      {        Connection connection = dataSource.getConnection();        PreparedStatement preparedStatement = connection.prepareStatement(sql);        preparedStatement.setString(1, userId);                ResultSet srs = preparedStatement.executeQuery(sql);                            while(srs.next()) {                          String hoursused = srs.getString("hoursused");                          System.out.println("The hours used are " + hoursused);    }                  }    catch (SQLException e)      {    e.printStackTrace();    }        } 
    stack trace seems to suggest I may have a probelm with this statement:
    "SELECT hoursused FROM sysuser WHERE iduser = ?"; 
    I am not sure how to rectify this, I hope someone can advise, thanks.

    Hi jschell..
    Thanks for responding, I appreciate it. The problem has been solved. No 'sysuser' is not a reserved word in Mysql. Based on the advice given in another forum and also from this site, I managed to solve the problem. I only made one change. This:
    ResultSet srs = preparedStatement.executeQuery(sql);     was changed to this:
    ResultSet srs = preparedStatement.executeQuery();  Thanks.

  • Widget to get drop down values based on user input query string

    Hi,
    I have a requirement, where in user types in some text and clicks on a search button. On button click, a drop down or some box appears which has result based on the input string (from json ). User can select one of the values in the drop down or box. User should be able to select values from drop down or box only.
    How can I achieve this. Is there any custom widget in CQ for this, or I have to write my own widget.
    Can i use SuggestField widget for this? if yes, please give some example for this widget.
    I want something similar to "authselection" widget. In case of authselection widget user names come from CQ, in this case user name will come from some other system using a CQ custom json.
    If user types "gopa" and click on search , i should be able to call a json with query parameter "gopa" & the result from the query will be in the drop down.
    Regards,
    Gopal

    Hi Gopal,
              Out of the box there are many example. You can look for siteadmin has a reference.
    Thanks,
    Sham

  • SSRS report with tabular model - MDX query to filter parameter data based on Tuple value.

    Hello Everyone,
    I am working on SSRS report in which a tabular model is being used as a backend.
    I want to filter the report parameters which are dependent to other parameters. Like, country, state, and cities drop downs.
    All are multi-select parameters. I am using MDX queries to filter the parameters data.
    Based on selected one or more countries, the data of states needs to be filtered.
    The point is the text which is being displayed in state dropdown for each state name is combination of 3 different members.
    So, I created the following Tuple for the same and can see the expected display names in states dropdown.
    "("+
    [Location].[Code 1].CURRENTMEMBER.UNIQUENAME +","+
    [Location].[Code 2].CURRENTMEMBER.UNIQUENAME +","+
    [Location].[Descr].CURRENTMEMBER.UNIQUENAME +")"
    Now, when I would like filter the cities data based on selected one or more states, I am unable to pass the multiple Tuples (more than one selected Tuples) as parameter for cities dropdown.
    The following is my query for City parameter. It is working well when I select only one State from the dropdown.
    However, when I select multiple states, it is unable to convert the Tuple into SET in ELSE part of IIF condition specified in following query.
    Can anybody help me how to resolve the error that I am getting about STRTOSET function?
    Or
    Are there any other alternatives to achieve this requirement?
    Any help would be much appreciated.
    Query:
    WITH MEMBER [Measures].[ParameterCaption] AS [City].[City Business].CURRENTMEMBER.MEMBER_CAPTION
    MEMBER [Measures].[ParameterValue] AS [City].[City Business].CURRENTMEMBER.UNIQUENAME
    MEMBER [Measures].[ParameterLevel] AS [City].[City Business].CURRENTMEMBER.LEVEL.ORDINAL
    SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,
    [City].[City Business].Children ON ROWS
    FROM (
    SELECT ( STRTOSET(@State, CONSTRAINED) ) ON COLUMNS FROM [Model])
    WHERE ( IIF( STRTOSET(@State).Count= 1,
    STRTOTUPLE(@State, CONSTRAINED),
    STRTOSET("{
    ("+
    [Location].[Code 1].CURRENTMEMBER.UNIQUENAME +","+
    [Location].[Code 2].CURRENTMEMBER.UNIQUENAME +","+
    [Location].[Descr].CURRENTMEMBER.UNIQUENAME
    + ")
    }",CONSTRAINED )) ) CELL PROPERTIES VALUE
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Hi,
    I used following dynamic query in expression of dataset of parameter and it works like a charm.
    "WITH MEMBER [Measures].[ParameterCaption] AS [City].[City Business].CURRENTMEMBER.MEMBER_CAPTION "&
    "MEMBER [Measures].[ParameterValue] AS [City].[City Business].CURRENTMEMBER.UNIQUENAME "&
    "MEMBER [Measures].[ParameterLevel] AS [City].[City Business].CURRENTMEMBER.LEVEL.ORDINAL "&
    "SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , " &
    "[City].[City Business].Children ON ROWS " &
    " FROM [Model] WHERE ({"& join(Parameters!Location.Value,",") &"}) CELL PROPERTIES VALUE"
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

  • Dynamic structure creating based on the input parameter

    Hi all,
                 How to create a dynamic structure based on the input parameter given in the selection screen. I have a file path given and it contains three fields in common, but after that depending upon the input given the fields get changed. For example, i have 0002 infotype given in the selection screen, my file path structure should contain pernr begda endda and PS0002 structure, if the infotype is changed the PS structure has to be changed dynamcially.
    Thank you,
    Usha.

    Ans

  • Query based on a test input box

    query based on a test input box
    hi
    i have this html input box and i want to output a query based
    on what i put in the input box. what should i do now.
    thanks
    <form id="form1" name="form1" method="post" action="">
    <label>enter id <input type="text" name="textfield"
    />
    </label>
    </form>

    Read the documentation:
    http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001252.htm
    page1.html
    <form id="form1" name="form1" method="post"
    action="page2.cfm">
    <label>enter id <input type="text" name="textfield"
    />
    </label>
    </form>
    page2.cfm
    <cfquery name="foo" datasource="bar">
    SELECT aField, bField, cField
    FROM aTable
    WHERE aField = <cfqueryParam value="#form.textfield#"
    cfsqltype="cf_sql_varchar">
    </cfquery>
    <cfoutput query="foo">
    #aField# #bField# #cField#
    </cfoutput>
    briankind wrote:
    > query based on a test input box
    >
    > hi
    > i have this html input box and i want to output a query
    based on what i put in
    > the input box. what should i do now.
    >
    > thanks
    >
    >
    > <form id="form1" name="form1" method="post"
    action="">
    > <label>enter id <input type="text"
    name="textfield" />
    > </label>
    > </form>
    >

  • How to hide/display chart based on User input parameter

    hi,
    I have a chart in WEBI report. This report prompts the end user with values {Yes, No}.
    If user selects value 'Yes', Chart should be displayed
    If user selects value 'No', Chart should be hidden.
    Please let me know how to achieve this....
    Thanks,
    Vamsee

    You can use a combination of steps. First, create a filter for the chart block based on your input prompt value. If the user says "No" then the chart should be empty due to the filter. Next, there is a checkbox that tells Web Intelligence whether to show an empty block or not. It is on by default, you can turn it off.
    I detail a solution with similar results on my blog where only one of two charts is displayed using a similar technique. It might help you understand more of the concepts.
    http://www.dagira.com/2007/07/31/alerters-on-charts-part-ii/

  • Dynamic sql query for report based on user input

    Hi everyone,
    I have built custom search fields (name, date born, gender etc.) in the search region and in the results region a report need to be displayed.
    Now I'm not very experienced with Apex or Oracle sql, but could anyone telll me how to first check if a user filled in a field and then build a query based upon what field the user filled in to submit.
    Any help would be appreciated, thanks in advance.
    regards,
    Cleo
    Edited by: Cleopatra on Jan 18, 2011 5:51 AM

    Hi, Cleopatra. Welcome to OTN!
    If you don't have too many fields instead of checking to see if they're filled in you can use OR conditions in yoru WHERE_CLAUSE to check for NULLS to ignore NULLS, something like (you will have to test this carefully!)
    AND some_column = NVL(:P24_1,some_column)the idea being that if the field is NULL then the column will match itself - in this case assuming the column itself does not have a null value

  • SOURCING10: Passing parameters to a Query Based webservice using JAVA

    Hi Experts,
    I have been working on consuming a Query based webservice published in Souricng10 in a simple JAVA class. The query has a filter parameter which is not mandatory. I am able to consume the webservice using the GET method and display the content of the webservice. But when i try to POST a value to the filter parameter of the query i am getting the following error:
    java.io.IOException : Server returned HTTP response code: 415 for URL: http://sapcild9.web.bc:55000/sourcing/ngservices/rest/query/Z_TEST_WS_QUERY/execute/
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    Following is the code which i have used:
       URL url = new URL("http://sapcild9.web.bc:55000/sourcing/ngservices/rest/query/Z_TEST_WS_QUERY/execute/");
       HttpURLConnection connection = (HttpURLConnection)url.openConnection();
       connection.setRequestProperty("Authorization", "Basic " + authStringEnc);
       connection.setRequestProperty("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
       connection.setRequestProperty("Content-Length", "" +Integer.toString(urlParameters.getBytes().length));
       connection.setRequestProperty("Content-Language", "en-US");
       connection.setUseCaches (false);
       connection.setDoInput(true);
       connection.setDoOutput(true);
       connection.setAllowUserInteraction(true);
       connection.setInstanceFollowRedirects(false);
       connection.setRequestMethod("POST");
       connection.connect();
       //Send request
       OutputStream out = connection.getOutputStream();
       OutputStreamWriter wr= new OutputStreamWriter(out, "UTF-8");
       wr.write("EXTERNAL_ID");
       wr.write("=");
       wr.write(URLEncoder.encode("temp","UTF-8"));
       wr.close();
       out.close();
       is = connection.getInputStream();
       isr =new InputStreamReader(is);
       BufferedReader bufferReader = new BufferedReader(isr);
       String str; StringBuffer stringBuffer = new StringBuffer();
       while ((str = bufferReader.readLine()) != null) {
       stringBuffer.append(str);
       stringBuffer.append("\n");
       System.out.println(stringBuffer.toString());
       connection.disconnect();
       is.close();
    Please Advise how to proceed on this isssue?
    Thanks in advance.
    Srikanth Emani

    Hi Gael,
    your URL is made up of :
    [ProcedureName]?[parameter1]=[value1]&[parameter2]=[value2]
    creating URLs like this can have problems especially with spaces and punctuation.
    the answer is a FORM
    the following will create a hidden form :
    FORM ACTION="[ProcedureName]" METHOD="POST" name="F1"
    INPUT type="HIDDEN" name="[parameter1]" value="[value1]"
    INPUT type="HIDDEN" name="[parameter2]" value="[value2]"
    /FORM
    you can set the values in the form using:
    document.F1.[parameter1].value="abc123%%&&$$!";
    document.F1.submit();
    will submit the form and the PL/SQL procedure should receive the text as it was contained in the form.
    the only characters that can now cause problems are :
    " as it delimits the field.
    ' as it may cause problems in PL/SQL.
    \ as it is a special character.
    Regards Michael

Maybe you are looking for