Hi to all ng
In the c program I wrote this :
EXEC SQL UPDATE spedizioni_det
SET lde_utente_modi fica = 'CARVEN'
, lde_data_modifi ca = current date
, lde_quantita = case when
:aggiorna[QTA_MOD] = SI
then case
when :aggiorna[QTA_RES] = SI
then
integer(:quanti ta)
else
lde_quantita
end
else
lde_quantita
end
, lde_ticket = case when
:aggiorna[TICKECT] = 0
then
:numero_ticket
else
lde_ticket
end
, lde_lde_cde_num ero_ordine= case when
:aggiorna[ORD_RESO] = 0
then
:numero_oda
else
lde_lde_cde_num ero_ordine
end
, lde_lde_numero_ riga = case when
:aggiorna[ORD_RESO] = 0
then
:posizione_oda
else
lde_lde_numero_ riga
end
WHERE lde_numero_riga = :posizione
AND lde_cde_numero_ ordine = :numero_ordine;
before I declare in the declare section
#define ORDINE 0
#define MATERIALE 1
#define TICKET 2
#define QTA_MOD 3
#define QTA_RES 4
#define ORD_RESO 5
EXEC SQL BEGIN DECLARE SECTION ;
short aggiorna[8] ;
char numero_ordine[12];
char posizione_oda[6] ;
sqlint16 quantita;
EXEC SQL END DECLARE SECTION ;
.... During the precompilation I meet this error
574 SQL0104N An unexpected token "[QTA_MOD]" was found
following "= case when :aggiorna[0]". Expected tokens may
include: "<space>". SQLSTATE=42601
I try and re-try to see the update, but for me is ok ?
someone can give me a suggest ?
best thanks and best regards
sergio
In the c program I wrote this :
EXEC SQL UPDATE spedizioni_det
SET lde_utente_modi fica = 'CARVEN'
, lde_data_modifi ca = current date
, lde_quantita = case when
:aggiorna[QTA_MOD] = SI
then case
when :aggiorna[QTA_RES] = SI
then
integer(:quanti ta)
else
lde_quantita
end
else
lde_quantita
end
, lde_ticket = case when
:aggiorna[TICKECT] = 0
then
:numero_ticket
else
lde_ticket
end
, lde_lde_cde_num ero_ordine= case when
:aggiorna[ORD_RESO] = 0
then
:numero_oda
else
lde_lde_cde_num ero_ordine
end
, lde_lde_numero_ riga = case when
:aggiorna[ORD_RESO] = 0
then
:posizione_oda
else
lde_lde_numero_ riga
end
WHERE lde_numero_riga = :posizione
AND lde_cde_numero_ ordine = :numero_ordine;
before I declare in the declare section
#define ORDINE 0
#define MATERIALE 1
#define TICKET 2
#define QTA_MOD 3
#define QTA_RES 4
#define ORD_RESO 5
EXEC SQL BEGIN DECLARE SECTION ;
short aggiorna[8] ;
char numero_ordine[12];
char posizione_oda[6] ;
sqlint16 quantita;
EXEC SQL END DECLARE SECTION ;
.... During the precompilation I meet this error
574 SQL0104N An unexpected token "[QTA_MOD]" was found
following "= case when :aggiorna[0]". Expected tokens may
include: "<space>". SQLSTATE=42601
I try and re-try to see the update, but for me is ok ?
someone can give me a suggest ?
best thanks and best regards
sergio