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 11th February 2017, 17:23
rajitha rajitha is offline
Junior Member
 
Join Date: Dec 2013
Posts: 22
rajitha is on a distinguished road
Baan: baan 4 - DB: oracle - OS: AIX
to know records which were skipped for update
Baan: Other/Unknown
C/S: None/Unknown

Hi All,

I have a customized table where I need to update two fields if they are empty with the data of another table.
I want to know which rows are skipped without updating,how to do that

below said "custtable",also cprj.f cprj.t etc form fields on session where we give inputs through it
example piece of code is below :
Code:
db.retry.point()
	
	select 	custtable.* 
	from 	custtable for update
	where	custtable.cprj inrange :cprj.f and :cprj.t
	and     custtable.pfbp inrange :ofbp.f and :ofbp.t
	and 	custtable.cono = ""
	and	custtable.cnln = ""
	and	custtable.cprj <> ""
	selectdo
		select tpctm110.cono,tpctm110.cnln
		from   tpctm110
		where  tpctm110.cprj = :custtable.cprj
		and    tpctm110.itbp = :custtable.pfbp
		as set with 1 rows
		selectdo
                         custtable.cono = tpctm110.cono
                         custtable.cnln = tpctm110.cnln
                         
                         l.ret.val = db.update(
                         		custtable, db.retry, db.skip.dupl)
                         
                         if l.ret.val = 0 then
                         	brp.ready(brp.id.proc)
                         endif
		endselect	
	endselect

Last edited by bhushanchanda : 12th February 2017 at 15:19. Reason: added code tags
Reply With Quote
  #2  
Old 12th February 2017, 12:02
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
Hi Rajitha

Better use, dal.update, you would know for which records the update did not happen as it would return a Error Message along with it.

Code:
 dal.update  (string class_name, long object_set, ref long retval, long prop_check [, long mode] [, long eflag])

If retval <> 0 then
     dal.get.error.message(mess)
endif
Reply With Quote
  #3  
Old 14th February 2017, 10:30
vamsi_gujjula's Avatar
vamsi_gujjula vamsi_gujjula is offline
Senior Member
 
Join Date: Nov 2011
Location: hyderabad ; india
Posts: 240
vamsi_gujjula is on a distinguished road
Baan: ERPLN fp3 and 10.4 - DB: oracle - OS: Aix , Redhat linux 6
if skipped update means failed updates

db.update(custtable, db.retry, db.skip.dupl,db.return.error + db.return.ref.not.exists) this will return the error while update..

I am not sure what you are looking for
__________________
Regards,
Vamsi
Reply With Quote
  #4  
Old 14th February 2017, 13:41
manish@erpln manish@erpln is offline
Junior Member
 
Join Date: Oct 2013
Location: Pune
Posts: 4
manish@erpln is on a distinguished road
Baan: BAAN IV, BAAN V, ERP LN FP2, FP3, FP5 , FP7, FP9 , FP10.4 - DB: SQL Server,Oracle - OS: Windows Xp,Windows7,Windows 10
Hi Rajitha,

Try to write your code in the following way :-
Code:
db.retry.point()
	
        select 	custtable.* 
	from 	custtable for update
	where	custtable.cprj inrange :cprj.f and :cprj.t
	and     custtable.pfbp inrange :ofbp.f and :ofbp.t
	and 	custtable.cono = ""
	and	custtable.cnln = ""
	and	custtable.cprj <> ""
	selectdo
		select tpctm110.cono,tpctm110.cnln
		from   tpctm110
		where  tpctm110.cprj = :custtable.cprj
		and    tpctm110.itbp = :custtable.pfbp
		as set with 1 rows
		selectdo
                       update.flag = false              | Declare a variable of type tcbool
                         
                        if isspace(custtable.cono) then   | if it is a string type
                             custtable.cono = tpctm110.cono
                             update.flag = true
                        endif
                         if custtable.cnln = 0 then  | if it is a long type
                                    custtable.cnln = tpctm110.cnln
                                    update.flag = true
                          endif
                         
                          if update.flag = true then 
                               l.ret.val = db.update(
                         		    custtable, db.retry, db.skip.dupl)
                          else
                          //   if l.ret.val = 0 then
                         	     brp.ready(brp.id.proc) || it will send all the skipped or not updated records to your report.!!
                          //    endif
                         endif
		endselect	
	endselect
May be it will be helpful.

Thanks,
Manish Kumar

Last edited by mark_h : 15th February 2017 at 14:16. Reason: Turn smiles off and add code tags
Reply With Quote
Sponsored Links
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
Multi-occ skip records without reference to other table Kennymen Distribution, Transportation & Warehousing 6 13th August 2015 10:27
Select distinct records thru query extension?? arajasek Tools Development 5 25th August 2010 07:24
Selecting Records for First Forms Post tslaton Tools Development 1 6th April 2006 23:18
Losed tfgld418 records - Urgent Help Please mprakash Finance, Invoicing and Integration 13 25th September 2004 09:26
how to get skipped records of exchange? forsms Tools Administration & Installation 2 10th April 2002 01:13


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


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