Page 1 of 1
Temptable in special data form
Posted: Wed Oct 03, 2012 8:07 pm
by forgot
Hello.
Is it possible in nuBuilder in php procedure create temporary table in then open form with that table in as data for subform?
So step by step
1. Call php procedure
2. In php create temp table (like __my213423424__) or put new rows in special table (mytemptable)
3. Open data form with subform
4. That subform shows me mytemptable’s row by row.
Can I do that in nyBuilder?
--
Maxim
Re: Temptable in special data form
Posted: Thu Oct 04, 2012 7:13 am
by admin
Maxim,
You could try something like this..
Steps..
1.On
Before Load
Code: Select all
nuRunQuery("CREATE TABLE #browseTable# SELECT * FROM items");
2. In
SQL of Subform Object
Code: Select all
nuRunQuery("SELECT * FROM #browseTable#");
Steven
Re: Temptable in special data form
Posted: Thu Oct 04, 2012 10:44 am
by forgot
Very good way for me use #browseTable#. Thank you. Now I don't obligate delete temptable.
Some problem
If I put this code
Code: Select all
nuRunQuery("CREATE TABLE #browseTable# SELECT * FROM orders");
in 'Before open' tab nuBuilder get error ("can't execute SQL code"). I check in wiki
http://wiki.nubuilder.com/tiki-index.ph ... structure= this hash variables don't belong to Before Open event.
If I put this code in Before Browse it don't execute when I directly go to form with datafields.
And one more question in this topic.
Can I run Form from JavaScript and give some variables to this Form? Like java function runIt(pCode, param1, param2, param3…)
--
Maxim
Re: Temptable in special data form
Posted: Thu Oct 04, 2012 6:03 pm
by admin
Maxim,
You're right about browseTable but try recordID eg.
Code: Select all
nuRunQuery("CREATE TABLE `temp#recordID#` SELECT * FROM orders");
And if you create another table with a record holding every
temp#recordID# created. You could loop through and delete them at some point.
Question 2.
The only parameter that gets passed is a new thing explained here.
http://www.youtube.com/watch?v=6d_nYErMGPI
Steven
Steven