create or replace type uname_table_type is table of varchar2(30);
create or replace type userid_table_type is table of int;
create or replace type wname_table_type is table of varCHAR2(100);
create or replace type wcontent_table_type is table of varCHAR2(4000);
create or replace type wtime_table_type is table of date;
-- 定义过程
create or replace procedure sh_wz(p_uname yh.uname%TYPE,p_wztype wz.wztype%TYPE,
wname_table out wname_table_type,wcontent_table out wcontent_table_type,wtime_table out wtime_table_type,userid_table out userid_table_type)
is
begin
select wz.wname,wz.wcontent,wz.wtime ,yh.userid BULK COLLECT INTO wname_table,wcontent_table,wtime_table,userid_table from wz,yh
where wz.wztype= p_wztype and yh.userid in (select userid from yh where uname= p_uname);
EXCEPTION WHEN NO_DATA_FOUND THEN dbms_output.put_line('您输入的人员不存在或该人员未发布文章!');
end;
DECLARE
v_uname yh.uname%TYPE;
v_wztype wz.wztype%TYPE;
wname_table wname_table_type;
wcontent_table wcontent_table_type;
wtime_table wtime_table_type;
userid_table userid_table_type;
BEGIN
v_uname:=('&p_uname');
v_wztype:=('&p_wztype');
sh_wz(v_uname,v_wztype,wname_table,wcontent_table,wtime_table, userid_table);
---dbms_output.put_line('用户名称:'||v_uname);
FOR i in 1..wname_table.count loop
dbms_output.put_line('用户名称:'||v_uname||'文章类型:'||v_wztype||'文章题目:'||wname_table(i)||'文章内容:'||wcontent_table(i)||'发布时间:'||wtime_table(i)||'用户ID:'||userid_table(i));
end LOOP;
END;
根据你提供的内容,我看不出具体的问题所在。如果你能提供更具体的问题和错误信息,我可以帮助你解决问题。在代码中,我没有看到涉及到输入字符的逻辑,因此也无法判断是否有非数字字符问题。同时,需要注意代码中可能存在的其他问题,比如类型不匹配、索引越界等。如果你能提供更多的信息,我会尽力给出解决方案。