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

User login

Frontpage Sponsor


Google search

How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
200 - 500 GB
500 - 800 GB
800 - 1200 GB
1200 - 1500 GB
1500 - 2000 GB
> 2000 GB
Total votes: 36

Baanboard at LinkedIn

Reference Content

Thread Tools Display Modes
Old 15th August 2017, 13:46
pundlik_girl pundlik_girl is offline
Join Date: Dec 2016
Posts: 1
pundlik_girl is on a distinguished road
Baan: Baan 5 - DB: oracle - OS: unix
need to find to which company the table to related to
Baan: ERP LN 6.1 FP3
C/S: Client


I want to basically re-write the logic of session ttaad4231m000 - Delete tables but without actually deleting the tables.

my idea is to start with table ttadv112 - pvrc by package combination
then use the pacc to find the company in ttaad100.
and then check if the table to attached to the company.

the standard program uses - DLL ttdllvrcsearch & baan function ttadv0052
to search which vrc the table actually exists in
and then to check if that VRC is present in the package combination linked to the company.

does anybody have the source code of the tt program script, dll or function?
has anyone developed such a functionality?

please let me know ...

Reply With Quote
Old 15th August 2017, 15:03
mark_h's Avatar
mark_h mark_h is offline
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,147
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Doubt anyone has the source, but you can typically see how to call the routines using bic_info. As for one I wrote something once but we never used it - including some of the relevant code - not sure it will help and have not looked at it in years(looks like it is from 2004) The top two routines were in a select statement on ttadv422 and this is on 4c4 - so not how much that might matter.

| Get starting VRC for each table. Using users current package/vrc.
| Search VRC will return true when the curr fields point to the lastest
| VRC for the table.
		rc = 0
		while rc = 0 and strip$(curr.tver(1,1)) <> ""
			rc = vrc_search_table(ttadv422.cpac,ttadv422.cmod,ttadv422.flno,
			if rc = 0 then

| Used to get the users current VRC.  You always want to start in that VRC.
function get_current_pvrc()
	select	ttadv040.*
	from	ttadv040
	where	ttadv040.user = :logname$
	and	ttadv040._compnr = 0
	as set with 1 rows
	curr.tver(1,1) = ttadv040.vers
	curr.trel(1,1) = ttadv040.rele
	curr.tcus(1,1) = ttadv040.cust

| Used to get the "derived from" VRC for a given VRC.
function get_parent_pvrc()
	domain	ttadv.vers	tver
	domain	ttadv.rele	trel
	domain	ttadv.cust	tcus

	tver = curr.tver(1,1)
	trel = curr.trel(1,1)
	tcus = curr.tcus(1,1)

	select	ttadv111.*
	from	ttadv111
	where	ttadv111._index1 = {:ttadv422.cpac,:tver,:trel,:tcus}
	and	ttadv111._compnr = 0
	as set with 1 rows
		curr.tver(1,1) = ttadv111.vedf
		curr.trel(1,1) = ttadv111.redf
		curr.tcus(1,1) = ttadv111.cudf
		curr.tver(1,1) = ""

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
Sponsored Links
Old 16th August 2017, 11:03
Ajesh's Avatar
Ajesh Ajesh is offline
Join Date: Feb 2009
Posts: 535
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Well you could use , db.drop.table

function long  db.drop.table  (long table_id [, long flag] [, long comp_nr])


This deletes a specified table. Data and indices associated with the table are also deleted. Reference counters are automatically updated. 

Note that this function cannot be used within a transaction; see Transaction handling. 

long table_id The table ID, as returned by db.bind(). 
[long flag]  If you set this optional argument to DB.IGNORE.ALL.REFS, the data is deleted regardless of whether it is referenced by other tables. WARNING: if you don't need this behaviour, please leave out the argument completetly. Never supply another value than DB.IGNORE.ALL.REFS to this argument. 
[long comp_nr]  This optional argument specifies a company number for the table. The default company is the company of the user. 
Return values
0 Success. 
<>0 Error. 
This function is implemented in the porting set and can be used in all script types.
But i would suggest consulting the Baan or the system administrator before using this. Dropping a Table is a big decision.
Reply With Quote

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
Drop a table from company 000 alexpreyer Tools Development 7 28th November 2010 23:14
Audit file structure baan_user Tools Development 8 4th May 2007 15:32
Tables used for MRP and PRP. BurghMan Tools Development 1 10th February 2005 15:08

All times are GMT +2. The time now is 18:58.

©2001-2018 - -