Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Tools Development (http://www.baanboard.com/baanboard/forumdisplay.php?f=8)
-   -   Listing the particular record by mentioned the record number (http://www.baanboard.com/baanboard/showthread.php?t=70475)

pralash 4th October 2017 15:47

Listing the particular record by mentioned the record number
 
Hi,

I'm new to LN Programming. I want to read a record one by one from the baan table by mentioned the record number like in MySQL "select *from employee limit 2,1" which read the second record only. Similarly can you please let me know that how to read a particular record in the baan table by mentioned the record number.

Thanks and Regards,
Pralash

mark_h 4th October 2017 16:55

LN people probably have something different - but in 4c4 I would never read a specific record like that. But if I new I needed exactly 2 records I could use something like this:
Code:


select tccom010.*
from tccom010
where tccom010.emno >0
as set with 2 rows
selectdo
endselect

Just doing this I know the last set of tccom010 fields will have second record. I never really code something like so this is just for example. I do as set with, but usually to get the last record(or first) for a given set of criteria.

pralash 5th October 2017 08:42

Thanks for your reply....

But I want to read the record one by one from the source table and also need to store it some another table. So can you please tell me how to read the record one by one without mentioned any condition in where clause until the end of record is reached...
Thanks...
Pralash

rahul ingale 6th October 2017 23:34

Hello Pralash,

In Baan Sql,limit and offset function are not there while writing Sql query.
so if you want read record and also offset some record like in query you offset in 1 record.you can do this like below

select tdpur400.orno
from tdpur400
selectdo
|it will loop all record in table
| select other table
select tdpur401.orno,tdpur401.pono
from tdpur401
selectdo
endselect
selecteos
|end of search after looping all record this section will executed.
endselect
use as set with n rows to limit recordset.
offsetting the recordset can be done in selectdo section.but no direct function available.

pralash 8th October 2017 17:46

Thanks a lot for your information.... I'll try to the task by using the set with no row option...
Regards,
Pralash


All times are GMT +2. The time now is 15:56.


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