LOV in stored procedure

How do I send a LOV to a stored procedure? I have an external application which needs to send a LOV to a stored proc. I was trying to assign the LOv to a vachar2 datatype in the stored proc which obviously did not work. Is there any way to get this done?
Thanks

here's the code:
procedure z_sp_test_lov (sic in Varchar2, svc varchar2, cust_cursor in out my_types.ref_cursor )
is
begin
          if sic = 'No' then
                         open cust_cursor for
                                   SELECT
                                   table_1.col3,
                                        table_1.col4,
                                        table_2.col5
                                   FROM
                                   table_1,
                                        table_2     
                                   WHERE
                                   table_1.col1 = table_2.col3
                                   and table_1.col2 in (svc) ;
               elsif sic = 'Yes' then
                              open cust_cursor for
                                   SELECT
                                   table_1.col3,
                                        table_2.col6
                                   FROM
                                   table_1,
                                        table_2     
                                   WHERE
                                   table_1.col1 = table_2.col3
                                   and table_1.col2 in (svc) ;
               end if;
end;
The sic variable can have only singular values : 'Yes' or 'No'.
The svc variable which I made as a varchar2, can have multiple values. e.g
what I want to send is somewhat like this so that the in clause works:
'red', 'green', 'yellow'.
But in order for this to work with the varchar2, I must wrap it as a string. I am ok with wrapping it any how since I can then manipulate the data inside the stored proc and format it to work with the in clause. Hope this will clarify things a little more.
Thanks,

