<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Wahoo! I did it! The last part of a WP-DB.PHP for Interbase/Firebird</title>
	<atom:link href="http://www.thecodecave.com/article364/feed" rel="self" type="application/rss+xml" />
	<link>http://www.thecodecave.com/article364</link>
	<description>Cold storage before my best ideas melt away...</description>
	<pubDate>Tue, 02 Dec 2008 19:40:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Brian</title>
		<link>http://www.thecodecave.com/article364#comment-18518</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Tue, 10 Apr 2007 18:15:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecodecave.com/article364#comment-18518</guid>
		<description>jachguate! Thank you!  I will actually make a second conversion module for FB2+.  I'd totally missed that feature.  

Unfortunately, the &lt;a href="http://www.CodeGear.com" rel="nofollow"&gt;company&lt;/a&gt; I am doing this for has rather strong feelings on the IB/FB debate!</description>
		<content:encoded><![CDATA[<p>jachguate! Thank you!  I will actually make a second conversion module for FB2+.  I&#8217;d totally missed that feature.  </p>
<p>Unfortunately, the <a href="http://www.CodeGear.com" rel="nofollow">company</a> I am doing this for has rather strong feelings on the IB/FB debate!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jachguate</title>
		<link>http://www.thecodecave.com/article364#comment-18516</link>
		<dc:creator>jachguate</dc:creator>
		<pubDate>Tue, 10 Apr 2007 18:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecodecave.com/article364#comment-18516</guid>
		<description>If your'e using the (new) Firebird 2, you can do this using the new &lt;strong&gt;returning&lt;/strong&gt; clause for insert statements.  For more info, read the page 39 of the release notes of the 2.0.0 or 2.0.1 release.</description>
		<content:encoded><![CDATA[<p>If your&#8217;e using the (new) Firebird 2, you can do this using the new <strong>returning</strong> clause for insert statements.  For more info, read the page 39 of the release notes of the 2.0.0 or 2.0.1 release.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Firebird News &#187; Want to run WordPress with FB?</title>
		<link>http://www.thecodecave.com/article364#comment-18490</link>
		<dc:creator>Firebird News &#187; Want to run WordPress with FB?</dc:creator>
		<pubDate>Tue, 10 Apr 2007 14:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecodecave.com/article364#comment-18490</guid>
		<description>[...] abstraction layer for WordPress. It allows you to run WordPress on various database. Read more here.  Permalink &#124; Share (digg, etc): &#160; &#160; &#160; &#160; &#160;  [...]</description>
		<content:encoded><![CDATA[<p>[...] abstraction layer for WordPress. It allows you to run WordPress on various database. Read more here.  Permalink | Share (digg, etc): &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Firebird News &#187; Wahoo! I did it! The last part of a WP-DB.PHP for Interbase/Firebird</title>
		<link>http://www.thecodecave.com/article364#comment-17406</link>
		<dc:creator>Firebird News &#187; Wahoo! I did it! The last part of a WP-DB.PHP for Interbase/Firebird</dc:creator>
		<pubDate>Wed, 04 Apr 2007 13:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecodecave.com/article364#comment-17406</guid>
		<description>[...] I knew 9 years of IB/FB experience would come in handy. [...]</description>
		<content:encoded><![CDATA[<p>[...] I knew 9 years of IB/FB experience would come in handy. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.thecodecave.com/article364#comment-17238</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 03 Apr 2007 21:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecodecave.com/article364#comment-17238</guid>
		<description>Why? For Delphi for PHP?</description>
		<content:encoded><![CDATA[<p>Why? For Delphi for PHP?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.thecodecave.com/article364#comment-17067</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Tue, 03 Apr 2007 01:52:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecodecave.com/article364#comment-17067</guid>
		<description>I'll go from the bottom up in answering that. 

First that's a great link.  Thanks!  It is definately on my book mark list.

And YES, going after the generators is the right way to go.  However, the generators themselves are not associated with the tables in any way I could find outside of the trigger code.  Generators are not even required to be named after the field or table.  Nor ar the triggers.  Read here: http://www.delphi32.com/info_facts/faq/faq_987.asp

So for Interbase, the primary key is simply an interger field and a trigger of some name is added associated the insert action.  That meant I would have had search the memo text for each trigger on the table and look for a generator reference.  I probably could isolate the insert triggers... somehow and just search those.  I'd have to assume the first Generator reference was indeed the one I wanted, but that would probably be a fair bet.

So, instead of doing that, I went after the primary key, which is what you see me doing in this example.  So, what the query statement does is go after max value in the primary key field of the table I am working with.  That should work most of the time but it is not guaranteed. Afterall the auto inc field COULD be the third field in the table.

Well, today is another day and I've thought on this further.  I think the most correct way IS to retrieve the MEMO text and and parse it.

So what I'll need to do is find select from RDB$TRIGGERS where RDB$RELATION_NAME=[The table name from the insert] and RDB$TRIGGER_TYPE=1.  That shouldn't be hard.  Then I locate the first GEN_ID( and trim off up to the end of that.  Then I need to look for a comma and cut off it and there after.  Then I should have the name of the trigger.  Then I can do a select statment, retrieving the trigger and I will have to specify that I want to Increment by 0.  

Yeah, that actually should do it... Maybe I'll get to work on that some more tomorrow...  Thanks for asking the question!  I aparently needed to revisit this after a break.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll go from the bottom up in answering that. </p>
<p>First that&#8217;s a great link.  Thanks!  It is definately on my book mark list.</p>
<p>And YES, going after the generators is the right way to go.  However, the generators themselves are not associated with the tables in any way I could find outside of the trigger code.  Generators are not even required to be named after the field or table.  Nor ar the triggers.  Read here: <a href="http://www.delphi32.com/info_facts/faq/faq_987.asp" rel="nofollow">http://www.delphi32.com/info_facts/faq/faq_987.asp</a></p>
<p>So for Interbase, the primary key is simply an interger field and a trigger of some name is added associated the insert action.  That meant I would have had search the memo text for each trigger on the table and look for a generator reference.  I probably could isolate the insert triggers&#8230; somehow and just search those.  I&#8217;d have to assume the first Generator reference was indeed the one I wanted, but that would probably be a fair bet.</p>
<p>So, instead of doing that, I went after the primary key, which is what you see me doing in this example.  So, what the query statement does is go after max value in the primary key field of the table I am working with.  That should work most of the time but it is not guaranteed. Afterall the auto inc field COULD be the third field in the table.</p>
<p>Well, today is another day and I&#8217;ve thought on this further.  I think the most correct way IS to retrieve the MEMO text and and parse it.</p>
<p>So what I&#8217;ll need to do is find select from RDB$TRIGGERS where RDB$RELATION_NAME=[The table name from the insert] and RDB$TRIGGER_TYPE=1.  That shouldn&#8217;t be hard.  Then I locate the first GEN_ID( and trim off up to the end of that.  Then I need to look for a comma and cut off it and there after.  Then I should have the name of the trigger.  Then I can do a select statment, retrieving the trigger and I will have to specify that I want to Increment by 0.  </p>
<p>Yeah, that actually should do it&#8230; Maybe I&#8217;ll get to work on that some more tomorrow&#8230;  Thanks for asking the question!  I aparently needed to revisit this after a break.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Wilk</title>
		<link>http://www.thecodecave.com/article364#comment-17035</link>
		<dc:creator>Tom Wilk</dc:creator>
		<pubDate>Mon, 02 Apr 2007 23:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecodecave.com/article364#comment-17035</guid>
		<description>Brian,

1.  Can you go over this statement again?  "So that’s just a select Max(fieldname) from tablename statment and I return the value I’ve found in field one  (handling an empty result set of course)."    I'm not quite sure I follow you here.

2.  Is there are way to find the GENERATOR for a specific primary key (and table) and then use "SELECT GEN_ID(name, increment) FROM RDB$DATABASE"?   I believe that this is the preferred way to fetch an "autoincrement" field in InterBase and Firebird, as app.

BTW, I thought that this link on Lorenzo Alberton site was interesting  =&#62;  http://www.alberton.info/firebird_sql_meta_info.html


Tom</description>
		<content:encoded><![CDATA[<p>Brian,</p>
<p>1.  Can you go over this statement again?  &#8220;So that’s just a select Max(fieldname) from tablename statment and I return the value I’ve found in field one  (handling an empty result set of course).&#8221;    I&#8217;m not quite sure I follow you here.</p>
<p>2.  Is there are way to find the GENERATOR for a specific primary key (and table) and then use &#8220;SELECT GEN_ID(name, increment) FROM RDB$DATABASE&#8221;?   I believe that this is the preferred way to fetch an &#8220;autoincrement&#8221; field in InterBase and Firebird, as app.</p>
<p>BTW, I thought that this link on Lorenzo Alberton site was interesting  =&gt;  <a href="http://www.alberton.info/firebird_sql_meta_info.html" rel="nofollow">http://www.alberton.info/firebird_sql_meta_info.html</a></p>
<p>Tom</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.449 seconds -->
