From: aspxDelphi <web...@as...> - 2003-03-05 08:09:16
|
Hi,all I have some problems using Firebird stored procedures in an aspx page... I have a simple SP returning an integer, here it goes: *************** CREATE PROCEDURE HITSGETTOTAL RETURNS (HITS INTEGER) AS begin Select Sum("hits") FROM "SiteHits" into :Hits; suspend; end ********************* Now the next Delphi code is used to get the returing value, and is NOT working: ********************** procedure Page_Load; var myConnection : FBConnection; myCommand : FBCommand; transaction: FBTransaction; parameterHits: FBParameter; begin myConnection := FbConnection.Create(ConfigurationSettings.AppSettings.Get('ConnectionString' )); myConnection.Open; transaction:=myConnection.BeginTransaction; myCommand := FbCommand.Create('HITSGETTOTAL', myConnection, transaction); myCommand.CommandType := CommandType.StoredProcedure; parameterHits := FbParameter.Create('HITS', FbType.Integer); parameterHits.Direction := ParameterDirection.Output; myCommand.Parameters.Add(parameterHits); myCommand.ExecuteNonQuery; lblHits.Text:='Total: ' + parameterHits.Value.ToString; transaction.Commit; myConnection.Close; myCommand.Free; end; ************************* The error is: "Dynamic SQL Error SQL error code = -104 Token unknown - line 1, char 1 HITSGETTOTAL " on the line: " myCommand.ExecuteNonQuery; " ? ............................................. Zarko Gajic, webmaster to aspxDelphi.net - bringing the world of ASP.NET to Delphi developers http://www.aspxdelphi.net email: web...@as... ............................................. |