2006 Mar 03 4:53 PM
Hello ...
I am working with a table create in BD. ORACLE and y have the next code ...for to read.
EXEC SQL PERFORMING loop_output.
SELECT t$comp,
t$date,
t$year,
t$prdo,
t$ttyp,
t$lino,
t$spac,
t$leac,
t$typ1,
t$dim1,
t$typ2,
t$dim2,
t$typ3,
t$dim3,
t$typ4,
t$dim4,
t$typ5,
t$dim5,
t$refr,
t$dbcr,
t$amnt,
t$ccur,
t$spa2,
t$rate,
t$amth,
t$spa3,
t$bpid,
t$isup,
t$cvat,
t$vamt,
t$tipo,
t$actu,
t$tip2,
T$REFCNTD,
T$REFCNTU
INTO :wa
FROM baan.ttfgld915100@DB_BAAN
ENDEXEC.
and the next code for to write ...
exec sql.
INSERT INTO sapdev.tfgld915100
(COMP,TDATE,YEAR,PRDO,TTYP,LINO,SPAC,
LEAC,TYP1,DIM1,TYP2,DIM2,TYP3,DIM3,
TYP4,DIM4,TYP5,DIM5,REFR,DBCR,
AMNT,CCUR,SPA2,RATE,AMTH,SPA3,BPID,
ISUP,CVAT,VAMT,TIPO,ACTU,TIP2,REFCNTD,
REFCNTU)
VALUES
(:wa_comp,:wa_date,:wa_year,:wa_prdo,
:wa_ttyp,:wa_lino,
:wa_spac,:wa_leac,:wa_typ1,:wa_dim1,
:wa_typ2,:wa_dim2,
:wa_typ3,:wa_dim3,:wa_typ4,:wa_dim4,:wa_t yp5,:wa_dim5,
:wa_refr,:wa_dbcr,:wa_amnt,:wa_ccur,
:wa_spa2,:wa_rate,:wa_amth,:wa_spa3,
:wa_bpid,:wa_isup,
:wa_cvat,:wa_vamt,:wa_tipo,:wa_actu,
:wa_tip2,:wa_refcntd,
:wa_refcntu)
endexec.
EXEC SQL. COMMIT WORK;
endexec.
and i am utility the next code for to delete ...
exec sql.
DELETE FROM
baan.ttfgld915100@DB_BAAN
where comp = 400;
endexec.
EXEC SQL. COMMIT WORK;
endexec.
2006 Mar 03 11:38 PM
My Friend Rob ...
we have succeeded ... My error was the ; at end of HERE..
But ... it´s o.k.
thanks ... very much
i believe that this day was of beneficial .. bye
Hello ...
I am working with a table create in BD. ORACLE and y have the next code ...for to read.
EXEC SQL PERFORMING loop_output.
SELECT t$comp,
t$date,
t$year,
t$prdo,
t$ttyp,
t$lino,
t$spac,
t$leac,
t$typ1,
t$dim1,
t$typ2,
t$dim2,
t$typ3,
t$dim3,
t$typ4,
t$dim4,
t$typ5,
t$dim5,
t$refr,
t$dbcr,
t$amnt,
t$ccur,
t$spa2,
t$rate,
t$amth,
t$spa3,
t$bpid,
t$isup,
t$cvat,
t$vamt,
t$tipo,
t$actu,
t$tip2,
T$REFCNTD,
T$REFCNTU
INTO :wa
FROM baan.ttfgld915100@DB_BAAN
ENDEXEC.
and the next code for to write ...
exec sql.
INSERT INTO sapdev.tfgld915100
(COMP,TDATE,YEAR,PRDO,TTYP,LINO,SPAC,
LEAC,TYP1,DIM1,TYP2,DIM2,TYP3,DIM3,
TYP4,DIM4,TYP5,DIM5,REFR,DBCR,
AMNT,CCUR,SPA2,RATE,AMTH,SPA3,BPID,
ISUP,CVAT,VAMT,TIPO,ACTU,TIP2,REFCNTD,
REFCNTU)
VALUES
(:wa_comp,:wa_date,:wa_year,:wa_prdo,
:wa_ttyp,:wa_lino,
:wa_spac,:wa_leac,:wa_typ1,:wa_dim1,
:wa_typ2,:wa_dim2,
:wa_typ3,:wa_dim3,:wa_typ4,:wa_dim4,:wa_t yp5,:wa_dim5,
:wa_refr,:wa_dbcr,:wa_amnt,:wa_ccur,
:wa_spa2,:wa_rate,:wa_amth,:wa_spa3,
:wa_bpid,:wa_isup,
:wa_cvat,:wa_vamt,:wa_tipo,:wa_actu,
:wa_tip2,:wa_refcntd,
:wa_refcntu)
endexec.
EXEC SQL. COMMIT WORK;
endexec.
and i am utility the next code for to delete ...
exec sql.
DELETE FROM
baan.ttfgld915100@DB_BAAN
where comp = 400;
endexec.
EXEC SQL. COMMIT WORK;
endexec.
2006 Mar 03 4:57 PM
You excuse, my question is which is the codigo to erase???
Greetings
2006 Mar 03 5:02 PM
Hi Ramiro,
Can you be more clear as to what your query is??
2006 Mar 03 5:20 PM
Hi Ramiro
the Delete from <db.tablename) will delete the contents of the table
is that you want?
regards
kishore
2006 Mar 03 5:28 PM
hi ..kishore thanks ...
i need an query for to DELETE one row.
the SELECT and the INSERT is working perefect ..
both the delete don´t work ...
i was put the next code ..
exec sql.
DELETE FROM
sapdev.tfgld915100
baan.ttfgld915100@DB_BAAN
where comp = 400;
endexec.
EXEC SQL. COMMIT WORK;
endexec.
But, it sends me the next message..
ORA-00911: invalid character
my dude is ..i can to user DELETE .. for to erase one row in this TABLE ????
2006 Mar 03 5:39 PM
hI RAMIRO
YOU CAN USE
VAR = 400.
EXEC SQL.
DELETE SAPDEV.TFGLD915100 WHERE COMP = :VAR;
ENDEXEC.
EXEC SQL. COMMIT WORK;
endexec.
REGARDS
KISHORE
2006 Mar 03 6:40 PM
hi ..kishore ...
i dis a small change .. the var is enclosed in parentesis ..
wa_comp = 400.
exec sql.
DELETE FROM
sapdev.tfgld915100
where comp = (:WA_COMP);
endexec.
baan.ttfgld915100@DB_BAAN
EXEC SQL. COMMIT WORK;
endexec.
both ...it continue send me the message ..
"ORA-00911: invalid character"
Greetings.
2006 Mar 03 7:51 PM
Try leaving off the semi-colons:
wa_comp = 400.
exec sql.
DELETE FROM
sapdev.tfgld915100
where comp = (:WA_COMP)
endexec.
* baan.ttfgld915100@DB_BAAN
EXEC SQL.
COMMIT WORK
endexec.
2006 Mar 03 9:42 PM
hi, Rob
not, is the same error ....
i have my dude if this command it permitedd in SQL NATIVO...
Greetings
2006 Mar 03 10:17 PM
I think you can actually do more in native SQL. Try:
wa_comp = 400.
exec sql.
DELETE FROM sapdev.tfgld915100
where comp = :WA_COMP
endexec.
* baan.ttfgld915100@DB_BAAN
EXEC SQL.
COMMIT WORK
endexec.(removing the parenthesis).
Rob
2006 Mar 03 10:29 PM
hi Rob ..
with this code i can`t to active the program send me the next error ...
Field "WA_COMP;" is unknown. It is neither in one of the specified.
Greetings ..
2006 Mar 03 11:17 PM
This compiled without a syntax error in my system:
REPORT ztest.
DATA: wa_comp(3).
wa_comp = 400.
EXEC SQL.
DELETE FROM sapdev.tfgld915100
where comp = :WA_COMP
ENDEXEC.
* baan.ttfgld915100@DB_BAAN
EXEC SQL.
COMMIT WORK
ENDEXEC.
Rob
2006 Mar 03 11:38 PM
My Friend Rob ...
we have succeeded ... My error was the ; at end of HERE..
But ... it´s o.k.
thanks ... very much
i believe that this day was of beneficial .. bye
2006 Mar 03 11:45 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |