Home » Developer & Programmer » Precompilers, OCI & OCCI » Error en Cursor con select anidados
Error en Cursor con select anidados [message #121214] Thu, 26 May 2005 21:27 Go to next message
dmercado98
Messages: 1
Registered: May 2005
Location: Cali - Colombia
Junior Member
Tengo el siguiente problema utilizando un cursor que tiene select anidados.

La consulta en sqlplus funciona, pero cuando la adiciono al programa en un cursor me da el siguiente error y marca donde termina el selec más interno. : (utilizo HP-UX, oracle 7.1.6 y pro*c 2.0.6.0
-------------------------------------------------------------------

make -f /u/oracle/product/7.1.6/proc/lib/proc.mk OBJS=dme_prueba.o EXE=dme_prueba build
/u/oracle/product/7.1.6/bin/proc iname=dme_prueba.pc

Pro*C: Release 2.0.6.0.0 - Production on Thu May 26 19:37:30 2005

Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.

System default option values taken from: /u/oracle/product/7.1.6/proc/pmscfg.h

Syntax error at line 169, column 70, file dme_prueba.pc:
NVL(d.val_concepto, 0),h.cod_tar_liq, d.cod_concepto) dd,
.....................................................................1
(1) PCC-S-02201, Encountered the symbol "dd" when expecting one of the following:

; , for, union, connect, group, having, intersect, minus,
order, start, where,
The symbol "," was substituted for "dd" to continue.
Re: Error en Cursor con select anidados [message #121422 is a reply to message #121214] Sat, 28 May 2005 15:37 Go to previous message
Michael Hartley
Messages: 110
Registered: December 2004
Location: West Yorkshire, United Ki...
Senior Member

Ok, you should have tested your SQL in sqlplus before attempting to prove it in ProC. Make life easy for yourself and test your SQL before attempting to embed into 3rd generation languages.

NVL(d.val_concepto, 0),h.cod_tar_liq, d.cod_concepto) dd, has a unbalanced number of parenthesis

NVL(d.val_concepto, 0),
h.cod_tar_liq,
d.cod_concepto) dd,

If you still have troubles after removing the ")" then post your SQL code and the important parts of the ProC.

Kind regards,
Michael Hartley, http://www.openfieldsolutions.co.uk
Previous Topic: Can OCI Program avoid relink during different version of oracle on unix?
Next Topic: core dump when disconnect from proc connection on Linux
Goto Forum:
  


Current Time: Thu Nov 21 15:52:21 CST 2024