<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=HowToCreateATempCursor</id>
	<title>HowToCreateATempCursor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=HowToCreateATempCursor"/>
	<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=HowToCreateATempCursor&amp;action=history"/>
	<updated>2026-11-21T08:22:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://wiki.dabo.leafe.com/index.php?title=HowToCreateATempCursor&amp;diff=4188&amp;oldid=prev</id>
		<title>Ed: Created page with &quot;Occasionally you may need a temporary cursor to access tables. There are several ways to access the database via cursors. But the best way does not violate Dabo&#039;s 3 tier desig...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=HowToCreateATempCursor&amp;diff=4188&amp;oldid=prev"/>
		<updated>2020-05-17T14:52:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Occasionally you may need a temporary cursor to access tables. There are several ways to access the database via cursors. But the best way does not violate Dabo&amp;#039;s 3 tier desig...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Occasionally you may need a temporary cursor to access tables. There are several ways to access the database via cursors. But the best way does not violate Dabo&amp;#039;s 3 tier design and most importantly does not cause other issues with Dabo.&lt;br /&gt;
&lt;br /&gt;
Below is an example of how I did it.&lt;br /&gt;
&lt;br /&gt;
I add the following to the form&amp;#039;s &amp;lt;code&amp;gt;createBizobjs()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
self.biztmp = dabo.biz.dBizobj(self.Connection)&lt;br /&gt;
self.tmpbiz = self.biztmp.getTempCursor()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;self.Connection&amp;lt;/code&amp;gt; is the name of the Form&amp;#039;s connection to the database. And I did not add the bizobj to the form (do not -&amp;gt; &amp;lt;code&amp;gt;self.addBizobj(self.biztmp)&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Now I can use &amp;lt;code&amp;gt;self.tmpbiz&amp;lt;/code&amp;gt; anywhere on the form as I would any other bizobj. So I can:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
self.tmpbiz.execute(&amp;quot;select somefield from sometable&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the bizobj &amp;lt;code&amp;gt;self.tmpbiz&amp;lt;/code&amp;gt; will contain the retreived data in the [[DataSet]].&lt;br /&gt;
&lt;br /&gt;
In my case I decided to create a special bizobj to make it easier to identify in code. But you could have used any bizobj that the form knows about. So if the form has a bizobj named &amp;lt;code&amp;gt;CustomerBizObj&amp;lt;/code&amp;gt; you can use it to create a temporary cursor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myTempCursor = self.Form.CustomerBizObj.getTempCursor()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above will not change/touch/overwrite the &amp;lt;code&amp;gt;CustomerBizObj&amp;lt;/code&amp;gt; data.&lt;/div&gt;</summary>
		<author><name>Ed</name></author>
	</entry>
</feed>