Hi,
I am new at making stored procedures and Functions.
here is a function. It reports an error that it was created but had compile errors ..
I d appreciate if you could find some syntactical error for me.
thanks
Function number 1.
CREATE OR REPLACE FUNCTION FIND_DATA(FORM_RECORD Form_Index%ROWTYPE,
PDF_RECORD Form_Data%ROWTYPE,
subindex Number,
FldUID number,
FldValue varchar2) RETURN number AS
SELECT FieldValue INTO FldValue FROM Form_Data
WHERE
CLUID = intCL AND
TUID = intT AND
RTUID = intRT AND
FAUID = intFA AND
RTTPUID = intRTTP AND
FATPUID = intFATP AND
SubIndexVal = subIndex AND
FieldUID = FldUID;
IF fldValue IS NOT NULL THEN
RETURN strok;
ELSE
RETURN strNo;
END IF;
--EXCEPTION
-- WHEN NO_DATA_FOUND THEN
-- fldValue := NULL;
-- RETURN strNo;
END FIND_DATA;
i := 0;
-- gets the Data from the Form_Index Table
SELECT FORMUID, CLUID, TUID, RTUID, FAUID, RTTPUID, FATPUID, Variation, Status
INTO Form_Record
FROM Form_Index
WHERE FormUID = FormUID AND CLUID = CLUID;
IF NOT intDOT = 0 THEN
strTmpName := strFldName;
strFldName := SUBSTR(strTmpName, intDot - 1, -(intDot-1)); -- getting the Left side of the String
intSubIndex := SUBSTR(strTMpName, intDot+1, Length(strTmpName) - intDot); -- getting the right part
ELSE
intSubIndex := 0;
END IF;
-- get the FieldUID from Form_Fields.
SELECT FieldUID INTO intFldUID FROM Form_Fields WHERE FieldName = strFldName;
-- setting the old DataValue.
strOldFldValue := '';
-- getting data from Form_Fields into PDF_Record.
IF NOT intFldUID = 0 THEN
SELECT FIELDUID, CLUID, RTUID, FAUID, RTTPUID, FATPUID, SUBINDEXED, FIELDNAME
INTO PDF_Record
FROM Form_Fields
WHERE FieldUID := intFldUID;
Bookmarks