Use parameters in an XOR fashion

I have two parameters which should be used alternatively (either a value OR it's synonym).
It's not a problem if the user enters both - I just want to be sure that at least one parameter is entered (to avoid a full table scan).
I tried a condition "param-1 is not null or param-2 is not null" but this does not avoid the execution of a "useless" query.
Does anybody know a trick?
Susanne
PS: I'm using Discoverer v10.1.2
Message was edited by:
laloca

Hi,
All conditions are evaluated when the query is executed, bind variables are used to pass the parameters into the query. So the nvl() method or using the condition param1 is not null or param2 is not null will give you the result, but as you say it will not stop a 'useless' query being run.
If you what to stop the query being run when both params are empty then you need to look at using a raise_error function. For example, the following function raises a database error if message input is not null.
CREATE FUNCTION raise_error(p_message VARCHAR2) RETURN VARCHAR2
IS
BEGIN
IF p_message IS NOT NULL THEN
RAISE_APPLICATION_ERROR(-20001, p_message);
RETURN ('FALSE');
ELSE
RETURN ('TRUE');
END IF;
END raise_error;
You can then load the function into the EUL and create a condition that raises an error as soon as the condition is evaluated. This will be at the start of the query executing. e.g. raise_error(case when nvl(:param1, :param2) is null then 'Cannot have both parameters empty' end) = 'TRUE'. The query will then fail raising a database error if both parameters are null.
Hope that helps,
Rod West

Similar Messages

  • Error while Driving a view using parameters from other view

    Hi,
    I have created a report with streamlist and Barchart view.Driving option is used in streamlist to drive the barchart. The driving works well untill i dont use any filters in the Streamlist.Once i use parameters in streamlist , the driving works only for the default values set.When Second set of values are chosed for the parameter,the values are displayed correctly , but once they are selected for driving,the current values are replaced by the results of the default parameter settings.
    I have already done the tutorials for driving and it worked well untill i use filters in the main view,from where the driving is done.
    I would really appreciate if someone could give a solution for this problem.
    Regards,
    Lathika

    Hi,
    Login as i.e. sys as sysdba. Standard password is change_on_install.
    Or you can login in using user that has CREATE VIEW WITH ADMIN OPTION and then grant CREATE VIEW privilege to user to want.
    Peter D.

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • Using parameters in a select query sometimes not working

    I use parameters throughout my code - usually without problem, but for some reason in one case it does not return a result. When I modify the querystring to contain the value instead of using parameters it works. Is it because I'm secting a clob? or is it because I'm using a 9i ODP.net dll against a 10g database? this is c# 2.0
    here's the source code that does not work for me - REQUEST_DATA is a clob:
        public String loadRequest(String PSRNumber)
            String returnVal = null;
            ConnectionStringSettings connectionInfo = System.Configuration.ConfigurationManager.ConnectionStrings["Scribe"];
            OracleConnection myConnection = new OracleConnection();
            String strSQL = "select PSR, REQUEST_DATA from stats.request where PSR = :PSR";
            try
                myConnection.ConnectionString = connectionInfo.ConnectionString;
                OracleCommand cmd = new OracleCommand(strSQL, myConnection);
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add("PSR", OracleDbType.Varchar2).Value = PSRNumber;
                myConnection.Open();
                OracleDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                    returnVal = dr.GetOracleString(dr.GetOrdinal("REQUEST_DATA")).ToString();
                else
                    returnVal = null;
                dr.Dispose();
                cmd.Dispose();
            catch (OracleException ex)
                printError(ex.Message);
            finally
                myConnection.Close();
                myConnection.Dispose();
            return returnVal;
        }when I replace the line generating the sql, and remove the lines pertaining to parameters it works:
    String strSQL = String.Format("select PSR, REQUEST_DATA from stats.request where PSR = {0}", PSRNumber);
    I'm fine just using this as a workaround, but I need an explanation why the other does not work - I prefer to use parameters.
    Message was edited by:
    user633546

    I figured it out. thank you for your help in pointing me in the right direction.
    the problem was there was a trailing space in the data.
    when the data for that table is numeric for every record, the query allows me to leave out the single quotes. Trailing spaces do not seem to cause the database to see it as non-numeric - leaving out the quote still finds the record even if there is a trailing space.
    but when I put in the quote, it is not an exact string match, so it could not find the record. sometimes this flexibility gets me into trouble :\

  • How to use parameterized statements with labSQL?

    Hi everybody,
    I have a big problem with labSQL. Every statement or query I have to use in my program works correctly, but I have a performance problem when writing my data to the database. The problem is the handling of the SQL statements by the DB. The solution will be the use of parameterized statements with labSQL.
    The manual for NI Labview Database Connectivity Toolkit provides such information, but there are large differences to labSQL, and I don't get the clue. Is anybody able and would be so kind to help me? If someone has an example for using parameterized SQL statements with labSQL or the ADO methods for such stuff, please be so kind to share it with me.
    Thank you for reading all of this
    Best regards,
    Matthias

    Thank you very much for your help. I already had set up the correct SQL statement and created the parameters but got errors when executing the command object. After some tries I found that neither the SQL statement nor the parameters were the source of the error, as I had expected first.
    The problem was that I was sending the wrong data type to the execute method of the command object. It expected some variant input for the parameters. I send an array of strings, which caused an error. I casted that array to variant with the same result. But a single string to variant worked well (with only one parameter in the SQL statement). The easy solution was to cast all strings to variants, and then build an array out of them. The execute method worked with that. Now the transaction is 4 times faster than before 
    Thanks again!
    Edit:
    If someone is interested in some example VI, please let me know. I should have some time next week to build one.
    Message Edited by manicnobody on 02-26-2009 10:19 AM

  • Using parameters in graphic builder

    hi
    i want to know , how can i use parameters in graphic builder ?
    thanks

    Maybe you would be better to ask such a question in Forms.
    Cheers, APC

  • Export and save a Crystal Report in PDF using parameters

    Hi @all!
    Is it possible to suppress the output of an Crystal Report in a window using parameters? Instead of that I want to save the pdf in a specified folder without using the publication-function.
    Fot the parameter I use these link:
    [http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/boe_sdk/boesdk_dotnet_doc/doc/boesdk_net_doc/html/Report_Linking13.html]
    Best regards,
    Dirk

    Hi,
    this is the forum for the SAP Integration Kit. I would suggest you post your question into the Crystal Reports forum.
    the answer - yes you can use OpenDocument to show the report right away as PDF.
    Ingo

  • Problems using Parameters

    Hi im trying to contribute documents on UCM using parameters because my legacy applications wont support webservice and because this can be the most simple way.
    Reading services documentation i found CHECKIN_UNIVERSAL
    If i use this url:
    http://localhost/idc/idcplg?IdcService=CHECKIN_UNIVERSAL&dSecurityGroup=Public&primaryFile=C:/test.txt&dDocAuthor=AUTOR&dDocTitle=TITLE
    I get this error message:
    Content item 'DEMO_000002' was not successfully checked in. The content item must have a primary file.
    I did exactly like the documentation.
    What`s missing?

    The check in services require an actual file as a payload along with the call. Simply using parameters in the url will not work for a check in. Unless you want to do a metadata only check in?
    In which case if your server is configured for that you can add this addtional parameter to your url: createPrimaryMetaFile=true
    Read More Here:
    [http://www.corecontentonly.com/2008/09/15/MetadataOnlyCheckIn.aspx|http://www.corecontentonly.com/2008/09/15/MetadataOnlyCheckIn.aspx]

  • BC4J List Validation from SQL Query, using parameters?

    When adding validation to a business component, one of the options for the list validation rule is 'Query Result'.
    is it possible to use parameters??. e.g. for a student type registration application
    validation on studentEntry that the course is availabe for the term entered would be like :-
    Select course from courseCat where term = :pterm
    where :pterm is the current term that the student has entered, this exists on the current studentEntry row.
    how would I code the parameter in the select statement in 'edit validation rule' screen?

    When adding validation to a business component, one of the options for the list validation rule is 'Query Result'.
    is it possible to use parameters??. e.g. for a student type registration application
    validation on studentEntry that the course is availabe for the term entered would be like :-
    Select course from courseCat where term = :pterm
    where :pterm is the current term that the student has entered, this exists on the current studentEntry row.
    how would I code the parameter in the select statement in 'edit validation rule' screen? This is currently not available on the built in validators. However you can create a custom-validation rule and perform such bind params and execute queries. We do have plans to support named paramters in queries that will allow us to enable this feature on validators as well.

  • Adding Standard Text to the Selection Screen obtained using PARAMETERS

    Hi all,
    I have a report program which has the selection screen declared by the key word PARAMETERS.
    Now I need to make the changes to this program such that a Text Editor appears on the Selection Screen and has a Standard text that should be displayed.
    How can I do it?
    I saw the screen number of the Selection Screen and went to screen painter and tried to add the Text Editot..but it did not let me dou2026.Why?
    How should I add a standard text to a selection screen? The standard text should not be on top , but some where on the screen.
    Regards,
    Jessica Sam

    Hi Sam,
    I dont want to create a new screen for this. On the existing screen whihc was built using PARAMETERS key word..i should insert a blokc of text whihc is mpre than 5-6 lines..how should i do it.
    I navigated to Text Elements---->Selection Texts
    it is now asking for Name and Text and i see in Name column the name of the parametsr that they used for Check box, radio button etc and in Text i see the text that is appearing on the screen
    Now i am not sure what is should do next
    My req is..i should display a block of standard text that doesnt change and whihc is of 4-6 lines?
    how should i do it?
    please also help me with what data declartions that i should do in parametrs key word in program?
    Regards,
    Jessica Sam

  • Link two reports using parameters

    Hi,
    We are using business object XI.
    I am trying to link two reports using parameters. I cannot use subreport option becuase inside the subreport I should link another report too. So,
    Report 1(High level summary)
    Report 2(Middle level summary)
    Report 3(Detail level)
    I tried to use hyperlink option and used following string.
    http://<server_name>/<Virtual Directory>/object.rpt?prompt0={?param1}&prompt1={?param2}
    Here is my question.
    1. Server name: Does it include port number??
    2. Virtual Directory: I am absolutely lost. I tried the "frsinput" directory the actual rpt file is storing. It is not working.
    Do you have general path??
    3. Parameters: I have 5 parameters to pass. 3 of them are Strings and the rest are DateTime.
    Basically, I need any tutorial about this kinds of things. The tutorial I have got only discribe link like "www.yahoo.com"
    BTW, is this even possible solution??

    Hi,
    I am trying to link two reports in the crystal report designer->deploy to the server->show in the DHTML viewer.
    When I create a URL from report A, it looks like "&" disapears. For example, I created a hyper link from report A using formula,
    http://server:port/........openDocument.jsp?sDocName=reportB&sType=rpt&paramName1="Trim(ToText({?param1},"#####"))"&paramName2="+Trim(ToText ({?param2},"#######"))
    But when I see the actual URL, all the "&" disappears so it looks like
    http://server:port/........openDocument.jsp?sDocName=reportBsType=rptparamName1="Trim(ToText({?param1},"#####"))"paramName2="+Trim(ToText ({?param2},"#######"))
    No wonder it is not working.
    I guess I need special protection for "&" sign. Do you know any?

  • Export Jasper Report Through JSP(using parameters)

    Hi All ;
    Please I need A help ;
    I need to use a Jasper Report in my jsp pages using parameters ;
    can some one tell me how i can do it by steps & with example ;
    note that i use Oracle Data Base;
    Regards;

    I would start off reading a JasperReports tutorial.
    Here is a list of all JasperReports tutorials available on the world wide web:
    http://www.google.com/search?q=jasperreports+tutorial

  • Possible to use parameters in MDX Studio?

    Is it possible to use parameters in MDX Studio? I've tried using SSRS2008 for query design but...
    SSRS2008 query designer complains that parameters do not exist when they quite obviously do ( in the report)
    LaCie drives. Failing when you need them most."La" meaning "Terrible", "Cie" meaning "customer service"

    You can declare parameters in XMLA format after the MDX query - see examples in this post:
    Bug v2.9.1: Parametric queries parsing and debugging errors
    WITH MEMBER [Measures].[Profit] AS '[Measures].[Sales Amount]-[Measures].[Standard Product Cost]' SELECT NON EMPTY { [Measures].[Internet Sales Amount], [Measures].[Internet Total Product Cost], [Measures].[Internet Order Quantity] } ON COLUMNS, NON
    EMPTY { ([Sales Reason].[Sales Reason].[Sales Reason].ALLMEMBERS * [Sales Territory].[Sales Territory Group].[Sales Territory Group].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, [Sales Reason].[Sales Reason].[Sales Reason].KEY, [Sales
    Territory].[Sales Territory Group].[Sales Territory Group].KEY ON ROWS FROM ( SELECT ( STRTOSET(@ProductCategory, CONSTRAINED) ) ON COLUMNS FROM [Adventure Works]) WHERE ( IIF( STRTOSET(@ProductCategory, CONSTRAINED).Count = 1, STRTOSET(@ProductCategory, CONSTRAINED),
    [Product].[Category].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    <Parameters xmlns:xsi="www.w3.org/2001/XMLSchema-instance" xmlns:xsd="www.w3.org/2001/XMLSchema"
    xmlns="urn:schemas-microsoft-com:xml-analysis">
    <Parameter>
    <Name>ProductCategory</Name>
    <Value xsi:type="xsd:string">{ [Product].[Category].&amp;[1],[Product].[Category].&amp;[2] }</Value>
    </Parameter>
    </Parameters>
    <PropertyList xmlns="urn:schemas-microsoft-com:xml-analysis">
    <Catalog>Adventure Works DW</Catalog>
    <LocaleIdentifier>1033</LocaleIdentifier>
    <Format>Tabular</Format>
    <Content>SchemaData</Content>
    <Timeout>0</Timeout>
    <ReturnCellProperties>true</ReturnCellProperties>
    <DbpropMsmdFlattened2>true</DbpropMsmdFlattened2>
    </PropertyList>
    - Deepak

  • Call javascript function using parameters cause a immediate execute at load

    Hello.
    I recognized a strange behavior if I try to use parameters to javascript in af:clientListener method property.
    Using syntax <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="OnInitControl1" type="click"/>
    </af:commandButton> and javascript function OnInitControl1() {
      alert('OnInitControl1 called');
    } the method OnInitControl1 is called first with the click of the button.
    But with the syntax <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="InitCtrl('Control1')" type="click"/>
    </af:commandButton> and javascript function InitCtrl(frameName) {
      alert('InitCtrl(' + frameName + ') called');
    }the function InitCtrl is called immediate at load of the page.
    In both cases the javascript file is inserted in af:document using<af:resource type="javascript" source="/ScriptHelper.js"/>Is my syntax for "method" property of the af:clientListener wrong?
    Paul.

    Hi,
    I am using Oracle JDeveloer version 11.1.1.0.2. I have gone through your discussion. Since i am new to ADF, just wanted to request you to share the code related to <af:resource type="javascript" source="/ScriptHelper.js"/>. Also, the Tag included for the same. In my Environment, if i use <af:resource, it shows, "element af: resource is not expected".
    My requirement is similar to your as you explained in details. I need to push all the client side validation to Javascript file and need to call in the ADF pages wherever it is required (re-usable). Also, is there any specific formate for JS file to be maintained from the point of view of ADF calling the JS file.
    Your help will be greatly appreciated.
    Thanks in Advance,
    --Mahesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Purpose of using parameters defined below in FM 'REUSE_ALV_GRID_DISPLAY'

    Hi,
    Iwant to know the purpose of using parameters defined below in FM   ''REUSE_ALV_GRID_DISPLAY'   :---
    EXPORTING.
      I_INTERFACE_CHECK                   =
      I_BYPASSING_BUFFER                =
      I_BUFFER_ACTIVE                        =
      IS_SEL_HIDE                                =
      IS_PRINT                                      =
      IS_REPREP_ID                             =
      I_SCREEN_START_COLUMN        =
      I_SCREEN_START_LINE               =
      I_SCREEN_END_COLUMN            =
      I_SCREEN_END_LINE                   =
      IT_ALV_GRAPHICS                       =
      IT_HYPERLINK                              =
      IT_ADD_FIELDCAT                        =
      IT_EXCEPT_QINFO                       =
      I_HTML_HEIGHT_TOP                   =
      I_HTML_HEIGHT_END                   =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER      =
      ES_EXIT_CAUSED_BY_USER       =
    small example codes are most welcome.
    Regards,
    Rahul

    <b>Go To SE37 AND Give the function module name and press Button 'FUnction Moudule Documentation' There you will get the documentation for each parameter</b>
    <b>* I_INTERFACE_CHECK =</b>
    Interface consistency check log output
    Description
    So that the performance of the list output is not reduced due to interface consistency checks, these checks are performed in a special call mode.
    If this parameter is set to 'X', interface consistency is checked when the function module is called and an error log is displayed.
    You should only set this parameter for testing purposes during the development process (for example, for debugging).
    You can also perform the interface check on the result list by entering function code &SOS.
    THIS PARAMETER IS CURRENTLY NOT SUPPORTED IN FULLSCREEN MODE! As a workaround, go to the print preview from within the list and enter function code &SOS there.
    Default
    SPACE
    <b>*IS_SEL_HIDE = </b>
    Description
    This parameter is currently not supported!
    Only relevant if layout parameter
    LAYOUT-GET_SELINFOS of IMPORTING structure IS_LAYOUT is set.
    Complex type for modifying information displayed on the selection dialog box:
    mode:              'R' = Only entries passed in internal table
                              IS_SEL_HIDE-T_ENTRIES are output on
                              the dialog box. Selection information
                              obtained by the list tool by reading the
                              selection screen again (only if the report
                              is called with selection screen) are
                              replaced by the entries passed.
                       'S' = The selection information obtained by the
                              list tool by reading the selection screen
                              of the calling report again, are modified
                              by the entries of table
                              IS_SEL_HIDE-T_ENTRIES.
    t_entries:         Table with selection information
    t_entries-mode:   'A' = Display selection information of the current
                             table row on the information dialog box.
                      'D' = Do not display selection information of the
                             the Select option or of parameter SELNAME
                             on the dialog box.
    t_entries-selname: (required only if t_entries-mode = 'D')
                       name of Select option or parameter
    The following table fields are only required if t_entries-mode = 'A'. They contain the selection information to be added.
    t_entries-field:  DDIC field name of the field for which selection
                       information is to be displayed
    t_entries-table:  DDIC table name of t_entries-field.
    t_entries-stext:  Field description on the information dialog box.
                      If t_entries-field and t_entries-table were
                      filled, this text is taken from the DDIC.
    t_entries-valuf:  Selection condition from-value (external format)
    t_entries-valut:  Selection condition to-value (external format)
    t_entries-sign0:  (I)nclusive (E)xclusive
    t_entries-optio:  All values of the option field of the Select
                      option are allowed.
    The remaining fields are used internally and are irrelevant to the caller.
    <b>* IS_PRINT =</b>
    Print information
    Description
    Control parameters relevant for printing
    PRINT
    Value range: SPACE, 'X'
    'X' = Print list and do not display it on the screen. Further settings can be made on the print parameter screen.
    NO_PRINT_SELINFOS
    Value range: SPACE, 'X'
    'X' = Do not print existing selection information (see also LAYOUT-GET_SELINFOS)
    NO_COVERPAGE
    Value range: SPACE, 'X'
    'X' = Print selection information and list status, if available, on a separate page.
    NO_NEW_PAGE
    Value range: SPACE, 'X'
    Internal use only
    RESERVE_LINES
    Value range: 0, n
    n = Number of lines output in the footer by the user during printout at END_OF_PAGE in the corresponding callback event.
    NO_PRINT_LISTINFOS
    Value range: SPACE, 'X'
    'X' = Do not print list status (sort information, subtotals information and filter information).
    NO_CHANGE_PRINT_PARAMS
    Value range: SPACE, 'X'
    SPACE = (default) The output format (number of columns) is dynamically adjusted depending on the list width (255 at most).
    'X' = The current print parameters are always used. If the list is wider, the output width is not adjusted dynamically.

Maybe you are looking for

  • How to re-download Apps when you have canceled and then restarted a membership

    Hi There, I recently (in the last two weeks) canceled a membrship, and then started a new membership. In that time my apps expired so I deleted them from my harddrive. Today, I wanted to reinstall apps, but when I did via the CC Downloader it had all

  • ITunes crashing on Windows vista

    Hello, I just upgraded my itunes for windows vista and it is crashing all the time when I launch it, a windows OS message appears telling me the iTunes tried to reach memory zone dedicated to the OS exclusively, so I turned that feature off, but it k

  • Macbook control of apple tv

    how do i control my apple tv with my new macbook. i want to be able to select a song from my macbook and have it play on my apple tv. any help? seems like it should be simple but i drink alot.

  • Cannot gunzip .gz Oracle 9i files for Linux

    I downloaded the 3 files for Oracle 9i for Linux. I followed the instructions to gunzip the files but they will not unzip as I get the following error: gunzip: Linux9i_Disk1.cpio.gz: unexpected end of file I've tried all there files and get the same

  • Failed to checkout an application module instance

    Hi, I am using JDev 3.2 to develop my JSPs and BC4J. When I tried to run my JSP from my web server I got the error "JBO-30003:The application pool, TsrsJSP20_TsrsBCPack_TsrsBCPackModule, failed to checkout an application module instance. JBO-26061:Er