Trouble with returning clause

Roger

Member
I have the following SQL statement (used by I TOracleDataset):

INSERT INTO RAB ( GROESSE, NR, TYP, VOLUMEN, KNR,
ANWENDERNR, BESTNR1, BESTNR2, LEIHDAT, ABHOLDAT,
GEPRUEFT, BEMERK1, BEMERK2, UEBERTRAGEN,
UEBERTRDAT, BESTAND, STAMMRAB, GETEILT,
VERWENDER, KENNUNG, TOURKENNUNG, BRUTTOGEWICHT,
NETTOGEWICHT, DOSISLEISTUNG)
VALUES (:GROESSE, :NR, :TYP, :VOLUMEN, :KNR,
:ANWENDERNR, :BESTNR1, :BESTNR2, :LEIHDAT,
:ABHOLDAT, :GEPRUEFT, :BEMERK1, :BEMERK2,
:UEBERTRAGEN, :UEBERTRDAT, :BESTAND,
:STAMMRAB, :GETEILT, :VERWENDER,
:KENNUNG, :TOURKENNUNG,
:BRUTTOGEWICHT, :NETTOGEWICHT,
biggrin.gif
OSISLEISTUNG)
returning recnum into :RABPOINTER

But if I try to access the variable using
odsRab.GetVariable('RABPOINTER').AsString;

I get an error message that this variable does not exist ! Why ?

Regards
Roger
 
Is this variable declared, either at run-timer through the DeclareVariable procedure, or at design-time through the Variables property editor?

------------------
Marco Kalter
Allround Automations
 
Okay. So the statement executes correctly, but the GetVariable call fails with a "variable does not exist" message. This means that:

1. The variable was deleted between Execute and GetVariable.

or

2. There is a difference in the variable name in the SQL and in your program code.

I can't think of anything else...

------------------
Marco Kalter
Allround Automations
 
The code looks like this:

for i := 1 to (odsRab.FieldCount - 1) do
begin
if ((odsRab.Fields.Required)
and (odsRab.Fields.DataType = ftString)) then
begin
if (odsRab.Fields.Value = '') then
odsInsertRab.SetVariable(i - 1, ' ')
else
odsInsertRab.SetVariable(i - 1, odsRab.Fields.value);
end
else
odsInsertRab.SetVariable(i - 1, odsRab.Fields.value);
end;
odsInsertRab.SetVariable(':GROESSE', mdsInputRabGroesse.Value);
odsInsertRab.SetVariable(':NR', mdsInputRabNr.Value);
odsInsertRab.SetVariable(':BRUTTOGEWICHT', mdsInputBruttoGewicht.Value);
odsInsertRab.SetVariable(':NETTOGEWICHT', mdsInputBruttoGewicht.Value);
odsInsertRab.SetVariable('
biggrin.gif
OSISLEISTUNG', mdsInputDosisleistung.Value);
odsInsertRab.SetVariable(':VOLUMEN', mdsInputVolumen.Value);
odsInsertRab.ExecSQL;

???

Regards
Roger
 
Okay, let me rephrase:

Where was the GetVariable?

------------------
Marco Kalter
Allround Automations
 
Back
Top