Hi Friends,
I have to create paging using oracle stored procedure for a c#.net application.I have to develop this application without using cursor. I tried following procedure but its giving 1 error as subquery returns more than 1 row. please help me to solve this table.
Table name :customers
Fields:CompanyName,ContactName,ContactTitle,Phone, Fax
CREATE OR REPLACE PROCEDURE temp_page1
(CurrentPage in integer,
PageSize in integer,
TotalRecords out integer)
is
FirstRec NUMBER;
LastRec NUMBER;
p_CompanyName nvarchar2(40);
p_ContactName nvarchar2(30);
p_ContactTitle nvarchar2(30);
p_Phone nvarchar2(24);
p_Fax nvarchar2(24);
BEGIN
FirstRec := (CurrentPage - 1) * PageSize;
LastRec := (CurrentPage * PageSize + 1);
select CompanyName,ContactName,ContactTitle,Phone,Fax
into
p_CompanyName,
p_ContactName,
p_ContactTitle,
p_Phone,
p_Fax
from customers
where (select rownum from customers) between FirstRec AND LastRec
group by CompanyName,ContactName,ContactTitle,Phone,Fax;
SELECT count(*) into TotalRecords from Customers;
END;
/
2 6034
i got the problem
what you are getting is as per the code you have written
but can you pass on few more details .
please specify what is the use of the procedure, what are you going to do with this , do you expect only one out put from the query.
i got the problem
what you are getting is as per the code you have written
but can you pass on few more details .
please specify what is the use of the procedure, what are you going to do with this , do you expect only one out put from the query.
Hi,
I am creating an asp.net application. In this application i want to arrange data in multiple pages.User should be able to change number of records per page.For this i am using oracle as the backend and i am going to call this procedure in my frontend i.e. c#.net..
I expect all records means multiple rows should select from the database..
Sign in to post your reply or Sign up for a free account.
Similar topics
by: sam |
last post by:
I'm trying to develop a stored procedure for a Crystal reports.
Here's the stored procedure. The SP uses the following package for
the REF CURSOR.
CREATE OR REPLACE PACKAGE J1R_TYPES AS
TYPE...
|
by: aychai |
last post by:
Hi all,
I am trying to make use Oracle9i db to call an external .Net Web
Service from a JAva Stored Procedure.
I created the .Net Web Service and use JDeveloper 9.0.3.4Build(1247)
to create...
|
by: Jim Garrison |
last post by:
I need to create a ResultSet in an Oracle Java Stored Procedure and
return it to a PL/SQL caller. I've done quite a bit of research in
Oracle's manuals and on the Web, and have found lots of...
|
by: Chandra Mohan |
last post by:
Hi,
We need help on following things,
1. Inputs on creating comments on the columns & Tables of a SQL
Database & generating the sql script of that.
2. Is it possible to call a .exe file in...
|
by: serge |
last post by:
I can not create a stored procedure that calls another not yet created
stored procedure?
In MS SQL I get a warning that the calling procedure does not exist but the
new stored
Procedure gets...
|
by: Magy |
last post by:
What would be the best way to execute a Oracle stored procedure that excepts
several input paramters, through a web method in vb.net. What would be a
good way to get to the web method, the Oracle...
|
by: Greg Lyles |
last post by:
Hi all,
I'm trying to develop an ASP.NET 2.0 website and am running into some
real problems with what I thought would be a relatively simple thing
to do.
In a nutshell, I'm stuck on trying to...
|
by: jenipriya |
last post by:
Tables
------------
Employee (EmpID, EmpName,DeptID DateOfJoin, Sal, Addr)
Finance (EmpID, Sal)
Club (Clubname, EmpID, Fee, DateOfJoin)
Leave (EmpID, Date)
Department (DeptID, DeptName,...
|
by: andrewkl |
last post by:
hi,
I have the following Perl code that inserts a string to an Oracle DB via a stored procedure:
#!/usr/local/bin/perl ## Perl v5.8.6 built for sun4-solaris
use strict;
BEGIN...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |