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 4th October 2017, 14:21
pralash pralash is online now
Senior Member
 
Join Date: Feb 2017
Posts: 123
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Insert the records of one table into another table with different company
Baan: Other/Unknown
C/S: None/Unknown

Hi,

I'm new for LN Programming. I need to copy the records of existing table ttaad200(000-company) into my own table tccom200(600-company). I have to copy only few fields of the table ttaad200 into tccom200. Hence I have created the required field like the ttaad200 and also add some new fields in tccom200. Can anybody help me that how to read a record one by one from the table ttaad200 and also how to store them in tccom200 table.
Thanks in advance...
Regards,
senthil
Reply With Quote
  #2  
Old 4th October 2017, 17:17
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
in 4c4 I would do something like below - in my case I check to see if item exists and just update some fields. If I do not find the item I insert a new record. You can play with everything you need - of course wait for an ln developer they might offer better suggestions.

Code:
db.retry.point()
select	tiitm001.*
from	        tiitm001
where	tiitm001.item inrange :item.f and :item.t
selectdo
	select	tiemg001.*
	from 	tiemg001 for update
	where	tiemg001._index1 = {:tiitm001.item}
	selectdo
		|record found
		tiemg001.dsca = tiitm001.dsca
		tiemg001.pdty = tiitm001.ctyp
		tiemg001.ctyp = tiitm001.ctyp
		tiemg001.temp = itemtemplate
		db.update(ttiemg001,db.retry)			
	selectempty
		| Record not found
		tiemg001.dsca = tiitm001.dsca
		tiemg001.pdty = tiitm001.ctyp
		tiemg001.ctyp = tiitm001.ctyp
		tiemg001.temp = itemtemplate
		db.insert(ttiemg001,db.retry)
	endselect
	commit.transaction()
endselect
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 5th October 2017, 04:27
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 445
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Also you could use rcd store and copy functions with the help of db.bind ..That also.works..
Reply With Quote
Sponsored Links
  #4  
Old 5th October 2017, 09:55
pralash pralash is online now
Senior Member
 
Join Date: Feb 2017
Posts: 123
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Thanks for your guidance...
Here I know tiitm001.item is a field..
But please let me about item.f and :item.t arguments

Thanks,
Pralash
Reply With Quote
  #5  
Old 5th October 2017, 14:56
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Those are form fields on the session I pulled a snippet of code from. So the user could enter a range of parts. If I wanted to I could replace them with " " and "ZZZZZZZZ" (or use actual item range).
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
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
Editable additional field? alex.bonutti Tools Development 1 22nd May 2017 14:04
sec.add.table Marioth Tools Development 10 9th August 2015 11:27
Drop a table from company 000 alexpreyer Tools Development 7 28th November 2010 23:14
copy records c_siek Tools Development 9 18th June 2004 16:43


All times are GMT +2. The time now is 12:17.


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