?
Solved

How to get the next record available?

Posted on 2014-11-12
4
Medium Priority
?
139 Views
Last Modified: 2014-11-13
Hi,

On my page I have the applicationID passed and based on it the page information is loading.

<cfif isDefined("url.AppID")>
	<cfset AID = #url.AppID#>
<cfelse>
	<cfset AID = 1>
</cfif>

Open in new window


I have created two buttons for the next record and previous record

<input type="button" name="PreviousBtn" value="Previous">
<input type="button" name="NextBtn" value="   Next   ">

Open in new window


I just want to know how in SQL can get the next record based on the applicationID that is passed

exp:
AppID
7
55
58
60
61
62
70


so, if the url.AppID passed is 58 then when the user click on next I should take the user to record 60


here is the SQL that I need help with:

<cfquery name="AppInformation" datasource="#dsn#" username="#dbID#" password="#dbPassword#">

SELECT ApplicationID
FROM AppRepository
where ApplicationID = #AID# plus "the next record available" 

</cfquery>

Open in new window

0
Comment
Question by:lulu50
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
Philip Pinnell earned 2000 total points
ID: 40437638
SELECT top 1 ApplicationID
FROM AppRepository
where ApplicationID > #AID#
order by ApplicationID
0
 
LVL 32

Expert Comment

by:awking00
ID: 40437960
select min(ApplicationID)
from AppRepository
where ApplicationID > #AID#
0
 

Author Closing Comment

by:lulu50
ID: 40440024
Thank you
0
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 40440195
Thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question