|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Ok, good, I am then relieved. IBM finally awoke from a deep slumber where their tunnel vision saw only Java and mainframe applications a couple of years ago. Now they are offering deep integration into the .NET development environment and embracing also open source. Linux, PHP, etc.
amazing... Anyway - that DB2 cookbook I referenced earlier is a pretty good quick ref fv
__________________
...because that is the way we have always done it. We've been doing it like that for 80 Years! (How do we change that mindset?) |
|
#17
|
|||
|
|||
|
Good! So how are the DB2 expolrations going so far?
Perhaps a little different syntax with some things such as limiting queries to X records or getting the last inserted ID and such... fv |
|
#18
|
||||
|
||||
|
Quote:
i.e. select * from some_schema.some_table fetch first 100 rows only This would return the first 100 rows from the resultset instead of the entire resultset. |
|
#19
|
|||
|
|||
|
Sure you can -
select colA , colB , colC , colD from mytable order by colB fetch first 100 rows only should do the trick. fv |
|
#20
|
||||
|
||||
|
fractalvibes, why are you posting an answer to a question you asked?!?
|
|
#21
|
|||
|
|||
|
I thought I was replying to your comment about limiting the resultset to x rows in whatever order....top down, etc.
[but you can't limit like in MySQL. With DB2, you can't fetch any number of records from the top down. ] fv |
|
#22
|
||||
|
||||
|
You can limit, but not like the full functionality of mysql.
MySQL allows you to pick a section out of the resultset that doesn't always start with the first row. i.e. select * from some_table limit 50, 10 That would pull out ten records from the resultset starting at row 50. Your response to my post included the very same thing I posted in the first place. i.e. the use of fetch first 100 rows only. Make any sense? |
|
#23
|
|||
|
|||
|
Ah, ok - had forgotten about that MySQL functionality...that would be tricksy in DB2.
fv |
|
#24
|
|||
|
|||
|
PhP MySQL, Linux to AS/400 DB2
hello everyone,
I need to know how to pull records dynamically from a DB2 database on an AS/400. Regarding this post by Onslaught You can limit, but not like the full functionality of mysql. MySQL allows you to pick a section out of the resultset that doesn't always start with the first row. i.e. select * from some_table limit 50, 10 That would pull out ten records from the resultset starting at row 50. Your response to my post included the very same thing I posted in the first place. i.e. the use of fetch first 100 rows only. ...ok so my question is how can i achive the same MySQL functionality in DB2? I am using PhP/Linux that is connecting to an AS/400 DB2 on our local network. I want to be able to limit records per page with resultssets starting with 10, 20, 30, 40 (10 per page) i.e. select * from some_table limit 50, 10 Thanks guys, Jj1377 |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > DB2: Book suggestions? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|