In parameter/bind variable( Oracle 10G r/2)

Hi all,
I am trying to pass a date value in Pl/SQL via a table.but befor ethat I attempted to have this variable to be ran during run time.
Currently I have this error:
PLS-00306: wrong number or types of arguments in call to 'HITS'
This is an excerpt of the package which has the error:
<pre>
create or replace
PACKAGE BODY HITS AS
PROCEDURE process(var_v OUT DATE) AS
--local variables
outfile UTL_FILE.file_type;
lv_comma VARCHAR2 (1) := ',';
lv_detail VARCHAR2 (1000);
--open cursor for
CURSOR analyzed_cur
IS
SELECT TO_CHAR(date1, 'DD/MM/YY')HITS
FROM table a
WHERE DATE1 >= var_v
group by TO_CHAR(DATE1, 'DD/MM/YY')
ORDER BY TO_CHAR (DATE1,'DD/MM/YY') DESC;
each_rec analyzed_cur%ROWTYPE;
BEGIN
/* Opening output file name in 'Write' mode */
outfile := UTL_FILE.fopen (gv_exp_directory, gv_file_name, 'w', 32767);
UTL_FILE.put_line (outfile,'HITS');
OPEN analyzed_cur;
BEGIN
LOOP
FETCH analyzed_cur
INTO each_rec;
EXIT WHEN analyzed_cur%NOTFOUND;
lv_detail := '';
lv_detail := lv_detail || each_rec.HITS;
UTL_FILE.put_line (outfile, lv_detail);
END LOOP;
END;
CLOSE analyzed_cur;
/* Close output file */
UTL_FILE.fclose (outfile);
COMMIT;
</pre>
I do not want to pass teh date at run time. I actually would liek it to read via table that will contain the date that can be updated.
create table TEST_HITS (
var_bind number);
insert into TEST_HITS( var_bind)
values(495);
Any help is appreciated.
Thanks.
Edited by: CrackerJack on Aug 9, 2010 6:28 PM

Can you post how you are trying to call the procedure from a package body?
Check this:
SQL> create or replace package hits_11 as
  2  procedure my_process(a number);
  3  end;
  4  /
Package created.
SQL> create or replace package body hits_11 is
  2  procedure my_process(a number) is
  3  begin
  4  dbms_output.put_line(a);
  5  end;
  6  end;
  7  /
