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
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 15th August 2017, 12:46
pundlik_girl pundlik_girl is offline
Newbie
 
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

Hi,

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?
or
has anyone developed such a functionality?

please let me know ...

thanks
Reply With Quote
  #2  
Old 15th August 2017, 14:03
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,906
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.

Code:
| Get starting VRC for each table. Using users current package/vrc.
		get_current_pvrc()
		
| 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,
				tdep,curr.tver,curr.trel,curr.tcus)
			if rc = 0 then
				get_parent_pvrc()
			endif
		endwhile

|******************************************************************************
| 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
	selectdo
	endselect
	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
	selectdo
		curr.tver(1,1) = ttadv111.vedf
		curr.trel(1,1) = ttadv111.redf
		curr.tcus(1,1) = ttadv111.cudf
	selectempty   
		curr.tver(1,1) = ""
	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
Sponsored Links
  #3  
Old 16th August 2017, 10:03
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 444
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Well you could use , db.drop.table

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

Description

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. 


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


All times are GMT +2. The time now is 04:09.


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