Sorting for the procedure is not working

can you help why the sorting is not working here.I am running the below procedure to sort asc and desc and when I do sort in descending order by a different column it gives me a different rows sorted in desc order. what i
want the proecdure to do it to sort the recordset in asc and desc order without changing the selected rows
SQL>  exec trnsportitems.gettrnsportitems(1,10,'itemnumber desc', :n, :c);
PL/SQL procedure successfully completed.
SQL> print c;
ITEMNUMBER              R IDESCR                                   IDESCRL                                                      IUNI IS I ITEM
2011.601/00002          1 TUNNEL CONSTRUCTION LAYOUT STAKING       TUNNEL CONSTRUCTION LAYOUT STAKING                           LS   0
2011.601/00003          2 CONSTRUCTION SURVEYING                   CONSTRUCTION SURVEYING                                       LS   05 N 2011601/00003
2011.601/00010          3 VIBRATION MONITORING                     VIBRATION MONITORING                                         LS   05 N 2011601/00010
2011.601/00020          4 REVISED BRIDGE PLANS                     REVISED BRIDGE PLANS                                         LS   05 N 2011601/00020
2011.601/00040          5 DESIGN                                   DESIGN                                                       LS   05 N 2011601/00040
2011.601/00050          6 DESIGN AND CONSTRUCT                     DESIGN AND CONSTRUCT                                         LS   05 N 2011601/00050
2011.601/08010          7 SUPPLEMENTAL DESCRIPTION                 SUPPLEMENTAL DESCRIPTION                                     LS   05 N 2011601/08010
2011.601/08011          8 SUPPLEMENTAL DESCRIPTION                 SUPPLEMENTAL DESCRIPTION                                     LS   05 N 2011601/08011
2011.601/08012          9 SUPPLEMENTAL DESCRIPTION                 SUPPLEMENTAL DESCRIPTION                                     LS   05 N 2011601/08012
2011.601/08013         10 SUPPLEMENTAL DESCRIPTION                 SUPPLEMENTAL DESCRIPTION                                     LS   05 N 2011601
10 rows selected.
SQL>
SQL>  exec trnsportitems.gettrnsportitems(1,10,'idescr DESC', :n, :c);
PL/SQL procedure successfully completed.
SQL> print c;
ITEMNUMBER              R IDESCR                                   IDESCRL                                                      IUNI IS I ITEM
2563.613/00040          1 YELLOW TUBE DELINEATORS                  YELLOW TUBE DELINEATORS                                      UDAY 05 N 2563613/00040
2563.602/00100          2 YELLOW TUBE DELINEATOR                   YELLOW TUBE DELINEATOR                                       EACH 05 N 2563602/00100
2565.602/00940          3 YELLOW LED INDICATION                    YELLOW LED INDICATION                                        EACH 05 N 2565602/00940
2502.602/00040          4 YARD DRAIN                               YARD DRAIN                                                   EACH 05 N 2502602/00040
2411.601/00030          5 WYE STRUCTURE                            WYE STRUCTURE                                                LS   05 N 2411601/00030
2557.603/00041          6 WOVEN WIRE FENCE                         WOVEN WIRE FENCE                                             L F  05 N 2557603/00041
2557.603/00043          7 WOVEN WIRE                               WOVEN WIRE                                                   L F  05 N 2557603/00043
2563.613/00615          8 WORK ZONE SPEED LIMIT SIGN               WORK ZONE SPEED LIMIT SIGN                                   UDAY 05 N 2563613/00
2563.613/00610          9 WORK ZONE SPEED LIMIT                    WORK ZONE SPEED LIMIT                                        UDAY 05 N 2563613/00610
2557.603/00035         10 WOODEN FENCE                             WOODEN FENCE                                                 L F  05 N 2557603/00035
10 rows selected.

Hi,
user13258760 wrote:
can you help why the sorting is not working here.I am running the below procedure to sort asc and desc and when I do sort in descending order by a different column it gives me a different rows sorted in desc order. what i
want the proecdure to do it to sort the recordset in asc and desc order without changing the selected rowsAs it is written now, the argument insortexp has nothing to do with the order of the rows. It is used only in computing column r, and column r is used only in the WHERE clause.
Are you really saying you don't want a WHERE clause at all in the main query: that you always want the cursor to contain all rows from itemlist that meet the 3 hard-coded conditions:
...                     WHERE item  '2999509/00001'     -- Did you mean != here?
                          AND iobselet = 'N'
                          AND ispecyr = '05'?
