FireBird 1.5 RC3 and Stored Procedures w/ FireBird.Net Data provider
Giving my firsteps in FireBird I got stuck with an error when I tried to call a stored procedure. I don't know if the error is in the stored procedure or in th C# code.
Procedure:
CREATE PROCEDURE ADD_CLIENTE (
NAME VARCHAR(255),
EMAIL VARCHAR(75),
ACTIVATED CHAR(1))
AS
begin
BEGIN
INSERT INTO CLIENTES (NAME,EMAIL,ACTIVATED)
VALUES (:NAME, :EMAIL,:ACTIVATED);
END
suspend;
end
C# Code:
FbConnection fb = new FbConnection(myConnectionString);
Fb.Open();
FbTransaction ft = fb.BeginTransaction();
FbCommand fc = new FbCommand("ADD_CLIENTE",fb,ft);
fc.CommandType = CommandType.StoredProcedure;
Exception Details: FirebirdSql.Data.INGDS.GDSException: Exception of type FirebirdSql.Data.INGDS.GDSException was thrown.
[GDSException: Exception of type FirebirdSql.Data.INGDS.GDSException was thrown.]
FirebirdSql.Data.Firebird.FbStatement.Prepare() +392
FirebirdSql.Data.Firebird.FbCommand.Prepare() +408
CREATE PROCEDURE GETVARCHARFIELD (
ID INTEGER)
RETURNS (
VARCHAR_FIELD VARCHAR(100))
AS
begin
for select varchar_field from test_table_01 where int_field = :id
into :varchar_field
do
suspend;
end
--
Best regards
Carlos Guzma'n A'lvarez
Vigo-Spain
Thanks a lot! It works now. :D
The more I learn about firebird the more I like it. And congratulations on the job with the FireBird .net Data Provider. It is simply great.
Originally posted by fetcher
Thanks a lot! It works now. :D
The more I learn about firebird the more I like it. And congratulations on the job with the FireBird .net Data Provider. It is simply great.
Good :)
If you need more help then here is the .net provider list
where you can subscribe (Carlos Alvarez is on the list and he knows more advanced things about provider - he wrote it)