Creating a Data Block From Procedure
426440Jul 29 2004 — edited May 23 2007Hi
I am having a little trouble creating a data block from a procedure. I have created a package/procedure as described below. I am able to run the procedure within SQL+, but I am trying to create a form using it.
I am trying to create a Forms datablock based on the procedure, however when I use the datablock wizard arguments appear within the lower section of the dialog but the available columns and database items remain blank. I know that I must be doing something wrong, but from searching through all the documentation I can find I have still not managed to progress.
Can anyone help?
PACKAGE mbt_pkg
as
type refcursor_type is ref cursor;
procedure get_match(p_surname in VARCHAR2 default NULL,
p_cursor in out refcursor_type);
end;
PACKAGE body mbt_pkg
as
procedure get_match(p_surname in VARCHAR2,
p_cursor in out refcursor_type)
is
l_query long;
l_bind varchar2(30);
begin
l_query := 'SELECT cust_id FROM CUSTOMER';
if p_surname is not null then
l_query := l_query||' where surname = :x';
l_bind := p_surname;
end if;
open p_cursor for l_query using p_surname;
end;
end;