If so, change the main query WHERE clause:
WHERE r BETWEEN instartrowindex AND inendrowindexinto an ORDER BY clause:
ORDER BY  rBy the way, you might want to make insortexp case-insensitive.
In your example, you're calling the procedure with all small letters in insortexp:
user13258760 wrote:
SQL> exec trnsportitems.gettrnsportitems(1,10,'itemnumber desc', :n, :c);but the output is coming in ASC ending order:
...                           ORDER BY
                                 DECODE (insortexp, 'itemnumber ASC', item) ASC,
                                 DECODE (insortexp, 'itemnumber DESC', item) DESC,     -- capital 'DESC' won't match small 'desc'
                                 DECODE (insortexp, 'idescr ASC', idescr) ASC,
                                 DECODE (insortexp, 'idescr DESC', idescr) DESC,
                                 DECODE (insortexp, 'idescrl ASC', idescrl) ASC,
                                 DECODE (insortexp, 'idescrl DESC', idescrl) DESC,
                                 DECODE (insortexp, 'iunits ASC', iunits) ASC,
                                 DECODE (insortexp, 'iunits DESC', iunits) DESC,
                                 DECODE (insortexp, 'ispecyr ASC', ispecyr) ASC,
                                 DECODE (insortexp, 'ispecyr DESC', ispecyr) DESc,
                               SUBSTR (item, 1, 4) || '.' || SUBSTR (item, 5)          -- This is the only non-NULL ORDER BY expression     Why not declare a local variable:
sortexp      VARCHAR2 (20) := LOWER (insortexp);and use that variable instead of the raw argument in the query:
...                              DECODE (sortexp, 'itemnumber asc',  item) ASC,
                                 DECODE (sortexp, 'itemnumber desc', item) DESC, ...Also, this site doesn't like to display the <> operator, even inside \ tags.  When posting here, always use the other inequality operator, !=
