Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Same ole problem: Reference of uninitialized composite
Even with our best solution, my new procedure still occasionally
generate this error, especially in the first call of the day.
My procedure as:
PROCEDURE GetQuotes
(p_condStr IN OUT VARCHAR2, o_orderID IN OUT tbl_order_id, o_userID IN OUT tbl_userID, o_partNumber IN OUT tbl_partNum, o_nomen IN OUT tbl_nomen, o_locid IN OUT tbl_loc_id, o_qty IN OUT tbl_qty, o_ui IN OUT tbl_qtyUnit, o_remarks IN OUT tbl_remarks) IS -- local variables to build sql statement and where clause v_sqlStmt VARCHAR2(1000); v_count BINARY_INTEGER DEFAULT 1; v_order_id spotbuy_quotes.order_id%TYPE; v_locid spotbuy_quotes.loc_id%TYPE; v_userID spotbuy_quotes.user_id%TYPE; v_qty spotbuy_quotes.qty%TYPE; v_remarks spotbuy_quotes.remarks%TYPE; v_partNum spotbuy_quotes.part_number%TYPE; v_nomen spotbuy_quotes.nomen%TYPE; v_qtyUnit spotbuy_quotes.qty_unit%TYPE;
-- declare a weak type cursor for fetching record
TYPE cursor_T IS REF CURSOR; v_cursor cursor_T; -- for dummy initialization t_order_id tbl_order_id; t_user_id tbl_userID; t_partNumber tbl_partNum; t_nomen tbl_nomen; t_locid tbl_loc_id; t_qty tbl_qty; t_ui tbl_qtyUnit; t_remarks tbl_remarks; BEGIN v_sqlStmt:= 'SELECT order_id, user_id, '; v_sqlStmt:= v_sqlStmt || ' part_number, nomen, loc_id, qty, qty_unit, '; v_sqlStmt:= v_sqlStmt || ' remarks, req_num FROM spotbuy_quotes ' ; v_sqlStmt:= v_sqlStmt || p_condStr; o_orderID:= t_order_id; o_userID:= t_user_id; o_partNumber:= t_partNumber; o_nomen:= t_nomen; o_locid:= t_locid; o_qty:= t_qty; o_ui:= t_ui; o_remarks:= t_remarks;
-- open Dynamic cursor
OPEN v_cursor FOR v_sqlStmt; LOOP FETCH v_cursor INTO v_order_id, v_userID, v_partNum, v_nomen, v_locid, v_qty, v_qtyUnit, v_remarks; EXIT WHEN v_cursor%NOTFOUND; o_orderID(v_count):= v_order_id; o_userID(v_Count):= v_userID; o_partNumber(v_count):= v_partNum; o_nomen(v_count):= v_nomen; o_locid(v_Count):= v_locid; o_qty(v_count):= v_qty; o_ui(v_count):= v_qtyUnit; o_remarks(v_count):= v_remarks; v_count:= v_count + 1; END LOOP;
-- close dynamic cursor
CLOSE v_cursor;
END GetQuotes;
and tbl_order_id is defined as type ... IS TABLE OF purchase_requests.order_id%TYPE
INDEX BY BINARY_INTEGER; and same as other IN OUT parameters.
I just run of clue. Can anyone has a suggestion? We are using 8.1.6 on NT 4. Thanks Received on Fri Mar 01 2002 - 21:57:02 CST
![]() |
![]() |