Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORA-01007: variable not in select list

Status
Not open for further replies.

DZH

Programmer
Apr 12, 2002
26
ZA
I have declared and successfully OPENed a cursor to perform a simple select. However, when FETCHing using the cursor fails with the following error message:
"ORA-01007: variable not in select list".
The same select statement works well(retrieves the data) in PowerBuilder and TOAD. I have looked at the Oracle docs but there were not helpful. Any ideas?
 
Please post the code....Guessing is not usually helpful..
 
Ok, here is the select statement:
Code:
EXEC SQL DECLARE lcur_mycursor CURSOR FOR
 SELECT   S.PROGRAMA,           S.NIS_RAD,             S.F_FACT,
            S.SEC_NIS,            S.F_ULT_FACT,          S.F_ULT_FACT_REAL,
            S.TIP_SERV,           S.NUM_SUM,             S.EMPRESA_PROD,
            S.NIF,                S.CSMOS_FACT,          S.IND_ESTIMADO,
            S.COD_UNICOM,         S.IND_FACT,            S.IND_EMBALSADO,
            S.COD_TAR,            S.GR_CONCEPTO,         S.POTENCIAS,
            S.TIP_FACT,           S.COD_CLI,             S.COD_CTA,
            S.IND_LECT_CONTROL,   S.IND_F_LVNTO,         S.IND_TRANS_POT,
            S.IND_CSMO_ADICIONAL, S.CO_COND_FISCAL,      S.IMP_MEDIO,
            S.COD_PARALELO,       S.NUM_ESTIM_ANUAL,     S.NUM_ESTIM_CONSEC,
            0,                    S.F_MOD_CONT,          
            S.EST_SERV,           S.CO_MOTIVO,             S.TIP_PER_FACT,       S.TIP_RECARGO,         S.TIP_MULTA,
            S.EMP_PROPIETARIA,    S.IND_BONIF,           S.IND_ESTACION,
            S.GRUPO_FAMIL,        0,
            C.TIP_CLI,            C.NUM_FISCAL,          T.TIP_CTA,
            NVL(F.COD_AREA, 0),   NVL(F.COD_POST, ' '),  NVL(F.COD_POST_EXT, ' '),
            NVL(F.COD_CALLE, 0),  NVL(L.COD_DEPTO, 0),
            S.USRNUMB1,
            S.TIP_REC,            S.CO_ESTM,             S.NIS_RAD_PTE,
                        S.F_BAJA
   FROM SERV_FACTURAR S, CLIENTES C, CUENTAS_CU T, FINCAS F, CALLEJERO L
   WHERE S.COD_CLI      = C.COD_CLI
     AND S.COD_CTA      = T.COD_CTA
     AND S.NIF          = F.NIF (+)
     AND F.COD_CALLE    = L.COD_CALLE (+)
     AND IND_FACT       = 2
     AND IND_EMBALSADO  = 2
     AND F_FACT <= :lfe_hoy
   ORDER BY S.IND_FACT, S.IND_EMBALSADO, S.NIS_RAD, S.F_FACT ;

And the fetch which fails:

Code:
EXEC SQL FETCH  lcur_mycursor
                   INTO :gs_fetch;
 
One would certainly have to suspect that there is an incompatibility between the rows that you are selecting and the definition of :gs_fetch.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top