cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax error when a cursor has a RETURN

Accepted Solution

Syntax error when a cursor has a RETURN

I have a syntax error in the mtk_bad_sql file:

 

2019-05-24 09:08:09 -- MTK-16004: Error Creating Package Body AXGRA
-- DB-42601: com.edb.util.PSQLException: ERROR: syntax error on or near "RETURN"
Position�: 375
CREATE PACKAGE BODY axgra AS

/* Curseur rafraichissement des textes */
/* ----------------------------------- */
CURSOR rfhcur ( vidf IN NUMBER) IS
SELECT idg, dxf_01 FROM ax_graph_view
WHERE idf = vidf AND (typg=0 OR typg=6)
ORDER BY idg;

/* Curseur lecture folio */
/* --------------------- */
CURSOR loafolcur ( vidf IN NUMBER)
RETURN axgra.grarec IS
SELECT idg, idl, idp, idf, typg, typl, dxf_01 , dxf_02, dxf_06, dxf_07,
dxf_08 , dxf_10x, dxf_10y, dxf_10z, dxf_11x, dxf_11y, dxf_11z,
dxf_40, dxf_41, dxf_42, dxf_43, dxf_50, dxf_51, dxf_62, dxf_66,
dxf_70, dxf_71, dxf_72, dxf_73, dxf_74, dxf_210x, dxf_210y, dxf_210z, tooltip
FROM ax_graph_view
WHERE idf = vidf
ORDER BY idg;

.

Is it normal?

Regards

View Entire Topic
Rohit
EDB Team Member
Solution

Hi,

Yes, the mentioned syntax for cursor declaration does not match with the one in Oracle compatible mode.

and you will need to need to be rewritten after migrating to PL/pgSQL.

Ask a Question