Unknow number of binding variables in Dynamic SQL

I have to use a dynamic sql and binding variables. The problem is the number of binding variable varies due to the form input.
EX.
if ( something is not null ) then
query := query || ' and column = :column';
end if;
if ( something_else is not null ) then
query := query || ' and another_column = :another_column';
end if;
When I use in my USING clause, I don't know which of the four combinations of column/another_column I could be
open query;
open query using A,B;
open query using A;
open query using B;
How can I solve this problem?
Thanks a lot!

Always with NVL:
query := query || ' AND column = NVL(:column,column ) AND another_column = NVL(:another_column,another_column)';Invoke:
DECLARE
  a_null CHAR(1); -- set to NULL automatically at run time
BEGIN
  --open query
  open query using (a_null,a_null)
  --open query using A,B
  open query using A,B;
  --open query using A
  open query using A,a_null;
  --open query using B
  open query using a_null ,B;
END;
/Edited by: jortri on 04-dic-2008 18:34

Similar Messages

  • Bind variables and Dynamic sql

    I have this function which works only when i'm not passing bind variables. The moment i add bind variables it is not able to execute the function.
    Oracle Db Version: 8.1
    Thanks
    Source Code
    FUNCTION TestFunction( In_Test_id in Number,
    In_Asof in Date )
    Return ScoreType
    IS
    LvScore ABC.LV_SCORE.SCORE%TYPE;
    DVScore ABC.LV_SCORE.SCORE%TYPE;
    Begin
    EXECUTE IMMEDIATE
    'SELECT SCORE,DVSCORE
    FROM
    SELECT SCORE,DVSCORE
    DENSE_RANK() OVER (PARTITION BY TEST_ID ORDER BY ASOF_DT DESC) AS score_RANK
    FROM ABC.LV_SCORE
    WHERE TEST_ID = :x
    AND ASOF_DT <= :y
    ) WHERE score_RANK = 1'
    INTO LvScore,DVScore
    USING In_tEST_ID,In_Asof;
    Return ScoreType( LvScore,
    DVScore);
    End;

    It just keeps on executing for sometime and then disconnects itself from database What was the indication that told you that it disconnected? Was there a visible indication of this disconnect?
    Did you get ORA-03113?
    ===========================================
    ORA-03113: end-of-file on communication channel
    Cause: The connection between Client and Server process was broken.
    Action: There was a communication error that requires further investigation. First, check for network problems and review the SQL*Net setup. Also, look in the alert.log file for any errors. Finally, test to see whether the server process is dead and whether a trace file was generated at failure time.

  • Using bind variable in dynamic where clause and concatenate with query

    Hi,
    In my procedure i am framing where clause dynamically with bind variable,When i am concatenate this with my sql query for REF CURSOR i got sql command not properly ended exception.
    Is it possible to pass values to the bind variable through the dynamic variable/value?
    Please advise
    Thanks in advance
    Siva
    IF in_applicationId IS NOT NULL THEN
              optional_where := optional_where || ' AND a.APPLICATION_ID like '||':e%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id'||',in_applicationId';
         END IF;
    My query is like this
    open Out_Main FOR SelectQuery USING optional_using

    Thanks for reply,
    In my procedure, i suppose to frame the where clause with bind dynamically according to the input parameters. so that i am framing the values of the bind variables also dynamically like this,
    Please advise...
    IF in_assignedAppFlag IS NOT NULL THEN
              IF in_assignedAppFlag = 'Y' THEN
                   optional_where := optional_where || ' AND b.ASSIGNED_TO = :b' ;
              optional_using := ' in_appFuncGroup'||',in_currentUserID';          
              ELSe
                   IF in_isSupervisor = 0 THEN
                        optional_where := optional_where || ' AND (b.ASSIGNED_TO = :b'||' OR b.ASSIGNED_TO = ''-1'' OR b.ASSIGNED_TO IS NULL)';
              optional_using := ' in_appFuncGroup'||',in_currentUserID';
                   END IF;
              END IF;
         ELSE
              IF in_isSupervisor = 0 THEN
                   optional_where := optional_where || ' AND (b.ASSIGNED_TO = :b'||' OR b.ASSIGNED_TO = ''-1'' OR b.ASSIGNED_TO IS NULL)';
                   optional_using := ' in_appFuncGroup'||',in_currentUserID';
              END IF;
         END IF;
         IF in_appFuncGroup IS NOT NULL THEN
              optional_where := optional_where || ' AND e.APP_FUNC_GROUP= :c';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup';
         END IF;
         IF in_queue_id IS NOT NULL THEN
              optional_where := optional_where || ' AND b.QUEUE_ID = :d';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id';
         END IF;
         IF in_applicationId IS NOT NULL THEN
              optional_where := optional_where || ' AND a.APPLICATION_ID like '||':e%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id'||',in_applicationId';
         END IF;
         IF in_sourceCode IS NOT NULL THEN
              optional_where := optional_where || ' AND e.APP_SOURCE_CODE like '||':f%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode';
         END IF;
         IF in_logo IS NOT NULL THEN
              optional_where := optional_where || ' AND appProds.PRODUCT_TYPE like '||':g%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo';
         END IF;
         IF in_firstName IS NOT NULL THEN
              optional_where := optional_where || ' AND upper(a.FIRST_NAME) like upper(:h%)';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName';
         END IF;
         IF in_surName IS NOT NULL THEN
              optional_where := optional_where || ' AND upper(a.SURNAME) like upper(:i%)';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName'||',in_surName';
         END IF;
         IF in_retreival_id IS NOT NULL THEN
              optional_where := optional_where || ' AND e.RETREIVAL_ID like :j%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName'||',in_surName'||',in_retreival_id';
         END IF;

  • How do I use bind variables for the SQL statements having IN clause

    SELECT id, name FROM t
    WHERE id in (10,20,30)
    As the IN list will have 'n' number of values, I am not able to specify fixed number of bind
    variables like
    SELECT id, name FROM t
    WHERE id in (?,?,?....)

    452051 wrote:
    I am not able to specify fixed number of bind variablesYou could use collection:
    SQL> create or replace force
      2    type NumList
      3      as
      4        table of number
      5  /
    SQL> select ename from emp where deptno member of NumList(10)
      2  /
    ENAME
    CLARK
    KING
    MILLER
    SQL> select ename from emp where deptno member of NumList(10,20,30)
      2  /
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    ENAME
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> This way you have one bind variable - collection.
    SY.

  • Problem returning variables from dynamic SQL/PLSQL

    Hi, I have a problem I am trying to solve using a very short piece of dynamic SQL or PLSQL but I am having problems getting the variable values out of the dynamic block.
    I have 16 counters whose names are made up of three variable parts - 'scheme', 'contributory category' and 'employment category'
    The 'scheme' can be either 'no1', 'no2', 'off', 'cg' or 'amc'
    The 'contributory category' can be either 'cont' or 'noncont'
    The 'employment category' can be either 'ft' or 'pt'
    (There are only 16 because only 16 combinations are possible)
    For example the total counter name could be 'v_cg_noncont_ft_count'
    I have created a variable by concatenating the various elements called v_incr_count_name which holds the name of the counter I want to increment.
    I am running this whole thing within an anonymous PLSQL block so I cannot use global variables meaning that my variables are not visible within a dynamic PLSQL block.
    I believe this means that either I need to bind the variables within a PLSQL block or use a SELECT FROM INTO SQL block.
    I have tried a few solutions with no luck such as the following PLSQL:
    v_incr_count := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'BEGIN :a := :a + 1; END;';
    EXECUTE IMMEDIATE sql_stmt USING v_incr_count_name;
    Unfortunately I am getting the 'IN bind variable bound to an OUT position' error which I believe is because it is trying to return a value into v_incr_count_name which has been defined by default as an IN variable. The problem is that I need to store the returned value into the variable whose name is stored in v_incr_count_name.
    Another solution I tried is:
    v_incr_count_name := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'SELECT '||v_incr_count_name||' + 1 FROM DUAL';
    EXECUTE IMMEDIATE sql_stmt INTO v_return;
    This solution gives me an 'Invalid colum error'
    Any help would be greatly appreciated
    Cheers, Dan

    Repost:
    Problem with variables in dynamic SQL/PLSQL

  • Using bind variables in Oracle SQL developer

    Hi all,
    i am using Oracle SQL developer. i want to use the bind variable in my sql.
    variable myid number :=1;
    select * from mds_3618_request where id = :myid;
    but i am getting the below error.
    Error starting at line 2 in command:
    select * from mds_3618_request where id = :myid
    Error report:
    SQL Error: Missing IN or OUT parameter at index:: 1
    Does Oracle SQL developer support bind variables in the SQL statements?
    thanks in Advance
    Vali Shaik

    You are probable going to get a quicker answer on this forum : SQL Developer
    -- Andy

  • Bind variable in PL/SQL

    What is the use of bind variables in PL/SQL..?? Give some examples.
    Thanks in advance!!

    In static SQL, bind variables are automatically used in PL/SQL.
    For a dynamic SQL example, see http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/11_dynam.htm#13131

  • EA3/EA2/EA1 - Bind Variables in PL/SQL

    EA1 seems to have taken a backward step when it comes to supporting bind variables in PL/SQL.
    Back in 1.1.3, according to the bugs fixed list, we apparently fixed bug 5884935 (BINDS IN A PL/SQL STATEMENT HAS "NOT ALL VARIABLES BOUND" ERROR), although this was only ever when running as scripts (as per Bind variables in PLSQL bug not fixed?
    Now according to the 1.2 documentation, bind variables are not supported in the script runner (section 1.7.2) and the SQL*Plus variable command is not supported (section 1.7.1). However, I can run the following code "successfully" (no errors reported but the substitution text entered does not appear in the dbms_output):
    variable bind_text varchar2(30);
    declare
    l_text varchar2(30);
    begin
    :bind_text := '&sub_text';
    dbms_output.put_line('Bind text: "' || :bind_text || '"');
    end;
    Now in EA1, running this as a script results in "ORA-01006: bind variable does not exist"
    Running the variable statement results in "ORA-00900: Invalid SQL Statement" and running the PL/SQL results in "ORA-1008: not all variables bound".
    Can someone from the SQL Developer team please comment on the intended support for bind variables in PL/SQL?
    Thanks,
    theFurryOne

    I know that the variable command isn't supported (as I said above), but that was also the case in 1.2, where it did actually sort of work.
    I am not talking about local PL/SQL variables declared within the PL/SQL - I am trying to get user entered values into the PL/SQL in the same way as prompting for bind variable values in SQL.
    So using SQL Developer bind variables inside PL/SQL is my end goal - preferably when running anonymous PL/SQL blocks as statements in the worksheet.
    However, as there have been "fixed" bugs to enable bind variables in PL/SQL, which require the use of SQL Plus commands that are not supported in SQL Developer (ie variable), I am trying to work out what the development team think the intended support for bind variables in PL/SQL is. Then I will know if what I want needs to be reported as a bug or logged as an enhancement request.
    theFurryOne

  • How to enter bind variables in Calender SQL statement

    Hi,
    Anyone know how to include bind variables in Calender SQL statement. Let's say in sql statement below:
    select
    EMP.HIREDATE the_date,
    EMP.ENAME the_name,
    null the_name_link,
    null the_date_link,
    null the_target
    from SCOTT.EMP
    order by EMP.HIREDATE
    thanks.

    Hi,
    Here is the sql statement
    select
    EMP.HIREDATE the_date,
    EMP.ENAME the_name,
    null the_name_link,
    null the_date_link,
    null the_target
    from SCOTT.EMP
    where deptno = :dept
    order by EMP.HIREDATE
    Thanks,
    Sharmila

  • How execute a dynamic statement with a variable number of bind variables

    Hi all.
    I would like to execute SQL statements in a PL/SQL function.
    SQL statements must use bind variable in order to avoid parsing time. But the number of arguments depends on the context. I can have from 10 to several hundreds of arguments (these arguments are used in a 'IN' clause).
    To minimise the number of differents signature (each new signature involve a parsing), the number of argument is rounded.
    My problem is : how to set dynamicaly the bind variables ?
    Cause it is pretty simple to construct dynamicaly the SQL statement, but using an
    " OPEN .... USING var1, var2, ..., varX "
    statement, it is not possible to handle a variable nomber of bind variable.
    I am looking for the best way to do the same thing that it can be done in java/JDBC with the PreparedStatement.setObject(int parameterIndex, Object x).
    I saw the dbms_sql package and bond_variable procedure : is a the good way to do such a thing ?
    Thanks

    If the variation is only values in an IN list, I would suggest using an object type for the bind variable. This lets you have just one bind variable, regardless of how many values are in the IN list.
    The dynamic SQL ends up looking like:
    ' ... where c in (select * from table(:mylist))' using v_list;where v_list is a collection based on a SQL user-defined type that can be populated incrementally, or in one shot from a delimited list of values using a helper function.
    I use this approach all the time in dynamic searches.
    See this link for more details:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:110612348061

  • Problem with variables in dynamic SQL/PLSQL

    Hi, I have a problem I am trying to solve using a very short piece of dynamic SQL/PLSQL but I am having problems getting the variable values out of the dynamic block.
    I need to increment a counter which could be any one of 16 counters I am using and I want to avoid using nested IF statements.
    The variable to be incremented is made up of the 'scheme', the 'contributory category' and the 'employment category' (although not every combination is valid)
    The 'scheme' can be either 'no1', 'no2', 'off', 'cg' or 'amc'
    The 'contributory category' can be either 'cont' or 'noncont'
    The 'employment category' can be either 'ft' or 'pt'
    For example the total variable name could be 'v_cg_noncont_ft_count'
    I have created a variable by concatenating the various elements called v_incr_count_name which holds the name of the variable I want to increment.
    I am running this within an anonymous PLSQL block so I cannot use global variables meaning that my variables are not visible within a dynamic PLSQL block.
    As a result I think I will need to use bind variables with a PLSQL block or a SELECT FROM INTO SQL string
    I have tried various solutions including the following PLSQL solution:
    v_incr_count_name := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'BEGIN :a := :a + 1; END;';
    EXECUTE IMMEDIATE sql_stmt USING v_incr_count_name;
    Unfortunately I am getting the 'IN bind variable bound to an OUT position' error which I suppose makes sense as I am trying to change the value of a variable in the main PLSQL block from within the dynamic block.
    Another (SQL) solution I tried was:
    v_incr_count_name := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'SELECT '||v_incr_count_name||' + 1 FROM DUAL';
    EXECUTE IMMEDIATE sql_stmt INTO v_return;
    While this executes and returns the incremented value into v_return, I am still left unable to copy the returned value into the variable whose name is stored in v_incr_count_name
    Any help appreciated
    Cheers, Dan

    this shows the syntax for the using clause
    declare
    a number := 1;
    b number := null;
    v varchar2(10) := 'A';
    begin
    execute immediate 'begin :v1 := :v1 + 1; end;' using in out a;
    dbms_output.put_line(a);
    end;
    /but what you want cannot be done
    SQL> declare
      2  a number := 1;
      3  b number := null;
      4  v varchar2(10) := 'A';
      5  begin
      6  execute immediate 'begin '||v||' := :v1 + 1; end;' using in out a;
      7  dbms_output.put_line(a);
      8  end;
      9  /
    declare
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'A' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at line 6the variable "V" contains the name of the desired output variable ("A"). this errors because "A" is not defined within the scope of the dynamic sql.
    "into the variable whose name is stored in v_incr_count_name"
    pl/sql does not support dereferencing variables, so you can't do it.

  • [Solved] Named Bind Variables at Runtime - SQL WHERE clause issue

    Hey 'all,
    I've been having this issue today with a Search page using Named Bind Variables at Runtime for the search parameters for the WHERE clause in the view objects SQL.
    I've got everything working except for a clearing method which I've created so that the user can clear the current WHERE clause from the SQL statment and set it as 1=2 (so that it doesn't do a blind query on load).
    The method can clear and set the WHERE clause to 1=2 only when there is already one there.
    Below are the methods: (located in my view object class)
    public void findInvoiceById(Number invoiceId){
        setWhereClause("invoice_id = :P_INVOICE_ID");
        defineNamedWhereClauseParam("P_INVOICE_ID",null,null);
        setNamedWhereClauseParam("P_INVOICE_ID",invoiceId);
        executeQuery();
    public void clearCriteria(){
        setWhereClause("1=2");
        removeNamedWhereClauseParam("P_INVOICE_ID");
        executeQuery();
    }The error which I get is the following - this happens when the button is pressed twice in a row, or when no query has been passed previously.
    1. JBO-29000: Unexpected exception caught: oracle.jbo.NoDefException, msg=JBO-25058: Definition P_INVOICE_ID of type Variable not found in SupplierInvoicesView1
    2. JBO-25058: Definition P_INVOICE_ID of type Variable not found in SupplierInvoicesView1
    Any help with this would be greatly appreciated!
    Cheers,

    Hi Bonnie,
    we have it working ok, but still feel that there is room for improvement in the design.
    For us the key factors are:
    Pages based on the same view object that can be queried multiple ways.
    We don't want to put design time bind variables in because it limits the use of the VO
    We don't wan't multiple VO's with different where clauses.
    The page is displaying the same table columns and fields, but the where clause must be dynamic.
    We only want to query on the search field entered (some of our tables are massive)
    TopLink named queries are really what we are after, but we don't want to forgo all the other ADF BC functionality. The only examples of ViewCriteria in the developer guide had literals in the where clause and no bind variables. The View Criteria may still be an option, but it appeared quite complex compaired to directly adding and removing bind variables at runtime.
    a couple of footnotes:
    the following methods are used to clear the runtime variables prior to reusing the VO (thanks to John Stegman for the pointer on the exception handler):
        public void clearBindVariable(String bindVariableName){
            try
                removeNamedWhereClauseParam(bindVariableName);
            catch (NoDefException e)
        public void clearBindVariables(){
            clearBindVariable("P_INVOICE_ID");
            clearBindVariable("P_INVOICE_NUM");
            clearBindVariable("P_SUPPLIER_NAME");
            clearBindVariable("P_INVOICE_DATE_FROM");
            clearBindVariable("P_INVOICE_DATE_TO");
            clearBindVariable("P_SUPPLIER_NUMBER");
        }We are using 1=1 and 1=2 in the where clause to supress blind querying. 1=2 is applied when ever we are not explicitely searching for something. We had a problem with using the refresh condition ${adfFacesContext.postback == true} which I posted about here:
    executeQuery called twice using ${adfFacesContext.postback == true}
    Would still gladly hear other ideas on a better reuse design.
    regards,
    Brenden

  • Portal bind variables in Dynamic Pages

    I have two bind variables in a dynamic Page:
    Variable Default Value
    :p_lrg_item_id 12153
    :p_lrg_color 'Rock/Black'
    I put the two variables in the where clause of my select
    statement:
    <ORACLE>
    Select distinct
    prod.prfield5,
    prdat.paval
    from product@ecom2 prod,
    prodatr@ecom2 prdat
    where prod.prprfnbr = :p_lrg_item_id
    and prdat.paprnbr = prod.prrfnbr
    and prod.prpub = 1
    and prdat.paname = 'color'
    and prdat.paval = :p_lrg_color;
    Then when I run the Page the query does not return any rows. So
    I tested my query on the database and it returned the row. So I
    took out the "and prdat.paval = :p_lrg_color" and the query
    returned all of the rows. I also put the following line in the
    code to view the variable: "htp.p('<p>'||upper(:p_lrg_color)
    ||'</p>')" and it printed 'Rock/Black' on my page. Has anyone
    else ran into this problem with bind variables.
    Thanks Steve

    Why are you using dynamic sql for that?
    Is it really necessary to proceed as such?
    It will be better to use Static PL/SQL(stored procedures , functions and package) as far as there will be an "auto binding". If you use static SQL you will not have to care about using bind variables inside your PL/SQL code. All you have to do is to make sure you will call your stored PL/SQL procedure using bind values in the input parameters
    see the following blog article for more details
    http://hourim.wordpress.com/2011/06/16/bind-variable-shared-pool-and-cursor-sharing-parameter/
    Best regards
    Mohamed Houri
    www.hourim.wordpress.com

  • Compare character variable in dynamic sql

    hi all
    i have a requirment in which i'll be using a dynamic sql:
    sql_string :='select * from temp_table where emp_name='||v_name;
    execute immediate ;
    i'm getting this error
    ORA-06502: PL/SQL: numeric or value error
    this is becouse v_name is character variable and we have to write
    select * from temp_table where emp_name='joe';
    can any one plz help me out..

    More correctly you should use bind variables (if you really really have to do dynamic SQL in the first place)...
    sql_string :='select * from temp_table where emp_name=:n;
    execute immediate sql_string using v_name;This allows the optimiser to re-use the execution plan rather than hard-parsing the query every time.
    However this still isn't right because within PL/SQL you will need to be selecting your result INTO something e.g.
    sql_string :='select * from temp_table where emp_name=:n;
    execute immediate sql_string into v_data using v_name;v_data will be a variable declared suitably to accept whatever data is being selected in the query.

  • Number of Bind variables passed  AND   Ref Cursor

    hi all
    well i have an interesting problem
    i need to construct a query for a refcursor besade on conditions....
    as:
    input params: in_lname and in_fname
    sql_stmt := 'Select first_name, ' || 'last_name, ' ||
    'from table1';
    IF in_lname is not null then
    -- we are selecting guests by Lastname, Lastname & Firstname,
    -- Lastname & Firstname & Zip, or Lastname & Zip
    sql_stmt := sql_stmt || 'where gc_last_name = :1 ';
    IF in_fname is not null then
    sql_stmt := sql_stmt || ' and gc_first_name = :2 ';
    END IF;
    END IF;
    open fm_lom_cv for sql_stmt using in_lname, in_fname;
    Now here the in_lname is required BUT in_fname can be NULL
    hence we dont excute or create the sql with sql_stmt || ' and gc_first_name = :2 ';
    so :2 will not be used
    hence it gives error IF in_fname is null ie ORA-01006: bind variable does not exist
    Please suggest how to handle it....
    thanks

    may you have to set a some variable to check
    not perfect but somthing like this
    declare
    ct number:=1;
    sql_stmt varchar2(150);
    BEGIN
      sql_stmt := 'Select first_name, ' || 'last_name, ' ||
                  'from table1';
    IF in_lname is not null then
    -- we are selecting guests by Lastname, Lastname & Firstname,
    -- Lastname & Firstname & Zip, or Lastname & Zip
       sql_stmt := sql_stmt || 'where gc_last_name = :1 ';
       ct:=1;
       IF in_fname is not null then
          sql_stmt := sql_stmt || ' and gc_first_name = :2 ';
        ct:=2; 
        END IF;
    END IF;
      case when ct=1 then
    Open fm_lom_cv for sql_stmt using in_lname;
    when ct=2 then
    Open fm_lom_cv for sql_stmt using in_lname,in_fname;
    end case;  
      

Maybe you are looking for

  • How to edit multiple regions in one Piano Roll window

    I edit multiple regions in one Piano Roll window at the same time. (It is very handy way of editing especially in huge orchestra projects.) I can see midi contents of all selected regions in Piano Roll at the same time. 1) But how to choose certain o

  • I took my mac in to get a new HD, but they gave me a smaller one without me knowing?

    So I took my imac in a few months ago because it wasn't working- they said I needed a new HD so I said okay and they took my computer and days later I got it back only to realize it was so much slower then before (even with my HD was dying it was fas

  • Can i install Try version NW CE on Win Server 2003 64 bit or must it be 32?

    Hallo everybody, i wish install try version NW CE on Win Server 2003 64 ? Here http://www.sdn.sap.com/irj/scn/downloads?rid=/library/uuid/a0a6bd7b-3dfc-2c10-eb95-aae0f777d4ab i read it run on 32 bit. Mean that on 32 only or i can install on 64 Bit to

  • Getting  error in PSA while trying to load data in cube

    Dear Friends, I am trying to load data in cube I am getting error in PISA i.e.      Value 'Boroplus Anticream 19Gm Regular Plain ' (hex. '426F726F706C757320416E7469637265616D203139476D2052') of characteristic . please guide me. Thanks in Advance. Bes

  • Shared libraries in Photos 1.0

    My wife and I have traditionally shared a single library in iPhoto (stored on an external drive). Can we continue to do so in Photos? Are there any complications when it comes to shared libraries and iCloud Photo Library? (I could just plow ahead and