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 16th December 2016, 12:49
sukhija7 sukhija7 is offline
Junior Member
 
Join Date: Jun 2010
Posts: 8
sukhija7 is on a distinguished road
Baan: ERP LN IV - DB: ORacle - OS: WIN XP
Identify the difference in script

Hi,
Can anyone let me know the difference in following script..
Assuming vrinf502 as customized table
1.
select vrinf502.*
from vrinf502
where vrinf502.orno = :whinh225.orno
and vrinf502.ppon = :whinh225.pono
and vrinf502.ktwt = :whinh225.qadv
selectdo
flag.d2 = true
endselect

2. select vrinf502.*
from vrinf502
where vrinf502.orno = :whinh225.orno
and vrinf502.ppon = :whinh225.pono
selectdo
if vrinf502.ktwt = whinh225.qadv then
flag.d2 = true
endif
endselect
Reply With Quote
  #2  
Old 19th December 2016, 14:49
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,934
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
(1) Finds all records for the 3 fields then loops thru continuously setting the flag to true. On this one I would as add "as set with 1 rows". No reason to do all that looping.
(2) This query finds all row for the 2 fields, then it checks all of them. If even one of them as a qadv field that matches the vrinf502.ktwt field then it sets the flag to true.

In essence the 2 queries do the same thing - set the flag to true if just one time vrinf502.ktwt = whinh225.qadv these match.
__________________
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 20th December 2016, 09:07
sukhija7 sukhija7 is offline
Junior Member
 
Join Date: Jun 2010
Posts: 8
sukhija7 is on a distinguished road
Baan: ERP LN IV - DB: ORacle - OS: WIN XP
Quote:
Originally Posted by mark_h View Post
(1) Finds all records for the 3 fields then loops thru continuously setting the flag to true. On this one I would as add "as set with 1 rows". No reason to do all that looping.
(2) This query finds all row for the 2 fields, then it checks all of them. If even one of them as a qadv field that matches the vrinf502.ktwt field then it sets the flag to true.

In essence the 2 queries do the same thing - set the flag to true if just one time vrinf502.ktwt = whinh225.qadv these match.
Hi,
Concern is , first option is not working but 2nd option is working for a single set of record. why???
Reply With Quote
  #4  
Old 20th December 2016, 10:21
oirfeodent's Avatar
oirfeodent oirfeodent is offline
Member
 
Join Date: Jun 2016
Posts: 51
oirfeodent is on a distinguished road
Baan: Baan - DB: DB - OS: OS
Quote:
Originally Posted by sukhija7 View Post
Hi,
Concern is , first option is not working but 2nd option is working for a single set of record. why???
If you add order by clause to both the queries and re-init the flag in selectempty and initialize the flag before the start of query... you should be able to get a consistent result. Run-time scenarios/data-sets cannot be predicted.
Reply With Quote
Sponsored Links
  #5  
Old 20th December 2016, 14:42
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,934
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Quote:
Originally Posted by sukhija7 View Post
Hi,
Concern is , first option is not working but 2nd option is working for a single set of record. why???
I would be checking my code if the first option is not working. I would check all the domains for the table fields and make sure they line up. Not being familiar with the data I can't say for sure what exactly is the reason. But based off what you posted the first should work.

If that second field is a double or something like that then you could be running into a precision issue. We once had code that said if x=y do this - it worked on the test system when you set x and y to 1. In production it did not work even with x and y set to 1. We had to use double.cmp to do the test.
__________________
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
Baan LN variable set in Program script, not set in Report script rwhisenant Tools Development 3 30th April 2014 19:24
Code: Sample Qkey Script mark_h Code & Utilities 7 9th December 2013 15:33
Good Practice for storing 'external' source code in BAAN shah_bs Code & Utilities 1 30th July 2008 23:02
difference between session script and report script linyaohui Tools Development 2 18th October 2007 11:36
Variable value different in pgm. script & report script ? PacSun Tools Development 5 28th June 2006 20:09


All times are GMT +2. The time now is 07:22.


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