TOracleDataSet and cursor

paulmstr

Member
I'm new to DOA Components. Can anybody help me to solve my problem with TOracleDataSet and cursor returned from function, declared in package.
I have a package on local Oracle server, which declares the following:

TYPE t_ImportRec IS RECORD (
record fields definitions...
);
TYPE t_ImportRecRef IS REF CURSOR RETURN t_importRec;

FUNCTION t_IMPORT(
p_ID IN INTEGER,
p_FromDate IN DATE,
p_ToDate IN DATE) RETURN t_ImportRecRef

The function actually reads data from view on remote Oracle server.

It is not clear for me, how can I use TOracleDataSet to get the data from t_IMPORT function in order to show them in DbGrid.

Thanks in advance.
 
You can simply place the function call in a PL/SQL Block and declare the return variable as a cursor. The TOracleDataSet will recognize the cursor variable, and will fetch the result set. The DeptAPI demo project demonstrates this. For more information, see 'Cursor Variables' in the User's Guide or help file.

------------------
Marco Kalter
Allround Automations
 
Back
Top