Edited by: Frank Kulash on Jun 15, 2010 3:25 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • What can I do for the following situation: I think my insert slot for the headphones does not work; when I put in any cable that should and can go in all I hear is low frequent static sounds.

    What can I do for the following situation: I think my insert slot for the headphones does not work; when I put in any cable that should and can go in all I hear is low frequent static sounds.

    You might try talking to the Apple store manager and see if you don't get more help...you might also contact Apple.com/support and see if they can give you a contact with the Apple Italy offices.
    Sounds like you have two levels of failure, the first shop that did the repair and broke a wire, and the second that has disabled something else and isn't helping.
    Apple officially refurbished equipment is usually good quality.  Surprising this has happened but you need to press on with complaints and try for resolution.

  • HT201436 Hello, my name is brad and I recently had a voicemail app that I was using and now i got rid of it. But now my voicemail for the phone will not work. I tried to reset the network settings and nothing happened. I was wondering if you could help me

    Hello, my name is brad and I recently had a voicemail app that I was using and now i got rid of it. But now my voicemail for the phone will not work. I tried to reset the network settings and nothing happened. I was wondering if you could help me out?

    When you set up a voicemail redirection, usually you have to remove that redirection from the account that redirected it.  Like Google Voice, if you activate Google Voice to receive your voicemail, you will have to log into voice.google.com to turn it off.  If you contact your carrier, they can tell you exactly what program has taken over your voicemail functionality just in case you are stuck, but if you know the name of that App, I'm sure you will be able to figure it out.  Hope this helps you out.

  • Downloaded drivers for the MS6570 do not WORK - HELP!

    Hello,
    I have a fresh install of Windows XP on the MS6570. I've also downloaded the drivers for the mother board from: http://www.msi.com.tw/program/support/dr...pt_dvr_list.php  
    and from:
    http://ftp://download.nvidia.com/Windows/nForce/5.10/nForce_5.10_WinXP2K_WHQL_english.exe
    Unfortunitly, everytime I run the setup program from the downloads, it begin the install process but than immediatly turns off the install, never beginning and finishing the install process. No error messages or anything. I've also just installed SP1 for Win XP from a CD I have thinking this may needed to be installed first, but still had no luck. I truely am thinking the driver downloads for the ms6570 are bad.
    Does anyone know of a way that MSI can put working drivers for the ms6570 so they can be downloaded or does anyone know of another site or can provid an FTP to working drivers?? I'm extremely desperate.
    I appreciate any info.

    I appreciate everyone's reply....
    Here is what I have done.
    I have installed a NIC on my PC, because my on board ethernet will not detect under Windows. I've also went and downloaded SP2 from Microsoft and installed that with all other critical updates. I downloaded the latest version of direct x 9.0c, and the the ms6570 diver's setup to run under win 2000.
    Still the results are the same as described above. The driver software downloaded will not run the complete install process. I've than tried to get Windows to detect and update any hardware drives that it can find from the internet and the only driver it found was for the sound card which now works.
    I appear to be with the same problem as originally described, and still feel that the drivers may be corrupted that are offered for download. Again.. I'd be happy to pay for a copy if anyone would be willing to burn me an original driver CD. I know the original driver CD does work as this is what I loaded the drivers for my motherboard in the past with.
    Thanks for any help again.

  • Approver for the application role not working out

    Hi,
    I have created a role with type application and Approver A, then created a business role with the Approver B and included application role into the business role.
    When i assign this business role to a user the only request for approval goes to Approver B and after approval the both application and business roles are assigned. Strangely it seem to skip the Approver A. I did even remove the approver in business role, leaving only approver in application role, still same result - it skips Approver A.
    I'm using IDM 8.0.0.1, any ideas why it would skip the approver in the included role?
    Thanks!

    Thanks for the quick reply. I've tried optional with approval and here is what I found.
    It seems I need a combination of the two. My end goal is to have a second level approval, one group would be responsible for approving the business role and the system owners would be responsible for approving the nested application roles. When a user requests the business role, they must have approvals for the business role and all of the nested application roles for their request to be completed.
    If the app. roles are required, the workflow automatically incorporate the nested appl. roles in the request but does not require approval for them. If they are conditional with approval, the user would have to submit a second request to get all of the nested application roles. It looks like I need a combination of the two, required with approval.
    I need it to behave like it does when you have a role with approver that includes resources with an approver. The role and resources must all be approved before the request can be completed successfully.
    I'm trying to see if this is possible through the GUI before I customize the workflow.

  • Queries based on Master data for the particular periods not working

    Hi,
    My Queries are based on master data and for 2007 we did not have customer groups define hence for the historical also we would like to display the customer groups hence we are reproting based on master data. But when iam executing my reprots for each and every month for the 2007 , i can able to execute the reprot properly but same when iam giving the values in ranges with the help of input filed ( calender month -interval) its taking hours but unable to retrieve the data for the 6 months at a time even if iam restricting the values in the queries still the problem is same...
    Can anyone has an idea what would be the problem .. its only for 6 months
    Thanks

    Hi
    Master data report consumes much time. try to see the Query Statistics  and make the performance tuning.
    Recheck your data flow for routines at TRules/upRules level.
    Recheck on the Query designer for formula/ Cmod Variables.
    The report fetching time even depends on the NO.of records too.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d06dcd70-41a8-2b10-9f8f-dc5c68769753
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6009e125-e9a3-2a10-c6a9-e1483dfa2e1b
    Hope ithelps

  • Sound for the cd player not working

    I've just about worn out my resources on this one.
    The OS is 98, the motherboard is msi 648 max, I downloaded the sound drivers loaded them onto the computer.  Sound works on everything except the cd player
    I checked the regedit, and everything seems normal there.  I even uninstalled the drivers and reinstalled them, uninstalled and reinstalled the cd player, I even downloaded and put on directX 8
    am I missing something and before anyone can mention yes I checked for conflicts, nothing is too obvious.
    and I can't change the IRQ mainly because the sound card is onboard the motherboard

    theres no analog cable between the mobo and cd rom
     dont need it expand the drive in device manager and tick the box for digital out
    ummmmmmmmmmmmmm where exactely is the check for that? I can't find it

  • TS1702 How i can get the refund for the apps that not working.

    I bought apps name "Mobile Admin".  It's not working and I try to check on their web site it not avalible anymore.  www.appmobile.biz

    Send an email to iTunes support asking if they will refund your purchase.

  • Is there any fix for the flashplayer installer not working on a windows 7, 64-bit, using firefox?

    I Hit the download link, get the permission windows, and the flashplayer installer window comes up, but doesn't do anything. i left it up all day when i went to work, come home 12 hours later and it was still just sitting there not installing. Is there a fix for this? i have looked everywhere and nothing that i have found has worked. even the suggestions on the adobe help page doesn't work..

    And you used the offline installers from the link that Andy posted:
    Flash Player for Internet Exporer - ActiveX
    Flash Player for Firefox - NPAPI
    If yes, please post the contents of the FlashInstall.log file in C:\Windows\system32\Macromed\Flash

  • I cannot use the scroll, cannot change tabs, autocomplete for the URLs does not work

    cannot use scroll, cannot change tabs, cannot use autocomplete in the URL tab. this was working
    == This happened ==
    A few times a week

    Do you have that problem when running in the Firefox SafeMode?
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • I can not connect to my Time Capsule, rescaning for the device does not work.

    I used extra Len Cable to connect to my MacBook but still it can not find the Time Capsule.
    What are my other options to try reconect the Time Capsule again?

    Hard reset did the trick.
    I was able to finally see my Time Capsule after few minutes.

  • Incoming email for the "Document" folder not working... it's stuck in the Drop folder, please help...

    Looks like everything set up correctly...but SharePoint won't pick up the emails in the drop folder... any ideas? Thanks a lot!
    Log Name:      Microsoft-SharePoint Products-Shared/Operational
    Source:        Microsoft-SharePoint Products-SharePoint Foundation
    Date:          2/4/2015 10:20:42 PM
    Event ID:      6871
    Task Category: E-Mail
    Level:         Information
    Keywords:      
    User:          Domain\*****
    Computer:      SP2013-Appserver.Domain.com
    Description:
    The Incoming E-Mail service has completed a batch.  The elapsed time was 00:00:00.1562499.  The service processed 5 message(s) in total.
    Errors occurred processing 5 message(s):
    Message ID:
    Message ID:
    Message ID:
    Message ID:
    Message ID:
    Thank you!

    Yep, you have the Nov CU. This is a bug with no resolution as of yet, that I'm aware of. I spoke with another
    SharePoint MVP who indicated that
    flushing the Config Cache resolved it in a scenario he saw it in.
    I can't reproduce the bug in my lab environment.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • I bought the Keynote app for my MacBook, but when I open the application and try to install it, I get an error message saying that the application will not work with my MacBook. What gives? And, can I please request a refund? ($19.99 = a week's groceries)

    I bought the Keynote app for my MacBook, but when I open the application and try to install it, I get an error message saying that the application will not work with my MacBook. What gives? And, can I please request a refund? ($19.99 = a week's groceries).
    Thank you for your help! - I did try looking for all available specs about Keynote on the Apple iTunes website, and found nothing that could help me. HELP!

    1
    Close all iWork applications
    2
    Uninstall Keynote; this must be done with an application remover tool to delete the installation properly. Appcleaner is known to work correctly for this purpose, it is free and can be downloaded from here: Appcleaner Download
    3
    empty the trash
    4
    shutdown the Mac and restart. After the start up chime, hold down the shift key until the apple logo appears
    let the Mac complete the start up procedure completely, it will take longer than usual as the hard drive is being repaired
    5
    Reinstall Keynote by logging into the Mac App Store using download / install

  • My dvd slot for imac10,1 does not work. It rejects the disc. Problem after reinstall of backup from hdd.

    My dvd slot for imac10,1 does not work. I had a new harddrive installed in November and the MacStore installed my backups from an external harddrive. I do not use it other than to upload programs, so I have not tried using it until tax season, but it rejects the disc. The ata file indicates no dvd firmware, but the serial-ata does indicate firmware for a dvdrw. What might I do about this to bring the dvd back, least expensive to most?

    Yesterday I started having the same problem. Can read disc (play movies and music) but blank disk are ejected or idvd cannot see the blank disk. I have a almost 12 month old 27" i7 imac.

  • Is there a way to see on my iPhone my entire library (more than 2.000 CDs) without having all the files stored? I've noticed that, for mistake, I had some songs of my library in grey (the mp3 was not working)

    Is there a way to see on my iPhone my entire library (more than 2.000 CDs) without having all the files stored? I've noticed that, for mistake, I had some songs of my library in grey (the mp3 was not working)

    Is there a way to see on my iPhone my entire library (more than 2.000 CDs) without having all the files stored? I've noticed that, for mistake, I had some songs of my library in grey (the mp3 was not working)

Maybe you are looking for

  • Error  while assigning resultset value to Querytable variable in Coldfusion 10

    We are upgrading from coldfusion 8 to 10. Internally we were using java function to to get the data. In java function we have a resultset object, if we assign this resultset value to Querytable variable, we are getting below error. This code was work

  • Is it possible to import simulink blocks into labview

    Hi, I was wondering if it is possible to import the MATLAB/simulink blocks into labview.  thanks, Baran.

  • Libuimotif error when running report on HP-UX

    Hello, I got the following error messages on a HP-UX 11.0 console monitor when I tried to run a report through web using Report server 6i on HP-UX: /usr/lib/dld.sl: Unresolved symbol: xmGrabShellWidgetclass (data) from /u/oracle/Report6i/6iserver/lib

  • Palm OS: Invalid constant pool entry - What's that?

    Hello, I'm a newbie in developing application 4 my palm. (midp4palm 1.0 installed) I started with a "hello world"... everything went fine on my tungsten t3 emulator. Label + TextField. Then I wrote a little calculator... and now I get the following m

  • HR  ABAP BAPI_EMPLCOMM_GETDETAIL

    For FM Function module              BAPI_EMPLCOMM_GETDETAIL                          Import parameters               Value                                                                                EMPLOYEENUMBER                   00000012