Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Using Cursors in SQL passthrough
Hi All,
I am wondering if it is possible to use a referance to a cursor in a 2nd SQL statement. In the following 'WRK_RTG' is a cursor that was created with a previous SQL statement.
SELECT WRK_RTG.ORD_NO,
LABOR_CHRGS.RELS_RTG_NO,
LABOR_CHRGS.SEQ_NO,
SUM(DECODE('MACH', LABOR_CHRGS.LABOR_RATE_CD_TYPE, LABOR_CHRGS.HRS, 0)) AS TOT_MACH_HRS,
SUM(DECODE('RUN', LABOR_CHRGS.LABOR_RATE_CD_TYPE, LABOR_CHRGS.HRS, 0)) AS TOT_RUN_HRS,
SUM(DECODE('SETUP', LABOR_CHRGS.LABOR_RATE_CD_TYPE, LABOR_CHRGS.HRS, 0)) AS TOT_SETUP_HRS
FROM
PROD.LABOR_CHRGS LABOR_CHRGS,
WRK_RTG
WHERE
PROD.LABOR_CHRGS.RELS_RTG_NO = WRK_RTG.RELS_RTG_NO
GROUP BY
WRK_RTG.ORD_NO,
PROD.LABOR_CHRGS.RELS_RTG_NO,
PROD.LABOR_CHRGS.SEQ_NO
ORDER BY
WRK_RTG.ORD_NO,
PROD.LABOR_CHRGS.RELS_RTG_NO,
PROD.LABOR_CHRGS.SEQ_NO
If I omit any referance to the cursor, all is ok. But when I put the cursor referance in, it doesn't work. I am using an ORACLE server
TIA
Mike
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement