Billy Ma
asked on
Oracle Forms 4.5.7 ROWTYPE
I have created a function that return a ROWTYPE in the Oracle Database.
However, my Oracle Forms version 4.5.7 seems does not support that, or I should not implement like this? are there any other solutions?
The code below is the function I have created in the database.
The code below is the partial code in the Oracle Forms.
However, my Oracle Forms version 4.5.7 seems does not support that, or I should not implement like this? are there any other solutions?
The code below is the function I have created in the database.
CREATE OR REPLACE
FUNCTION SP_PRODUCT_fn_GET_REC (
pt_prod_code IN PRODUCTS.PROD_CODE%TYPE
)
RETURN PRODUCTS%ROWTYPE
IS
r_ProdRec PRODUCTS%ROWTYPE;
CURSOR c_Prod IS
SELECT *
FROM PRODUCTS
WHERE PROD_CODE = pt_prod_code;
BEGIN
OPEN c_Prod;
FETCH c_Prod INTO r_ProdRec;
CLOSE c_Prod;
RETURN r_ProdRec;
END SP_PRODUCT_fn_GET_REC;
/
The code below is the partial code in the Oracle Forms.
DECLARE
pt_prod_rec PRODUCTS%ROWTYPE;
BEGIN
pt_prod_rec := SP_PRODUCT_fn_GET_REC('12345678');
END;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yes tired, but doesn't work too...............
what is the workaround in old form?
what is the workaround in old form?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
some parts were hided.
form.jpg
form.jpg
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
PROD_CODE VARCHAR2(18)
Both PROCEDURE created and CONNECTION OF FORM are the same user.
So I just change the OUT parameter from ROWTYPE to VARCHAR2, to test it is ok.
The problem is why ROWTYPE passing with cause error when complie the form.
Both PROCEDURE created and CONNECTION OF FORM are the same user.
So I just change the OUT parameter from ROWTYPE to VARCHAR2, to test it is ok.
The problem is why ROWTYPE passing with cause error when complie the form.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
haha, becoz my colleague want to get the entire row rather than having lots of OUT variables
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER