I have sample firebird stored procedure
PROCEDURE PROCEDURE01
RETURNS (
PARAMETER01 VARCHAR(50))
AS
BEGIN
PARAMETER01 = 'Hello';
END
and in the Delphi side
LCommand := SQLConnection1.DBXConnection.CreateCommand;
LCommand.CommandType := TDBXCommandTypes.DbxStoredProcedure;
LCommand.Text := 'PROCEDURE01';
LIdOut := LCommand.CreateParameter;
LIdOut.ParameterDirection := TDBXParameterDirections.OutParameter;
LIdOut.DataType := TDBXDataTypes.WideStringType;
LIdOut.Name := 'PARAMETER01';
LCommand.Parameters.AddParameter(LIdOut);
LCommand.Prepare;
LReader := LCommand.ExecuteQuery;
and receive exception
"Arithmetic exception, numeric overflow, or string truncation"
WideStringimplies multi-byte characters, and your parameter is set toVARCHAR(50), which typically is single-byte characters. Try using compatible types. (Do you REALLY TYPE ALL YOUR STORED PROCEDURES IN ALL CAPS? If so, I'm glad I don't have to work with your SQL - SHOUTING MAKES THINGS HARD TO READ. They invented the Shift key For a reason.)PROCEDURE01is not a keyword, and neither is `PARAMETER01'. There's no requirement to write in upper-case, especially in a stored procedure where there's no possible ambiguity between the SQL and non-SQL statements. Text, whether it's an SQL statement or a plain sentence in an email or web post, is hard to read when it's typed in all caps. :-) And I didn't accuse the poster of shouting at us, but of shouting in general. :-)