Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
Would you like to see a separate forum on Baanboard for the ION product?
No
14%
Yes
86%
Total votes: 80

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 8th July 2012, 15:13
anant desai anant desai is offline
Junior Member
 
Join Date: Apr 2012
Posts: 23
anant desai is on a distinguished road
Baan: IVc2 - DB: SQl Server 2000 - OS: Windows2000
main.table.io
Baan: Other/Unknown
C/S: None/Unknown

I have the the following piece of code:
main.table.io:
after.read:
select tdsls040.refa,tdsls045.ssls
from tdsls040,tdsls045
where tdsls040._index1={:tdsls045.orno}
and tdsls045.ssls=1
as set with 1 rows
selectdo
endselect
Main table is tdsls040.
Table tdsls045 has multiple records for the same orno.
Session is type1/2/3 display session with main table.
This displays ALL records of tdsls040, ignoring the
where clause tdsls045.ssls=1
Reply With Quote
Sponsored Links
  #2  
Old 8th July 2012, 21:21
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,943
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Sounds like the same problem that was posted once before. If I get it correctly you have one tdsls040 record to be displayed and multiple tdsls045 records. Plus you only want to display those tdsls040 records where it has a tdsls045 record where tdsls045.ssls=1. The program itself already has the current tdsls040 record - reading the table again would probably confuse the session.
Code:
main.table.io:
after.read:
     select tdsls045.ssls
     from tdsls045
     where tdsls045._index1={:tdsls040.orno}
     and tdsls045.ssls<>1
     as set with 1 rows
     selectdo
          skip.io("")
     endselect
PS - not familiar with these tables or relationships.
__________________
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 9th July 2012, 13:59
anant desai anant desai is offline
Junior Member
 
Join Date: Apr 2012
Posts: 23
anant desai is on a distinguished road
Baan: IVc2 - DB: SQl Server 2000 - OS: Windows2000
The program works fine, thank you.
But the problem comes in when there
is no corresponding record in tdsls045.
I have coded the following:
selectempty
skip.io("").
Then no records are displayed.
Reply With Quote
  #4  
Old 9th July 2012, 14:36
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,943
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Code:
main.table.io:
after.read:
     select tdsls045.ssls
     from tdsls045
     where tdsls045._index1={:tdsls040.orno}
     and tdsls045.ssls<>1
     as set with 1 rows
     selectdo
          skip.io("")
     selectempty
| When it hits here it means there could be records with tdsls045.ssls=1
| now you need to verify it there are no records.
          select tdsls045.ssls
          from tdsls045
          where tdsls045._index1={:tdsls040.orno}
          as set with 1 rows
          selectdo
          selectempty
               skip.io("")
          endselect
    endselect
Of maybe this which looks a little simpler to me.
Code:
main.table.io:
after.read:
|Skip if no tdsls045 records
     select tdsls045.ssls
     from tdsls045
     where tdsls045._index1={:tdsls040.orno}
     as set with 1 rows
     selectdo
     selectempty
          skip.io("")
      endselect
|skip if tdsls045.ssls not equal to 1
     select tdsls045.ssls
     from tdsls045
     where tdsls045._index1={:tdsls040.orno}
     and tdsls045.ssls<>1
     as set with 1 rows
     selectdo
          skip.io("")
     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
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
Alternative For Main.table.io. I dont want DAL. ram_baan Tools Development 1 28th June 2010 10:35
Deactivating Dal to force main.table.io execution quintict Tools Development 5 20th May 2010 17:55
about DAL and main.table.io hujiehujie Tools Development 12 19th May 2008 14:59
main.table.io vishbaan Tools Development 3 10th November 2004 06:51
main.table.io: is not executed cazerpa Tools Development 6 12th October 2004 19:05


All times are GMT +2. The time now is 14:27.


©2001-2013 - Baanboard.com - Baanforums.com