Link to home
Start Free TrialLog in
Avatar of Billy Ma
Billy MaFlag for Hong Kong

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.
 
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;
/

Open in new window


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;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Naveen Kumar
Naveen Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Billy Ma

ASKER

nav_kum_v, I can't use 6i, becoz this is using in the company...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes tired, but doesn't work too...............
what is the workaround in old form?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
some parts were hided.
form.jpg
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
User generated image
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
haha, becoz my colleague want to get the entire row rather than having lots of OUT variables
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!