milosev.com
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home

Limit aka Paging

Details
Written by: Stanko Milosev
Category: MS SQL
Published: 15 August 2008
Last Updated: 01 March 2013
Hits: 6511

Question is how to show limited number of records on one page, like MySQL limit?

There is query which you can use like:

select * from (
  select top 10 emp_id,lname,fname from (
    select top 30 emp_id,lname,fname
    from employee
    order by lname asc) as newtbl order by lname desc
  ) as newtbl2 order by lname asc

Taken from here.

But I don't like that approach because with complicated queries things can be more complicated.

I rather took something like this:

WITH Ordered AS(
  SELECT ROW_NUMBER() 
  OVER (ORDER BY OrderID) AS RowNumber, 
    OrderID, OrderDate FROM Orders
  ) 

  SELECT * FROM Ordered WHERE RowNumber between 21 and 30 

Taken from here. It works only in MS SQL Server 2005 and above.

Unfortunately, WITH approach I couldn't use on dhtmlx.

---

With MS SQL Server 2012, we have new keyword offset fetch:

SELECT * FROM myTable 
  order by keyWord 
  offset 0 rows fetch next 5 rows only

and here is example with conditional order:

declare @myCol int = 0; 
SELECT *   FROM myTable   
order by 
case @myCol 
  when 0 then 0 
end 
offset 25000000 rows  fetch next 5 rows only GO

from here

Delphi 2009.

Details
Written by: Stanko Milosev
Category: IBM WebSphere MQ
Published: 01 September 2010
Last Updated: 30 November -0001
Hits: 7117

My MQIC.pas for Delphi 2009 you can download from here. File you will find in the rar.

Reason code:2102 - MQRC_RESOURCE_PROBLEM

Details
Written by: Stanko Milosev
Category: IBM WebSphere MQ
Published: 27 October 2008
Last Updated: 27 October 2008
Hits: 14511

If you are receiving error Reason code:2102 - MQRC_RESOURCE_PROBLEM, then try following:

Increase Log -> Log primary files and Log -> Log secondary files, to 20, for example,
Increase Extended -> Error log size.

Idea taken from here.

Transaction.

Details
Written by: Stanko Milosev
Category: IBM WebSphere MQ
Published: 24 October 2008
Last Updated: 12 December 2009
Hits: 6933

There are two posibillity to start transaction:

1. MQBegin - Queue-manager-coordinated global unit of work
2. MQPMO_SYNCPOINT - Queue-manager-coordinated local unit of work

MQBegin is trivial, so I will not explain it.

For MQPMO_SYNCPOINT you have to do something like

GetMsgOptions.Options:=GetMsgOptions.Options + MQPMO_SYNCPOINT;

Where GetMsgOptions you use like:

MQGET ( Hconn, Hobj, @MsgDesc, @GetMsgOptions, BufferLength, @Buffer^, @DataLength, @intCompcode, @intReason);

In both cases you will use MQCMIT, and MQBACK to commit or reverse transaction back.

Taken from here.

  1. Browse messages.
  2. The MQSC commands
  3. Finding locations that are within a certain radius distance
  4. Windows 7.

Subcategories

C#

Azure

ASP.NET

JavaScript

Software Development Philosophy

MS SQL

IBM WebSphere MQ

MySQL

Joomla

Delphi

PHP

Windows

Life

Lazarus

Downloads

Android

CSS

Chrome

HTML

Linux

Eclipse

Page 82 of 168

  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86