# DBtree control with temporary tables

**URL:** <https://forum.servoy.com/t/dbtree-control-with-temporary-tables/16912>\
**Category:** Classic Servoy\
**Created:** [January 9, 2013, 3:34am UTC](https://forum.servoy.com/t/dbtree-control-with-temporary-tables/16912 "2013-01-09T03:34:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonid](https://avatars.discourse-cdn.com/v4/letter/l/d9b06d/32.png) [@leonid](https://forum.servoy.com/u/leonid)\
**Post date:** [January 9, 2013, 3:34am UTC](https://forum.servoy.com/t/dbtree-control-with-temporary-tables/16912/1 "2013-01-09T03:34:25Z")

</div>

I binding temporary table to dbtreview control. The code what I attached below works except it not show any data in column which I created using createColumn method of dbtreview control. This method require a server name and table name. Because my temporary table is memory table the getDataSourceServerName and getDataSourceTableName functions always return null and I think this is a cause of problem. Is it possible to extend feature of dbtreeview control to allow add columns using temporary table?

var \_arrField = new Array(“itemid”, “parentid”,“item\_desc”);  
var \_arrType = new Array(JSColumn.INTEGER, JSColumn.INTEGER, JSColumn.TEXT);  
var \_dset = scopes.ordNav.CreateEmptyDataSet(\_arrField, \_arrType);  
var \_dset = databaseManager.createEmptyDataSet()  
\_dset.addColumn(\_aFields[0], 1, \_aType[0])  
\_dset.addColumn(\_aFields[1], 2, \_aType[1])  
\_dset.addColumn(\_aFields[2], 3, \_aType[2])

var \_dataSourceName = application.getUUID().toString()  
\_dataSource = \_dset.createDataSource( \_dataSourceName);

var rel = solutionModel.newRelation(‘myRelation’,\_dataSource, \_dataSource, JSRelation.INNER\_JOIN);  
rel.initialSort = ‘itemid asc’ // ‘sortseq asc’;  
rel.allowCreationRelatedRecords = true;  
rel.allowParentDeleteWhenHavingRelatedRecords = true;  
rel.newRelationItem(‘itemid’, ‘=’, ‘parentid’);  
\_foundset.loadAllRecords()

var \_server\_datasource = databaseManager.getDataSourceServerName(\_dataSource);  
var \_tableName = databaseManager.getDataSourceTableName(\_dataSource);  
var binding = elements.dbtreeview.createBinding(\_dataSource);  
binding.setNRelationName(‘myRelation’);  
binding.setTextDataprovider(‘itemid’);  
elements.dbtreeview.createColumn(\_server\_datasource, \_tableName, ‘Item desc’, ‘item\_desc’);  
binding.setCallBackInfo(node\_selected, ‘itemid’);  
refreshTreeView();

---

<div class="post-metadata">

**Author:** ![Gabi\_Boros](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@Gabi\_Boros](https://forum.servoy.com/u/Gabi_Boros)\
**Post date:** [January 10, 2013, 10:43am UTC](https://forum.servoy.com/t/dbtree-control-with-temporary-tables/16912/2 "2013-01-10T10:43:40Z")

</div>

can you create a case for this issue with a sample ?

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [January 10, 2013, 11:17am UTC](https://forum.servoy.com/t/dbtree-control-with-temporary-tables/16912/3 "2013-01-10T11:17:25Z")

</div>

We have kind of the same problem.

We want to use the dbtreeview, because that is the only one, you can use with selectboxes.  
The trouble is that we can´t use database foundset, so we also wanted to created temp datasources, but somehow we can´t get this kind of setup working…

---

<div class="post-metadata">

**Author:** ![leonid](https://avatars.discourse-cdn.com/v4/letter/l/d9b06d/32.png) [@leonid](https://forum.servoy.com/u/leonid)\
**Post date:** [January 12, 2013, 10:45pm UTC](https://forum.servoy.com/t/dbtree-control-with-temporary-tables/16912/4 "2013-01-12T22:45:58Z")

</div>

Created case: [https://support.servoy.com/browse/SVY-3686](https://support.servoy.com/browse/SVY-3686)