Package body created.
SQL> exec hits_11.my_process;
BEGIN hits_11.my_process; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'MY_PROCESS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL> exec hits_11.my_process(1);
1
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • How to pass parameter [bind variable or substitution variable] to a view?

    How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
    Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.
    In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject?
    Thank you in advance,
    MB
    What I can do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    What I want to do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);

    Blais wrote:
    How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
    Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.Yes, there can be performance issues. Views are a form of dynamic SQL and it is hard to predict how they will perform later.
    You can't pass parameters to a view. They are not functions. The mechanism to put the values in is what you mentioned, passing the parameter when you query the view.
    In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject? This functionality is not supported.
    What I can do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    What I want to do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);Include the bind value when you use the view in a SELECT. The value will be applied to the view at run-time, somthing like
    CREATE  VIEW "HR"."EMP_NAME_VW" ("FIRST_NAME", "LAST_NAME","EMPLOYEE_ID")(prmEMP_ID)
    AS  SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    select *
      from emp_name_vw
      WHERE EMPLOYEE_ID IN (:prmEMP_ID);To use EMPLOYEE_ID I added it to your list of columns in the view so it can be referenced in the WHERE clause. If you don't want to see that value don't select it from the view.

  • Note 830576 - Parameter recommendations for Oracle 10g

    hi all DBA experts.
    I am not good familiar with Oracle database while i read a Note 830576 - Parameter recommendations for Oracle 10g. in which SAP General Recommendation:
    You should delete obsolete initialization parameters from the profile.
    To determine which obsolete parameters are currently set, proceed as follows:
    SQL> SELECT NAME FROM V$OBSOLETE_PARAMETER WHERE ISSPECIFIED = 'TRUE';
    when i execute above command then result is no rows selected
    while there are many parameters in above SAP Note which are already obsolete and not set in initSID.ora file.
    for exp.  the parameter OPTIMIZER_INDEX_COST_ADJ  is showing
    #### OPTIMIZER MODE
    #optimizer_index_cost_adj = 10
    as you know that this parameter is very important regarding System Performance.
    now please guide me . I have to set these parameter or no need while there is not showing any parameters against obsolete command.
    waiting you valuable reply.
    Regards,

    hi both,
    thanks for knowledge sharing with me other SDN users,
    Dear Orkun,
    Ok. At this stage, I can recommend you that apply what they have suggested,
    in the message. So, you already did a part of it by configuring
    Oracle parameters, already.
    SAP support sent me this file (PRD_Parameters)
    *** INFORMATION  1 ***
    *** INFORMATION  2 ***
    *** INFORMATION  3 ***
    *** INFORMATION  4 ***
    *** INFORMATION  5 ***
    *** INFORMATION  6 ***
    *** INFORMATION  7 ***
    *** INFORMATION  8 ***
    *** INFORMATION  9 ***
    *** INFORMATION 10 ***
    *** INFORMATION 11 ***
    _b_tree_bitmap_plans
    _fix_control (4728348)
    event (10753)
    event (38087)
    event (10183)
    optimizer_index_cost_adj
    star_transformation_enabled
    event (10027)
    event (10028)
    event (10411)
    event (10629)
    event (14532)
    _fix_control (5705630)
    _fix_control (5765456)
    _optimizer_mjc_enabled
    _sort_elimination_cost_ratio
    event (10091)
    event (10142)
    event (38068)
    event (38085)
    event (44951)
    parallel_execution_message_size
    parallel_threads_per_cpu
    query_rewrite_enabled
    log_archive_dest_1
    log_archive_format
    max_dump_file_size
    optimizer_features_enable
    log_archive_dest
    _push_join_union_view
    _cursor_features_enabled
    _first_spare_parameter
    event (10049)
    db_writer_processes
    parallel_max_servers
    db_cache_size
    pga_aggregate_target
    processes
    sessions
    dml_locks
    job_queue_processes
    log_checkpoint_interval
    remote_login_passwordfile
    sga_max_size
    shared_pool_reserved_size
    sort_area_retained_size
    sort_area_size
    statistics_level
    workarea_size_policy
    they only highlighted these following parameters from above
    **** INFORMATION  8 ***     DB Patchset: 10.2.0.4.0
    **** INFORMATION  9 ***     DB Mergefix: 0 (released before 2008-07-11)
    FYI... recently, i applied the Oracle Patches 10.2.0.4 in this sequence
    MS Windows x86-64 (64-bit)
    Patchset_10204_MSWIN-x86-64aa.bin
    Patchset_10204_MSWIN-x86-64ab.bin
    Patchset_10204_MSWIN-x86-64ac.bin
    OPatch
    OPatch_10205_Generic_v0.zip
    Generic (32-bit / 64-bit)
    p8350262_10204_Generic.zip
    p7592030_10204_WIN_GENERIC.zip
    p9254968_10204_WIN_GENERIC.zip
    10204_Patch44_MSWIN-x86-64.zip
    p9584028_102040_Generic.zip
    p9843740_10204_Generic.zip
    and please tell me , still i have to apply highlighted parameters or now no need.
    Regards,

  • SAP Note 830576 - Parameter recommendations for Oracle 10g

    As per SAP Note 830576 - Parameter recommendations for Oracle 10g, I have tried to change the value for
    parameter "db_file_multiblock_read_count".
    In sql prompt it shows:
    SQL> show parameter DB_FILE_MULTIBLOCK_READ_COUNT
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     128
    and in brtools it shows:
    58 - db_file_multiblock_read_count      both     no      *       yes   128
    But  I got the following error, when i tried to set it null
    1 * Parameter description (desc) ..... [db block to be read each IO]
    2 * Parameter type (type) ............ [integer]
    3 * Current parameter value (parval) . [128]
    4 * Value in spfile (spfval) ......... []
    5 # New parameter value (value) ...... [null]
    6 - Scope for new value (scope) ...... [both]
    7 # Database instance (instance) ..... []
    8 ~ Comment on update (comment) ...... []
    9 - SQL command (command) ............ [alter system reset db_file_multiblock_read_count scope = spfile sid = '*'; alter system reset db_file_multiblock_read_count scope = memory sid = 'MBD']
    BR0662I Enter your choice:
    c
    BR0280I BRSPACE time stamp: 2008-08-14 18.19.22
    BR0663I Your choice: 'c'
    BR0259I Program execution will be continued...
    BR0280I BRSPACE time stamp: 2008-08-14 18.19.23
    BR0301E SQL error -32010 at location BrSqlExecute-1, SQL statement:
    '/* BRSPACE / alter system reset db_file_multiblock_read_count scope = spfile sid = '''
    ORA-32010: cannot find entry to delete in SPFILE
    BR1017E Execution of SQL statement 'alter system reset db_file_multiblock_read_count scope = spfile sid = '*'; alter system reset db_file_multiblock_read_count scope = memory sid = 'MBD'' failed
    BR0669I Cannot continue due to previous warnings or errors - you can go back to repeat the last action
    BR0280I BRSPACE time stamp: 2008-08-14 18.19.23
    BR0671I Enter 'b[ack]' to go back, 's[top]' to abort:
    Kinldy let me know, what could me wrong.

    Hi Markus,
    As per your suggestion we have downloaded the files from UCLIB_3-20000978.SAR. But now getting the error as
    sapccmsr -DCCMS -j2ee pf=profile value
    INFO: use SAPLOCALHOST hostname
    INFO: CCMS agent sapccmsr working directory is /usr/sap/ccms/XX1_00/sapccmsr
    INFO: CCMS agent sapccmsr config file is /usr/sap/ccms/XX1_00/sapccmsr/csmconf
    INFO: Central Monitoring System is [XX1]. (found in config file)
    INFO: additional Central Monitoring System is [AS2]. (found in config file)
    ERROR: Cannot open Monitoring Segment 0 rtc = 245
    Last reported error: [249]  CCMS monitoring segment has wrong EYE CATCH. It seems to be created as non-unicode segment.
    This program runs as unicode. Please use non-unicode version
    Please suggest
    Thanks,
    Anu

  • How to change timeout parameter value in Oracle 10g R2

    Anyone knows how to change timeout parameter value in Oracle 10g Database R2?

    Waheed Azhar wrote:
    actually i am getting ORA-01013 exception which directly relates to the timeout value but i think it's hidden parameter...What makes you think it's a hidden parameter?
    A search of MetaLink for that error turns up a number of hits, most of which a very situational specific. Exactly what are you doing when you get this error? Are you connecting over an ODBC connection? Are you getting it on a connection request? At db shutdown? During a long-running query?

  • Parameter recommendations for Oracle 10g?

    Hello,
    This note 830576 contains sap`s recommendations for Oracle 10g, but the some parameter information during EarlyWatch Alert do not follow Sap standard recommendations Are not in that note. 
    These parameters are no longer used?
    Can be removed?
    Which I attribute value? The note does not have the parameters and values.
    Those are the parameter:
    pushjoin_predicate
    db_block_checksum
    hash_join_enabled
    log_archive_start
    max_rollback_segments
    transaction_auditing
    Regards,
    Antonio Júnior

    Hi,
    this Parameters is used in older oracle version <10g
    pushjoin_predicate  :  No need to set in 10g 
    db_block_checksum : Note 923919 - Advanced Oracle block checking features
    hash_join_enabled : No need to set in 10g 
    log_archive_start :  No need to set in 10g
    max_rollback_segments : No need to set in 10g 
    transaction_auditing : No need to set in 10g
    regards,
    kaushal

  • How to Increase distributed Transaction parameter value in oracle 10g r2

    Hello,
    Can you please let me know how to increase the value of Distributed Transaction Parameter in oralce 10g R2
    Thanks
    Usman

    Why do you want to increase this?
    If you are getting ORA-02042, you have to reduce the number of concurrent distributed transactions you are running or restart your database to clear existing ones.

  • PCTFREE setting for index in Oracle 10g R2

    Is PCTFREE parameter obsolete in oracle 10g R2? I don't see any reference to this paramerer in oracle documentation:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231.pdf
    But 10g R 1 does mention about this setting.
    http://support.cs.nott.ac.uk/help/docs/databases/oracle/standard/server.101/b10739.pdf
    We are still using Dictionary Managed tablespaces on 10.2.0.3. Can we ignore this parameter on 10g R2 ?
    Thank You

    PCTFREE is still relevent even in ASSM. (that you are using DMT means that you are not using ASSM, but LMT could be MSSM !)
    I couldn't find PCTFREE in the Administrator's Guide but it is still very much present in the SQL Reference
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/clauses007.htm#g1058547
    and a couple of references in the Performance Tuning Guide.

  • Performance tuning oracle 10G on Windows 2003

    Hi,
    At present we have 8GB physical RAM on Production server while the parameters sga_max_size = 1 GB and pga_aggregate_target = 629 MB are defined.
    When I hit transaction ST02 I observed that values for swaps are showing in red color for program, screen, Export/import, generic key buffers etc. We cannot restart the SAP more than once in a week, and it increases the number of swaps.
    We have plan to increase the buffer size by twice for program, screen, Export/import, CUA, Nametab, generic key buffers etc. The addition of current value for all this buffers is defined up to 350MB.
    I want to know if I increase this value by twice is it cause any problem to system or I need to increase the size of sga_max_size and pga_aggregate_target also.
    Is sga_max_size and pga_aggregate_target parameters are related to program buffer or screen buffer or generic key buffers.
    Thanks & Regards,
    Rajesh

    Hi,
    check following SAP Notes
    Note 618868 - FAQ: Oracle performance
    Note 830576 - Parameter recommendations for Oracle 10g
    Note 88416 - Zero administration memory management as of 4.0A/ Windows
    Note 546361 - FAQ: Storage problems on NT/Windows 2000
    Note 103747 - Performance: Parameter recommendations as of Release 4.0
    regards,
    kaushal

  • Getting bind variables

    I have created a report from a SQL query. It has a bind variable in the query. I use the customization page with an LOV to set the bind variable. All this works fine. Now I want to display the value from the display_column when the report is run. Showing the query conditions displays the numeric return value which won't make much sense to the user. How do I get the value of the bind variable so I can display it?
    Edited by: user478864 on Aug 31, 2010 12:12 PM

    I use get_value('p_parameter_name') in the "after displaying the header" section (on the Additional PL/SQL Code tab) of a portal report to display the value of a parameter (bind variable) so you could probably use that as a starting point for some plsql to query up the display name based on the value in get_value('p_your_parameter').
    DECLARE
    BEGIN
    htp.p(get_value('p_your_parameter'));
    END;

  • Bind variable with search parameter in Oracle BI Publisher 10

    Search list for a search parameter in Oracle BI EE works fine when the query doesn't contain a bind variable (parameter identifier). But when a bind variable is introduced in the constraint of search list query, it keeps on searching endlessly. For example,
    -- this doesn't work
    select col1
    from table
    where table.col2 = :I_param_bind_var
    -- this works
    select col1
    from table
    where table.col2 = 'xyz'
    Using such bind variable in the list of values for menu parameters works fine. Is it an issue regarding publisher or am I missing something?
    Edited by: 933296 on Aug 21, 2012 1:38 AM

    <?param@begin:Show_Location;'Yes';'string';'Yes,No'?>
    it will give the Parameter Show_Loactaion with drop down Yes and No.
    and to display <?$Show_Location?>
    <?param@begin:dept;'PAY'?>
    <?$dept?>

  • How to pass bind variable into oracle reports 6i - Parameter form

    Hello All,
    I want to pass bind variable into Oracle Reports 6I - Parameters.
    I have tried out that but got the below error :-
    rep-0781 : Bind variables are not allowed in the select statement
    Kindly help me is there any option which allow me to pass bind variables into Oracle reports 6I.
    Thanks
    HARSH SHAH

    Hi,
    may be its not possible to use :P_PARAM1 in user parameter of oracle 6i reports
    but u can full fill user requirement using oracle forms
    create a form as like as report parameter window
    then create parameter list and run report
    PROCEDURE Run_Emp_Report IS
      pl_id ParamList;
    BEGIN
      pl_id := Get_Parameter_List('tmpdata');
      IF NOT Id_Null(pl_id) THEN
        Destroy_Parameter_List( pl_id );
      END IF;
      pl_id := Create_Parameter_List('tmpdata');
      Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
      Run_Product(REPORTS, 'empreport', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    END;
    thanks
    mostafiz mitul
    Dhaka Bangladesh

  • Can Oracle convert literals to bind variables?

    Good morning everyone.
    I have a procedure similar to this in our database:
        FUNCTION Get_Tag_Element_Id_For_Set(Element_Attr_Id_Table_In   in    ATTRIBUTE_TABLE_ID_TAB) RETURN NUMBER IS
          v_Select_Statement                    VARCHAR2(32767);
          v_Element_Id                             ELEMENT.Element_Id%TYPE;
        BEGIN
          FOR I IN 1..Element_Attr_Id_Table_In.COUNT LOOP
            IF v_Select_Statement IS NULL THEN
              v_Select_Statement := 'SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Element_Attribute_Id = ' || Element_Attr_Id_Tab_In(i);
            ELSE
              v_Select_Statement := v_Select_Statement || ' intersect ' ||
                                    'SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Element_Attribute_Id = ' || Element_Attr_Id_Table_In(i);
            END IF;
          END LOOP;
          EXECUTE IMMEDIATE v_Select_Statement INTO v_Element_id;
          RETURN v_Element_Id;
        END;What this does is to create a query similar to this:
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 1 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 2 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 3 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 4 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 5;
    I am using Dynamic SQL because the number of intersect pieces can vary from 1 to 15 and in the future it can grow.
    The problem that I have is that because the literals are part of the string, the query is being hard parsed every single time. In our production environment this means 100s of thousands of times per day which according to our DBA has added 15% plus to our average load. I know that I can come up with a rewrite to avoid this, but I was wondering if there is a parameter I can set at the session or at the database level where the database itself can convert this kind of query into one with bind variables.
    Thanks,
    Tom
    Edited by: Thomas Morgan on May 3, 2013 8:21 PM

    Thomas Morgan wrote:
    Basically I have an XML document.
    The document has ELEMENTS.
    ELEMENTS can have attributes.
    There is a many to many relationship between ELEMENT and ATTRIBUTES so I have a XREF table to represent this relationship.
    When I receive a new document, I need to determine if a group of ATTRIBUTES already exist together in the XREF table so I have to find their common ELEMENT_ID or NULL in which case I would create a new ELEMENT and associate the new set of attributes to the new ELEMENT.
    Since the number of attributes can vary from 1 to around 15 for now, I had to dynamically build the query that find the common ID(intersect) if it exists.
    Here is some DDL and inserts:
    CREATE TABLE ELEMENT(ELEMENT_ID NUMBER NOT NULL);
    CREATE TABLE ELEMENT_ELEMENT_ATTRIBUTE_XREF(Element_Id NUMBER NOT NULL, Element_Attribute_Id NUMBER NOT NULL);
    ALTER TABLE ELEMENT_ELEMENT_ATTRIBUTE_XREF ADD CONSTRAINT ELEMENT_ATTR_MANY_2_MANY_PK PRIMARY KEY(Element_Id, Element_Attribute_Id);
    ALTER TABLE ELEMENT ADD CONSTRAINT ELEMENT_PK PRIMARY KEY(Element_Id);
    INSERT INTO ELEMENT VALUES(1);
    INSERT INTO ELEMENT VALUES(2);
    INSERT INTO ELEMENT VALUES(3);
    INSERT INTO ELEMENT VALUES(4);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(1, 1);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(1, 2);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(2, 1);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 1);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 3);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 4);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 5);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(4, 6);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(4, 7);
    So for instance if I passed an array (Attribute ID Tab) containing ELEMENT_ATTRIBUTE_ID list 6 and 7 I would get 4 as the answer.
    Hope this helps,
    Thanks,
    TomAwesome, thanks!
    I'm not sure this works 100% for what you need, but I thought I'd give it a shot. I've used a built in array (sys.odcinumberlist) that you should have access to on your installation (assuming you have a relatively recent version of Oracle).
    I left out the part where you would loop through the array you are currently passing in to your procedure to build up this new array that you can use in a SQL statement.
    Cheers,
    create or replace procedure maybe_this
       in_list           sys.odcinumberlist
    is
       l_commonality     number;
    begin
       begin
          select
             distinct
                xref.element_id
          into
             l_commonality
          from
                table(cast(in_list as sys.odcinumberlist))  list
            ,  element_element_attribute_xref   xref
          where
             xref.element_attribute_id = list.column_value;
          dbms_output.put_line('match on element_id = ' || l_commonality);
       exception
          when too_many_rows or no_data_found
          then
             dbms_output.put_line('no match');
       end;
    end;
    ME_TUBBZ?exec maybe_this(sys.odcinumberlist(1,2));
    no match
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    ME_TUBBZ?exec maybe_this(sys.odcinumberlist(6,7));
    match on element_id = 4
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01

  • Can viewObject get a parameter from sessionScope to binding variable?

    hello,
    using Jdev11g ADF Fusion application
    Can viewObject get a parameter from sessionScope and assign into binding variable ? without using executeWithParameter
    Thanks
    greenApple

    A. Safwat,
    As I said before, I was not trying to be offensive, but simply to explain some of the shortcomings of one solution over another. One of the reasons people give such short answers is that many questions (including this one) have been asked and answered many many many times before on the forum. As to my reasons:
    1). Overkill - overkill because you are writing code to do what the framework already provides for you.
    2). Not bind-variable friendly - you are gluing in literals into a SQL statement. That means that Oracle will have to hard parse the query for each new value of the filter clause, yielding to poor performance, particularly in a multiuser environment. It should ideally be done using bind variables.
    3). Insecure (think about what happens if you put "'xyz' or 1=1" into the filterValue there) - not using bind variables is a security hole. Think through what happens if a filter criteria comes through like the one I mentioned.
    4). Inflexible - because you are overriding executeQueryForCollection, this VO becomes inflexible and can only be used in this particular place. Using the declarative approach outlined by Timo is more flexible
    5). Bad (ok, that's my opinion there) - OK, perhaps this was a bit offensive ;)
    Please don't take a critique of a post as offensive, as I assure you it was not intended to be in that spirit. As I mentioned, I greatly appreciate when people point out issues/problems/etc with my ideas, as that is the best way for me to learn. I have in the past written applications that were not bind-variable friendly, and I learned the downsides the hard way (system was horribly non-performant) - I wish someone had reviewed my approach and told me "bad idea" before the application made it into production.
    Respectfully,
    John

  • Search parameter type with bind variable

    For Search type parameter in Oracle BI Publisher, if the List of values (SQL Query) contains bind variable, then application keep on searching. Any suggestions ?.
    Thanks in advance.
    Edited by: 966132 on 17-Oct-2012 22:23

    I don't think the search-type parameter works properly. It doesn't seem to function in our OBIEE 11g (11.1.1.5 + BP3). When you use a query that retrieves both the descriptive string and the numeric ID, the search box does correctly show the descriptive string. However, after selecting one of the choices, the actual data query returns nothing.
    Furthermore, the extra steps required to search take longer than scrolling through a very long list of values, the normal way. Good idea, bad implementation, no surprise.

Maybe you are looking for