Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
14%
200 - 500 GB
32%
500 - 800 GB
4%
800 - 1200 GB
4%
1200 - 1500 GB
11%
1500 - 2000 GB
14%
> 2000 GB
21%
Total votes: 28

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 8th August 2002, 12:27
arajasek's Avatar
arajasek arajasek is offline
Junior Member
 
Join Date: Nov 2001
Location: Hyderabad
Posts: 8
arajasek is on a distinguished road
Baan: Baan IV c4 - DB: Oracle 7.1.2 - OS: Unix
Question Select distinct records thru query extension??

Hi,
I was trying to get distinct records from main table in a display session. And so Iwas tryin it out in a query extension. Problem is I could get the required records, But Iam not able to skip the duplicate records.

Let me explain this with an example. Lets assume that we have 2 tables Emp and dept.

Here is the structure of the tables ...

Emp table --> Enum, Ename, Esal
Dept table --> Dnum, Dname

So this way I have 100 records in employee table and just 4 records in dept table which means we just have 4 departments. Now my problem is to fetch just 4 records from employee table thru a query extension on Emp table... since main table for this dsiplay session is employee table.

I hope I was clear in explainin the situation.

Kindly help me out to solve this problem.
__________________
Regards,
Rajasekhar Allu
Reply With Quote
  #2  
Old 8th August 2002, 13:43
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Is dnum a field in the Emp table? If it is then multiple employees can belong to each of the departments. So which four employees do you want to show on the display session? Post the query extension for us to understand a little better.
__________________
~Vamsi
Vamsi Potluru
Baan XL Yet another tool to format Baan output in Excel from Baan Board
This one just happens to be free :)

Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 22nd August 2010, 14:25
mast_aadmi mast_aadmi is offline
Member
 
Join Date: Oct 2009
Posts: 54
mast_aadmi is on a distinguished road
Baan: infor 6.1 fp2 - DB: sql server - OS: windows server 2003
I have a similar problem. I'm working with the table tccom100 as my main table.
Now i want to view only those business partners who have an entry in the table tdpur400. But the problem is that there are multiple records in the table tdpur400 with a single business partner and i'm not able to use the query.extend to return distinct records. As a result i have duplicate Business partner records. Is there any way to solve this.
Reply With Quote
  #4  
Old 23rd August 2010, 12:07
sameer.don's Avatar
sameer.don sameer.don is offline
Senior Member
 
Join Date: Oct 2008
Posts: 104
sameer.don is on a distinguished road
Baan: Baan IV, Baan ERP, BaaN ERP (B50C) - DB: MS SQL 2000, Oracle, Informix - OS: Windows 2003, Unix
Quote:
Originally Posted by mast_aadmi View Post
I have a similar problem. I'm working with the table tccom100 as my main table.
Now i want to view only those business partners who have an entry in the table tdpur400. But the problem is that there are multiple records in the table tdpur400 with a single business partner and i'm not able to use the query.extend to return distinct records. As a result i have duplicate Business partner records. Is there any way to solve this.


You can have code in before.display.object or main.table.io section, where u can write a query on tdpur400 with set specification to select just one record.
and then if record not found u can skip current read on the main table.

Or
u can use IN clause with query.extension
for eg:
query.extension = " where tccom100.bpid in (select tdpur400.bpid from tdpur400 where tdpur400.otbp = :tccom100.bpid as set with 1 rows) "
Reply With Quote
  #5  
Old 25th August 2010, 08:24
mast_aadmi mast_aadmi is offline
Member
 
Join Date: Oct 2009
Posts: 54
mast_aadmi is on a distinguished road
Baan: infor 6.1 fp2 - DB: sql server - OS: windows server 2003
Thanks

Thanks Sameer. I wasn't thinking on the lines of using the IN command. Thanks for the solution.
Reply With Quote
  #6  
Old 23rd August 2010, 09:30
rp.chowdary rp.chowdary is offline
Member
 
Join Date: Feb 2009
Posts: 32
rp.chowdary is on a distinguished road
Baan: ERP Ln 6.1 - DB: SQL Server 2008 R2 - OS: Windows Server 2008 R2
select your reqiure data using query.extend.select, query.extend.from and query.extend.where functions and then use rebuild.query().

this may help for you.
__________________
Rp
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
Query Extension ken bohnenkamp Tools Development 17 8th November 2011 12:39
Query extension veerle Tools Development 3 8th July 2004 14:24


All times are GMT +2. The time now is 05:02.


©2001-2018 - Baanboard.com - Baanforums.com