Here is a snippet of code from my Firebird provider.  This function just
creates and returns the command object, but it shows how I use EXECUTE
BLOCK.  You'll note that 'id' is set by the generator, not as an inbound
parameter.

<code>
DbCommand cmd = Connection.CreateCommand();
cmd.CommandType = 
CommandType.Text;
cmd.CommandText = 
@"EXECUTE BLOCK (name VARCHAR(32) = ?) RETURNS (id BIGINT) AS
BEGIN
id = GEN_ID(ECOPCONFIGURATIONID, 1);
INSERT INTO ECOPCONFIGURATION (ID,NAME,ISACTIVE) VALUES (:id,:name,0);
SUSPEND;
END";
//'SUSPEND' is required for return values/output params. This causes the
server to wait for the client to request the next line
addParam(cmd,":name", DbType.AnsiString, name);

return cmd;
</code>
 
HTH,
Danny
 
-------- Original Message --------
Subject: [Firebird-net-provider] Execute block...
From: Adrián_Avila_Mtz. <adrian.avila....@gmail.com>
Date: Sat, January 22, 2011 9:36 am
To: "'For users and developers of the Firebird .NET providers'"
<firebird-net-provider@lists.sourceforge.net>

Is there a way to execute a block with FB data provider.



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better
price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to