Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 15th February 2007, 20:02
_Ralph_'s Avatar
_Ralph_ _Ralph_ is offline
Senior Member
 
Join Date: Oct 2006
Location: Brazil
Posts: 209
_Ralph_ is on a distinguished road
Baan: LN 6.1 - DB: DB2 - OS: Unix
Thumbs up Inserting data on a table using vars
Baan: Other/Unknown
C/S: None/Unknown

Hi all.

I'm developing a program that allows users to insert data on table using an user interface.

This UI has 3 field:
  • table
  • field
  • data


Just an example :

Code:
function boolean input.data.on.table()
{
long table.id
string table.field(20), field.name(20)


	table.id = db.bind("t"&field.table)
	db.set.to.default(table.id)
|??????????????????
	field.name = data
|??????????????????
	db.insert(table.id)
}

but this way, won't work. As field.name is regonized as a variable.
Do you know somehow to "parse" a string with the table field name??
Something that works the same way as db.bind() for the table name..

is that possible??

my best regards
Reply With Quote
  #2  
Old 15th February 2007, 20:45
csecgn's Avatar
csecgn csecgn is offline
Guru
 
Join Date: Aug 2004
Location: Cologne/Germany
Posts: 300
csecgn is on a distinguished road
Baan: IVc4 SP14 (Tools SP 21) ; LN 6.1 (Testing) - DB: Oracle - OS: Solaris
Take a look at put.var(). With this command you can also fill table fields. But this is only half of the problem... . You also need special put.var for every data type. To evaluate the correct data type of a table field you need the rdi.* commands. It's a little complicate.

hth

Regards
Christof
Reply With Quote
  #3  
Old 15th February 2007, 21:00
rberti's Avatar
rberti rberti is offline
Member
 
Join Date: Feb 2007
Location: São Paulo
Posts: 62
rberti is on a distinguished road
Baan: BaaN IV, Baan V, LN - DB: Oracle, Informix - OS: UNIX
Post expr.compile

Hello _Ralph_.

I could try use expr.compile to attribute values to the fields, and then use the db.insert.

for example:

Code:
id_sql = expr.compile(sql_slct_do)
err = 	l.expr(id_sql)
tbl_id = db.bind(tbl_name)
db.update(tbl_id, db.retry)
commit.transaction()
expr.free(id_sql)
Hope it helps!

regards
Reply With Quote
Sponsored Links
  #4  
Old 16th February 2007, 12:50
_Ralph_'s Avatar
_Ralph_ _Ralph_ is offline
Senior Member
 
Join Date: Oct 2006
Location: Brazil
Posts: 209
_Ralph_ is on a distinguished road
Baan: LN 6.1 - DB: DB2 - OS: Unix
Quote:
Originally Posted by rberti View Post
Hello _Ralph_.

I could try use expr.compile to attribute values to the fields, and then use the db.insert.

for example:

Code:
id_sql = expr.compile(sql_slct_do)
err = 	l.expr(id_sql)
tbl_id = db.bind(tbl_name)
db.update(tbl_id, db.retry)
commit.transaction()
expr.free(id_sql)
Hope it helps!

regards
Thanks a lot for all replys.
rberti your solution work fine. I combine that with a Dynamic Sql and it works! Thanks guy!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERPJewels Hitesh Shah Third Party Products 10 6th November 2006 06:38
Data loss in bdbreconfig? muhonve Tools Administration & Installation 0 17th February 2006 16:01
Tables used for MRP and PRP. BurghMan Tools Development 1 10th February 2005 15:08
copy records c_siek Tools Development 9 18th June 2004 16:43
inserting data to table joshua Tools Development 4 11th December 2003 15:37


All times are GMT +2. The time now is 08:10.


©2001-2017 - Baanboard.com - Baanforums.com