Similar Messages

  • Use return date value in stored procedure

    hi
    i am new in oracle , i make stored procedure to fetch data in the form and i make calendar , i want user when they select a date from date LOV the stored procedure use this date in the query.. i try like this in the query:
    when time=:blok.date_item;
    but i get IN OUT error in the procedure.
    any help will be appreciated.

    ok this is the package header:
    create or replace package get_outvalue_test is
    type rec is record (time archive.time%type,
    value archive%type);
    type value_tab is table of rec index by binary_integer;
    procedure get_value(p_returnvalue IN OUT value_tab);
    end;
    package body :
    create or replace package body get_outvalue_test is
    procedure get_value(p_returnvalue IN OUT value_tab)
    is
    ii number;
    cursor valselect is
    select time,value from archive where u_id=5666
    and time=:block.date_item ; -- this is the return date from LOV
    begin
    open valselect;
    ii:=1
    loop
    fetch valselect into
    p_returnvalue(ii).time;
    p_returnvalue(ii).value;
    exite when valselect %notfound;
    ii:=ii+1;
    end loop;
    end;
    end;
    this is the error when i compile the package body :
    MIssing IN or OUT parameter at index
    i hope itis cleare and easy .

  • How to create a LOV based on a stored procedure returning a cursor

    Hello,
    I've tried to search the forum, but did not find much. We are facing a problem of large LOVs and creating large TMP files on the app server. Our whole application is drived by store procedures. LOVs are built manually by fetching data from cursors returned from stored procedures. That creates the issue when whole LOV needs to be stored in the memory and thus the TMP files.
    Is there anyway how to create LOV based on a procedure returning cursor ?
    Thank you,
    Radovan

    Hello,
    As of now we populate the record group by looping through the ref cursor and adding rows into it. Is there a better way? That forces the whole record group to be stored in a memory on the app server.
    Thank you,
    Radovan

  • Stored procedure and LOV

    How to use inputListOfValues component to show multiple options for parameter of stored procedure?

    Hi,
    model driven List of Values exist for attributes of ADF BC View Objects only.
    To build a list of value model for non model driven LOV, you extend the abstract ListOfValuesModel class and expose it on a managed bean. An example for this is available in the ADFc RC component demo that you can download from http://www.oracle.com/technology/products/adf/adffaces/11/doc/demo/adf_faces_rc_demo.html
    The source code of the sample is contained in the WAR file. Look at the "DemoLOVBean"
    Frank

  • Function calling stored procedure that returns a cursor into a LOV

    Hello,
    Is it possible in HTML DB to implement a process that has a function that calls a stored procedure that returns a cursor, used to then populate a select list?
    Or can I do a function call to a stored procedure in the 'List of values definition' box for the item itself that returns a cursor to populate the item's select list?

    Hi Vikas,
    Actually, I just found another posting that shows how to do what I'm looking for:
    Re: Filling a LOV with a cursor
    Check it out. I posted another question in response to that discussion...maybe you could answer that? Thanks!
    Laura

  • LOV parameter using stored procedure.

    I have a report has one parameter and uses stored procedure to retrieve the content. The parameter (drop down box) is a dynamic list-of-value with another stored procedure to retrieve the data. Without using any business view object.
    I deployed the report into the server. I have set the database properties in the Process->Database option. When I preview the report, it always prompts me to enter the user name and password for database connection before the parameter page.
    How and where to set the connection user name and password for the dynamic list-of-value stored procedure data source?
    Thanks.

    Try the following:
    - Go to the Repository Explorer in Business View Manager.
    - Right-click the LOV. Click Schedule.
    - Click the Parameters tab. Enter the correct parameters. If Database Logon is available, provide the correct database logon information.
    - Schedule the LOV to a recurring schedule that fits the business needs (for example, daily, hourly, or weekly).
    The LOV will not run on demand, but the report can be run on demand.
    Caroline

  • Crystal Reports 2008 Stored Procedure and Parameters from LOVs

    Quite simple report using stored procedure as data source. When editing some of the parameters we get this error when clicking OK to close "This stored procedure parameter can only accept multiple values. Please ensure that Allow Multiple Values is true."
    As we all know stored procedure parameters do not access multiple values at all, so this message is very hard to debug. The report does work if we set the 'Allow Multiple Values' to true, but only when using exactly one value for the parameter. We have tried verify database and other things, but cannot find any way around this issue.
    All ideas are appreciated as this is stopping us from utilizing the dynamic parameters.
    Thanks, Stig

    We managed to work around the issue by creating a new stored procedure. First we used the same parameter names and changed the data source to the new stored procedure. After renaming the parameter with the issue the problem then was resolved.
    Note that another parameter that was earlier affected by this issue in the way that it could not be edited and saved due to the same error message now also works fine. This even if this parameter has not changed names.
    Quite a complex situation to debug this. Maybe if the source of the error message is found in the code we could help testing.
    Stig

  • How do I get data to the from in a form based on a stored procedure

    I would like to create a form based on a stored procedure. I have bound LOV's that lookup the ID of the data that is to be displayed on the form. Then I have a button that reads the database and populates the fields on the form. This is our current UI standard on our portal site, and I need to copy that UI exactly in order to mix HTML DB code with our current portal code because we can not afford to re-write all our code in portal to HTML DB. Can this be done, and how can it be done? Thanks

    We are developing an entire HR system for our organization using portal forms. I am trying to prototype in HTML DB to see if we can switch our future development to this new product. However, we already have 50 or so forms that follow a certain user interface look and feel in portal. I am trying to create this interface look and feel in HTML DB. What we are doing in Portal is have a lookup section at the top of each form where you find the record you want to update with LOV's, sometimes 2 or 3 bound together, and then have a lookup button that does PL/SQL to read the database and populate the fields on the form. Then there is an Update button at the end of the form that takes the fields off the form and passes them to a stored procedure. I can not figure out how to do the Lookup button type of code to read information and bring it to the form when doing a form based on a stored procedure.

  • Setting Date value in stored procedure via jdbc

    I have a stored procedure where one of the parameters is a date value. I am trying to invoke this through jdbc with a CallableStatement. I am creating a java.sql.Date object and passing that to setDate() on the CallableStatement. When I execute the statement, Oracle always uses 00:00 for the time (hh:mm). Why can't Oracle interpret a java.sql.Date and get both the date and time values? Do I need to somehow call the Oracle function to_date(stringvalue, "yyyy-mm-dd hh:mm") to create an Oracle date value and if so how would I execute that from java through jdbc? My guess is that I can't. Any thoughts would be appreciated.

    ok this is the package header:
    create or replace package get_outvalue_test is
    type rec is record (time archive.time%type,
    value archive%type);
    type value_tab is table of rec index by binary_integer;
    procedure get_value(p_returnvalue IN OUT value_tab);
    end;
    package body :
    create or replace package body get_outvalue_test is
    procedure get_value(p_returnvalue IN OUT value_tab)
    is
    ii number;
    cursor valselect is
    select time,value from archive where u_id=5666
    and time=:block.date_item ; -- this is the return date from LOV
    begin
    open valselect;
    ii:=1
    loop
    fetch valselect into
    p_returnvalue(ii).time;
    p_returnvalue(ii).value;
    exite when valselect %notfound;
    ii:=ii+1;
    end loop;
    end;
    end;
    this is the error when i compile the package body :
    MIssing IN or OUT parameter at index
    i hope itis cleare and easy .

  • File Uploads using stored procedures

    Hello, I'm quite new here, but I have a question that I've been butting my head against for the past day. Here goes.
    We need to upload a file using a stored procedure (PL/SQL procedure.)
    The two things I have found that work are
    1) Having oracle do the file handling (using bfiles) in the procedure
    2) using an insert statement directly to upload the file contents into a blob.
    The platform is php (Oracle instant client) and I will show some code examples.
    1) is unworkable because Oracle will not have direct access to any files.
    2) is fine, but we would prefer to use a procedure so as to abstract what exactly goes on and possibly other operations away from the php and the framework.
    What worked:
    1)
    CREATE OR REPLACE PROCEDURE php_upload_file (file_name in varchar2, canonical_name in varchar2, owner in number, file_id IN OUT number)
    AS
    src_loc bfile:= bfilename('DOC_LOC',php_upload_file.file_name);
    dest_loc BLOB;
    begin
    insert into files values(owner,canonical_name,empty_blob(),files_seq.nextval) returning files.data, files.file_id
    into dest_loc, file_id;
    dbms_lob.open(src_loc,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(
    dest_lob => dest_loc
    ,src_lob => src_loc
    ,amount => DBMS_LOB.getLength(src_loc));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_loc);
    COMMIT;
    end;
    'DOC_LOC' is a directory I've set up that the user has access to.
    Interfacing with PHP this just looks like
    oci_parse($conn,"BEGIN php_upload_file('{$uploadfilename}','{$propername}',{$ownerid},:file_id); END;");
    Dead simple, right?
    I also do a bind command to pull out 'file_id' so I know the id that was just inserted.
    The other solution is
    $contents = file_get_contents($_FILES["uploadedfile"]["tmp_name"]);
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
    $stmt = oci_parse($conn,
    "INSERT INTO files (employee_id, filename, data, file_id) VALUES(175,'"
    .$_FILES["uploadedfile"]["name"].
    "', empty_blob(), files_seq.nextval) RETURNING file_id, files.data INTO :file_id, :src_contents");
    where :src_contents is binded to a lob and :file_id as before is binded to an INT:
    oci_bind_by_name($stmt, ':src_contents', $lob, -1, OCI_B_BLOB);
    oci_bind_by_name($stmt, ':file_id', $insert_id, -1, SQLT_INT);
    oci_execute($stmt,OCI_DEFAULT);
    In this case the last thing I do before the commit is
    $lob->save($contents);
    Both work fine, but what I need is this
    $contents = file_get_contents($_FILES["uploadedfile"]["tmp_name"]);
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
    $stmt = oci_parse($conn,"BEGIN do_upload_file(:src_contents,'{$propername}',{$ownerid},:file_id); END;");
    oci_bind_by_name($stmt, ':src_contents', $lob, -1, OCI_B_BLOB);
    oci_bind_by_name($stmt, ':file_id', $insert_id, -1, SQLT_INT);
    oci_execute($stmt,OCI_DEFAULT);
    $lob->save($contents);
    oci_commit($conn);
    this omits error conditions (such as on $lob->save ... etc.) it is simplified.
    The content of the procedure I changed as follows, but it seems untestable.
    CREATE OR REPLACE PROCEDURE do_upload_file (src_contents IN OUT blob, canonical_name in varchar2, owner in number, file_id IN OUT number)
    AS
    dest_loc BLOB;
    begin
    insert into files values(owner,canonical_name,empty_blob(),files_seq.nextval) returning files.data, files.file_id
    into dest_loc, file_id;
    dbms_lob.open(src_contents,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.COPY(dest_lob => dest_loc,
    src_lob => src_contents
    ,amount => DBMS_LOB.getLength(src_contents));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_contents);
    COMMIT;
    end;
    I don't get errors because I cannot figure out a way to run this procedure in my PL/SQL environment with valid data. (I can run it with a blank blob.)
    But when I work out the order of what's going on, it doesn't make sense; the commit in the procedure is before the $lob->save(...) and thus it would never save the data... nonetheless it should at least create a record with an empty blob but it does not. What is wrong is beyond the error level that seems to be supported by PHP's oci_error function (unless I have not discovered how to turn all errors on?)
    In any case I think the logic is wrong here, but I'm not experienced enough to figure out how.
    To test it I would need to create a driver that loads an external file into a blob, and passes that blob into the procedure. Trouble is, even if I make a blob and initialize it with empty_blob() it treats it as an invalid blob for the purposes of the dbms_lob.copy procedure.
    If someone has solved this problem, please let me know. I would love to be able to do the file upload with just a single procedure.

    Thanks. In my estimation that is exactly the issue. But that doesn't help with a resolution.
    The actual file size: 945,991 bytes
    If Firefox is miscalculating the length (in Safari/Chrome 945991 and 946241 in Firefox), then Firefox is reporting erroneously and should be raised as a bug in Firefox, would you agree?

  • Java Stored Procedures and Oracle XE

    Hi folks,
    Does anyone know if Oracle XE supports Java Stored Procedures.
    Thanks in advance,
    Kris

    Unfortunately you misunderstood me. I didn't call Oracle XE crippled, Yes, I did misunderstand. Apologies.
    Bottom line - JMS is not extant. JMS and AQ are not quite the same thing.
    AQ was developed back in early Oracle8 (8.0) (and possibly the late Oracle 7) days and seems to have been a pure PL/SQL implementation (probably with hooks at the C/C++ DB kernel level). The extensions that link to JMS came later.
    Since JMS depends on Java, and since 'Java in the database' is not part of XE by design and well documented, I considered you comment
    that JMS is not supported at all in Oracle XE or is at least
    severly crippled.to be more than you apparently meant it to be,
    AQ is 'supported' but lack of Java Stored Procs causes some limitations here as you have noted, as well as in Oracle Text and interMedia support.
    I'd love to see Java in the database for future upgrades to XE.

  • Error creating stored procedure using Apex

    Hello,
    I have worked with Access, SQL Server, and Firebird before, but am new to Oracle. I am trying to create a stored procedure to return the count of multiple hash values in a table. I want to know the number of rows that contain hash values that are duplicates somewhere else in the table. So if my table has 10 rows containing hash values: a, b, a, b, c, d, e, a, b, a, my return value should be 7. Here is my create procedure statement:
    CREATE OR REPLACE PROCEDURE CommonHashValuesCount (dupThreshold in number, totalCount out number)
    IS
    BEGIN
    totalCount := 0;
    FOR h IN
    (SELECT DISTINCT xf.MD5_HASH, COUNT(xf.MD5_HASH) as "HashCount"
    FROM XFILE xf
    GROUP BY xf.MD5_HASH)
    LOOP
    IF h.HashCount > dupThreshold THEN
    totalCount := totalCount + h.HashCount;
    END IF;
    END LOOP;
    END;
    I get the following error when I try and run it:
    ERROR at line 12: PL/SQL: Statement ignored
    1. CREATE OR REPLACE PROCEDURE CommonHashValuesCount (dupThreshold in number, totalCount out number)
    2. IS
    3. BEGIN
    Can anyone tell me what is wrong with my create statement? Or if anyone knows how to accomplish what I want in a single sql statement, I'd love to hear it!
    TIA,
    Theresa

    Why not do it in a SQL statement so you can test it in the APEX SQL command window?
    SELECT Sum(HashCount)
      FROM (SELECT DISTINCT xf.MD5_HASH
                 , COUNT(xf.MD5_HASH) HashCount
              FROM XFILE xf
             GROUP BY xf.MD5_HASH
    WHERE HashCount > <testvalue>
    not tested
    and then simply put that into your stored procedure/package:
    SELECT Sum(HashCount)
      INTO totalCount
      FROM (SELECT DISTINCT xf.MD5_HASH
                 , COUNT(xf.MD5_HASH) HashCount
              FROM XFILE xf
             GROUP BY xf.MD5_HASH
    WHERE HashCount > dubThreshold
    also not tested
    C.

  • Query in Stored Procedure accessing another schema

    Hi - this is going to sound kind of strange and even i can't come up with an explanation. My JDK 1.1.7 applet uses a type 4 JDBC thin driver (i think v 8.04.06) to access an Oracle 7.3.4 database. We also have a link with full grants and synonymns to another Oracle schema in an Oracle 8 database. Has never been a problem - we can access anything we need to through queries or stored procedures from either of these databases.
    So, i have a new stored procedure that needs to be called through JDBC that queries a table in the Oracle 8 database. For some reason, whenever i execute this stored procedure from java it hangs on this query and the instance needs to be restarted. If i execute that same stored procedure from SQL Plus, it runs fine.
    I tried a little test. I put a straight query in my java code that goes directly to that table (no stored procedure involved). It runs great through java!
    is this weird or what? my dbas have checked out all privelages and it seems that i have access to everything i could possibly need.
    If anyone has any suggestions i would love to hear them.
    thanks for your help...
    Lori - [email protected]
    null

    You can only access an object in another user's schema if you either:
    (a) Specify the 'other' schema name explicitly: SCHEMA.OBJECT
    (b) A synonymn has been created to access the object: CREATE SYNONYM OBJECT FOR SCHEMA.OBJECT.
    The user requiring the synonym should create it, or the user owning the object can create a PUBLIC synonym, if they have the authority.
    To check my hypothesis, try typing 'DESCRIBE procedure_name' from SQL*Plus as both users.

  • Forms [32 Bit] Version 6.0.5.0.2 :: BLock based on stored procedure

    Trying to develop a form having a block based
    on stored procedure. My form works fine if
    the stored procedure having REF CURSOR as one
    of the argument but if I am using dynamic SQL
    in my procedure I can not use Strong REF CURSOR, so I had to use Pl/Sql Table as one of the parameter in the proceudre.
    In that case when I run my form and Execute the query it just comes out of the form without displaying anything and also it doesn't throw any error.
    Don't know what I am doing wrong.
    Pl. Help...
    null

    I drilled down the proble further and identified that i can
    recreatr the problem in any 7.3.4 database ....
    But in 8.0.5 it's working fine .....
    Is developer 6.0 is going to support Oracle 7.3.4
    it'll be highly appreciated if any one from Oracle development
    team can give me a response
    Thanks in advance...
    Lebon Mathew (guest) wrote:
    : Problem : If a block value is refered in
    : a LOv - record group query
    : the form cannot adjust the out put .. and
    : is not generating.....
    : Record group query which works :
    : select security_role, sec_role_desc, database_role
    : from security_role
    : where wnd_appln = 'XXXXXXXXX'
    : order by security_role, database_role
    : Record group query which is not working :
    : select security_role, sec_role_desc, database_role
    : from security_role
    : where wnd_appln = :APP_ROLES_BK.wnd_appln
    : order by security_role, database_role
    : Error Generated :
    : FRM-30064: Unable to parse statement icrgg/icrggc: hicrg.
    : Record Group SECURITY_ROLE_LOV
    : Form: EMPLOYEE
    : FRM-30085: Unable to adjust form for output.
    : Table structure :
    : CREATE TABLE security_role
    : security_role VARCHAR2(15) NOT NULL,
    : sec_role_desc VARCHAR2(20) NOT NULL,
    : open_nsr VARCHAR2(1),
    : open_pkt VARCHAR2(1),
    : chg_wk_grp VARCHAR2(10),
    : asgn_anlst VARCHAR2(10),
    : updt_oth_wkgp_pkt VARCHAR2(1),
    : admin_tasks VARCHAR2(1),
    : create_po VARCHAR2(1),
    : billing_changes VARCHAR2(1),
    : invoice_changes VARCHAR2(1),
    : change_owner VARCHAR2(1),
    : wnd_appln VARCHAR2(15),
    : database_role VARCHAR2(20)
    : PCTFREE 10
    : PCTUSED 40
    : INITRANS 1
    : MAXTRANS 255
    : TABLESPACE wa0dat0t01
    : STORAGE (
    : INITIAL 32768
    : NEXT 8192
    : PCTINCREASE 0
    : MINEXTENTS 1
    : MAXEXTENTS 121
    : w@w Lebon Mathew
    : WellsFargo - Telecom Applications
    : (415)-477 6445
    null

  • Prompts in Universe based on Stored Procedure

    Hello All,
    I have a universe based on stored procedure. There are two prompts "Date from" and "Dateto" which I set up as "prompt me a for a new value" in the universe.
    When I run the webi report it prompts me to enter the date range. I enter and run the report, but when I refresh the report the dates that were selected before shows up in the prompt window(last values selected). How do I make it in a way that when I refresh the report the values are blank i.e it doesnt have the last values selected?
    I have saved the report as refresh on open but how do I avoid the prompt values?
    Thanks,
    Nisha

    Hi Nisha,
    Can you please share the code where you have mentioned the prompts?
    You may try to use @prompt function in stored procedure. Below post can help you:
    http://scn.sap.com/thread/1698709
    @Prompt('Enter prompt text','A/N/D',<lov>,mono,free,non-persistent)
    Use non-persistent parameter value as it is like unchecking "Keep last selected values" in prompt properties.
    Hope it will help.
    Regards,
    Yuvraj

Maybe you are looking for

  • ORA-00972: identifier is too long

    Hi All, I get the error ORA-00972: identifier is too long during installation of NW2004s SR2 Java system with DI. This error is seen on the step Perform post load activites. i have made the changes as suggested by SAP note: 314671. But the error stil

  • MySQL Stored Procedures

    Title and summary says it all... I've read over and over that stored procedures are more robust, but I've yet to use one (Knowingly). So, if I have query such as insert into table (Name,Description) values ('Taco','Do not eat at Ma Bell'); How would

  • Air Bridge 1310 - Configuring QOS on Point to Point

    I have 2 BR1310 Air Bridge's configured for a point to point connection, one is root,one is non-root. In configuring QOS for VOIP for the first time, I'm looking for a best practice configuration. Behind each bridge is a 3560 switch that has QOS conf

  • Uninstall Acrobat 8.0 Professional

    Tried uninstalling acrobat 8 on computer using control panel.  Uninstall froze, and needless to say has left all contents on computer.  Tried uninstall tool rom adobe and contents were cleaned out, but it still remains in my program list and will not

  • BEX 7.0 patch subcomponents

    If we open query designer it gives a message update frontend patch but already we have SAP gui 610 patch level 9 and BEX 3.5 ..to make BEX 7.0 what things should I install on the frontend computer.