@flag = GCB,
@key = projectid,
@table = tbl_gcinfdetail ;
execute watercode;
fetch watercode into :ls_proid;
close watercode;
这个ls_proid没有值。。。这是什么原因?
有什么方法可以解决这样的问题?
后台绝对没错,前台至少语法没错 还有 数据库连接正确 有高人指教吗?
我真的无奈了
[此贴子已经被作者于2007-6-2 13:59:45编辑过]
[此贴子已经被作者于2007-6-2 13:59:45编辑过]
例:orcal數據庫 pb 開發工具:(有輸入,輸出參數)
orcal 中:
create or replace procedure sp_watercode
(gcb in varchar2,--輸入參數
projectid in varchar,--輸入參數
tbl_gcinfdetail in varchar2,--輸入參數
proid out string) --輸出參數
is
--定義
ERRNO INTEGER;
ERRMSG VARCHAR2(500);
ls_proid_temp string;
CURSOR C1 IS
SELECT proid
FROM water.water
WHERE water.gcb= :gcb and
water.projectid = : projectid and
water.tail = :tbl_gcinfdetail ;
begin
OPEN C1;
FETCH C1 INTO ls_proid_temp ;
IF C1%NOTFOUND THEN
ERRNO := -20002;
ERRMSG := '沒有數據';
RAISE_APPLICATION_ERROR(ERRNO,ERRMSG);
end if
end sp_watercode ;
pb 中的代碼:
string ls_gcb,ls_pro,ls_gcinfdetail,ls_proid
ls_gcb = dw_n.getitemstring(getrow(),'gcb')
ls_pro = dw_n.getitemstring(getrow(),'projectid')
ls_gcinfdetail = dw_n.getitemstring(getrow(),'tail')
DECLARE proc_ins_pnl PROCEDURE FOR sp_watercode
(:ls_gcb ,:ls_pro,:ls_pnl_nm,:ls_gcinfdetail); --輸入參數
EXECUTE proc_ins_pnl;
IF SQLCA.SQLCODE = 0 THEN
FETCH proc_ins_pnl INTO :ls_proid ;---輸出(得到數據)
END IF
choose case sqlca.sqlcode
case 100,0--處理數據,
dw_1.setitem(dw_1.getrow(),"proid",trim(ls_proid ))
case -1 錯誤提示
long ll_pos,ll_pos1
ll_pos = pos(SQLCA.SQLERRTEXT,"ORA-06512")
ll_pos1 = pos(SQLCA.SQLERRTEXT,"ORA-20002")
Messagebox("輸入資料錯誤~",MID(SQLCA.SQLERRTEXT,ll_pos1 + 10 ,ll_pos - ll_pos1 - 10),stopsign!)
return
end choose
close proc_ins_pnl;