MaxDB 7.6.00.12
Delphi 7.1
Hello,
Even after reading some posts on the MaxDB mailing list archive I can't
understand why my DBProc doesn't work as expected.
The app works that way :
--------------------------
A form is data linked to a table called TEXTES. TEXTES's definition is
very close to TEXTES_PRE's one. When modifying datas thanks to the form
I have to keep original datas into TEXTES and to store modified datas
into TEXTES_PRE. Do do so I parse every fields from the ADO RecordSet
before commiting the edit and store the result into TEXTES_PRE thanks to
the following DBProc :
CREATE DBPROC TEXTES_PRE_ENREG (IN IDFAMILLE INTEGER,
IN IDSOUSFAMILLE INTEGER, IN IDBIBLIO
INTEGER,
IN CODEELT VARCHAR(20), IN TITREELT
VARCHAR(255),
IN DATEMAJ DATE, IN TEXTE LONG ASCII, IN
IDELT INTEGER) AS
TRY
INSERT INTO DBA.TEXTES_PRE (IDELT,DATEMAJ,TEXTE,
IDSOUSFAMILLE, IDFAMILLE, IDBIBLIO, CODEELT,
TITREELT)
VALUES (:IDELT,:DATEMAJ,:TEXTE,
:IDSOUSFAMILLE, :IDFAMILLE, :IDBIBLIO,
:CODEELT, :TITREELT);
CATCH
IF $RC <> 100 THEN STOP ($RC, 'Impossible d''enregistrer cet élément');
The code to call the stored proc is :
With TADOCommand.Create(nil) do
//Creates and instanciates a Command
try
Connection:=F_DataMod.ADOConnection; //connects
to the DB
CommandType:=cmdStoredProc;
//tells the system I'll call a DBProc
CommandText:=getprocName(MODE_ENREG); //getProcName returns
TEXTES_PRE_ENREG
Parameters.Refresh;
//gets the parameters list
Prepared:=True;
//done because of what I read on the MaxDB list.
for i:=0 to Parameters.Count-1 do
//for each parameter gets the value in the ADODataSet
Parameters[i].Value:=ADODataSet.FieldValues[Parameters[i].Name];
Execute;
//Executes the DBProc and... crashes here
finally
Free;
end;
Here are some observations :
------------------------------
- When replacing the :TEXTE parameter into the insert statement by NULL
the DBProc works
- An insert ... select statement fom SQL Studio to check if the database
works fine
- The error occurs with either a LONG ASCII other a LONG BYTE field
Could someone tell me how to use LONG fields with "parameterised" DBProcs ?
Thanks in advance
Kind regards
Xavier.
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]