|
|
Choosing A Webhost: |
Can I create a generic stored procedure to sort any column passed as input : msg#00183db.maxdb
Hi, I have been trying to write a generic stored procedure to sort any column number passed as input parameter to the stored procedure. I have to think of this, because there are total 10 columns in the table and we want sorting on each column. We can write separate stored procedure for each column to sort on, but that is a huge work and not the good solution. Hence I tried to write a generic stored procedure. But somehow this is not working and though it compiles properly. But when I try to call it, I get the general error. One thing I would like to point out that we dont want to move this to programming task and want to do everything at the db layer side, so that performance of the system wont affect. Can anybody let me know whether it is possible to write a generic stored procedure to sort any column passed as input parameter???? If yes, please let me know. If not, is there any other way of doing all this???? Well here is the code of that generic stored procedure. CREATE DBPROC SORTCOLUMN(IN COLUMNNO INT) RETURNS CURSOR AS $CURSOR = 'ReturnCursor'; DECLARE $CURSOR CURSOR FOR SELECT JOBS.JOBID, JOBS.JOBNO, JOBS.FOLDERNAME, JOBS.STARTTIME FROM PMP_OWNER.JOBS ORDER BY :columnNo; --------------------------------- Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: AW: Store strings in UTF-8/UNICODE format, Hermann Himmelbauer |
|---|---|
| Next by Date: | RE: Error 4008 while connecting by ADO/ODBC, Koetter, Thomas Theodor |
| Previous by Thread: | AW: Store strings in UTF-8/UNICODE format, Zabach, Elke |
| Next by Thread: | AW: Can I create a generic stored procedure to sort any column pa ssed as input parameter???, Anhaus, Thomas |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|