testing the pl/sql through Utplsql

  • From: Anupam Pandey <my.oralce@xxxxxxxxx>
  • To: oracle Freelists <oracle-l@xxxxxxxxxxxxx>, ORACLE_DBA_EXPERTS@xxxxxxxxxxxxxxxx
  • Date: Wed, 30 Jun 2010 10:01:28 +0530

Hi All,
               I am testing a function ,through UtPlsql, which returns a
ref-cursor  .I am getting an error .
Plz suggest what is wrong here .
Here "INFO" is a function which takes "id" as input and returns a
ref-cursor.
Error here is "Unable to run ut_getdata.UT_INFO: ORA-01723: zero-length
columns are not allowed"


create or replace function info(p_id in number)
return sys_refcursor
as
s_cursor sys_refcursor;
begin
open s_cursor for select name ,employeed_id,employee_name from emp where
employee_id =p_id;

return s_cursor;
end;

CREATE
OR REPLACE package UT_GETDATA as
procedure
ut_setup;
procedure
ut_teardown;
procedure
ut_info;
end
ut_getdata;
/

CREATE
OR REPLACE package body UT_GETDATA as
procedure ut_Setup as
begin
null;
end ut_setup;

procedure ut_teardown as
begin
null;
end ut_teardown;

procedure ut_info
IS
l_in_params utplsql_util.utplsql_params;
l_out_params utplsql_util.utplsql_params;;
BEGIN
utPLSQL_Util.reg_In_Param (
                                  par_pos =>1,
                                  par_val => 1,
                                  params => l_in_params);

utPLSQL_Util.reg_Out_Param (
                                par_pos =>0,
                                par_type => 'REFCURSOR',
                                params =>l_out_params );

utAssert.eq_refc_query (
                          p_msg_nm =>'refcursor test ',
                          proc_name => 'info',
                          params =>l_in_params,
                          cursor_position =>1,
                          qry => 'SELECT name, message, salary FROM t1 WHERE
id = 1 ');
END ut_info;

END ut_getdata;
/


begin
utplsql.test ('GETDATA', samepackage_in => FALSE,recompile_in => FALSE);
end;

Other related posts:

  • » testing the pl/sql through Utplsql - Anupam Pandey