Hi Guys - note that this doesn't cover my case of wanting to run many inserts. I am currently manually parsing the data (quoting strings, and escaping quotes) and assembling the SQL with a StringBuilder
If there's a better way to do it, that would be great, but it doesn't seem that there's a way to get SQL out of firebird objects (or any other database objects, to be fair). My problem was with the overhead for each command on a handheld device. By running a block execute instead of individual procedure calls, the time elapsed has gone from 60+ seconds to about 5 Cheers, Matt -----Original Message----- From: da...@absolutepowerandcontrol.com [mailto:da...@absolutepowerandcontrol.com] Sent: Sunday, 23 January 2011 3:09 AM To: For users and developers of the Firebird .NET providers Subject: Re: [Firebird-net-provider] Execute block... 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 WARNING: This email and any attachments may be confidential and subject to copyright. If you are not the intended recipient, you must not disclose or use the information contained in this email. If you have received this email in error, please notify the sender and permanently delete the email immediately. Linfox Pty Ltd and its related companies do not warrant that this email and any attachments are free of errors, viruses or tampering by third parties, and will not be responsible for loss or damage resulting (either directly or indirectly) from any such error, virus or tampering. If this is a commercial email within the meaning of the Spam Act, you may unsubscribe from future commercial emails by emailing unsubscr...@linfox.com ------------------------------------------------------------------------------ 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