Is there any logical flaw in this query?

DB version:10gR2
Do you see any logical flaw, room for improvement in this query
SELECT SHIP_QRY.RCVD_SHPMT_NBR, SHIP_QRY.ORIG_SHPMT_NBR, SHIP_QRY.DC_ORD_NBR, SHIP_QRY.WORK_ORD_NBR, SHIP_QRY.MFG_PLNT, SHIP_QRY.CONS_CASE_PRTY, SHIP_QRY.CONS_PRTY_DATE, SHIP_QRY.CONS_SEQ, SHIP_QRY.MFG_DATE, SHIP_QRY.RCVD_DATE, SHIP_QRY.XPIRE_DATE, SHIP_QRY.SHIP_BY_DATE, SHIP_QRY.PROC_IMMD_NEEDS, SHIP_QRY.VOL, SHIP_QRY.EST_WT, SHIP_QRY.ACTL_WT, SHIP_QRY.CASE_SIZE_TYPE, SHIP_QRY.PKG_NBR, SHIP_QRY.PKG_TYPE, SHIP_QRY.PO_NBR, SHIP_QRY.SHIP_VIA, SHIP_QRY.TRLR_NBR, SHIP_QRY.STAT_ID, SHIP_QRY.STAT_DATE_TIME, SHIP_QRY.VENDOR_CNTR_NBR, SHIP_QRY.PHYS_ENTITY_CODE, SHIP_QRY.PLT_ID, SHIP_QRY.TIER_QTY, SHIP_QRY.SNGL_pdt_CASE, SHIP_QRY.PUTWY_TYPE, SHIP_QRY.OUT_OF_ZONE_INDIC, SHIP_QRY.LAST_FROZN_DATE_TIME, SHIP_QRY.LAST_CNT_DATE_TIME, SHIP_QRY.SPL_INSTR_CODE_1, SHIP_QRY.SPL_INSTR_CODE_2, SHIP_QRY.SPL_INSTR_CODE_3, SHIP_QRY.SPL_INSTR_CODE_4, SHIP_QRY.SPL_INSTR_CODE_5, SHIP_QRY.MOD_DATE, SHIP_QRY.MOD_DATE_TIME, SHIP_QRY.USER_ID, SHIP_QRY.RETN_DISP_CODE, SHIP_QRY.FINAL_DISP_CODE, SHIP_QRY.INCUB_DATE, SHIP_QRY.SUPP_FTZ_CASE, SHIP_QRY.RCPT_IN_PROC_FLAG, SHIP_QRY.CD_MASTER_ID, SHIP_QRY.VENDOR_MASTER_ID, SHIP_QRY.VOCO_INTRNL_REVERSE_ID, SHIP_QRY.VOCO_INTRNL_REVERSE_PLT_ID, SHIP_QRY.CASE_NBR, SHIP_QRY.ship, SHIP_QRY.LOCN_ID, SHIP_QRY.PREV_LOCN_ID, SHIP_QRY.DEST_LOCN_ID FROM SHIP_QRY WHERE ( SHIP_QRY.CASE_NBR = :1 ) FOR UPDATE WAIT :"SYS_B_0"
Edited by: user10583227 on Jan 13, 2009 7:05 PM

How do you expect from us to find your logical flaw when we don't have any idea about your intention?
Please post the details with some sample input data and your required output data along with brief explanation.
Got me?
Regards.
Satyaki De.

Similar Messages

  • Is there any way to tune this query? EXPLAIN PLAN included

    DB version:10gR2
    The below query was taking more than 3 seconds. The statistics are up to date for these tables. Is there any other way i could tune this query?
    SELECT COUNT(1)
    FROM
    INVN_SCOPE_DTL, ship_dtl WHERE ship_dtl.WHSE = INVN_SCOPE_DTL.WHSE (+)
    AND 'QC' = INVN_SCOPE_DTL.FROM_WORK_GRP (+)
    AND  'MQN' = INVN_SCOPE_DTL.FROM_WORK_AREA (+)
    AND  ship_dtl.START_CURR_WORK_GRP = INVN_SCOPE_DTL.TO_WORK_GRP (+)
    AND  ship_dtl.START_CURR_WORK_AREA = INVN_SCOPE_DTL.TO_WORK_AREA (+)
    AND  ship_dtl.WHSE = '930' AND  ship_dtl.OWNER_USER_ID = 'CTZDM'
    OR ship_dtl.OWNER_USER_ID = '*'
    AND ship_dtl.STAT_CODE >= '10'
    AND ship_dtl.STAT_CODE <= '20'
    ORDER BY ship_dtl.OWNER_USER_ID DESC,
    ship_dtl.CURR_TASK_PRTY ASC, INVN_SCOPE_DTL.DISTANCE ASC, ship_dtl.RLS_DATE_TIME ASC, ship_dtl.TASK_ID ASC;
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation                      |  Name               | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT               |                     |     1 |    86 |    86   (2)|
    |   1 |  SORT AGGREGATE                |                     |     1 |    86 |            |
    |   2 |   NESTED LOOPS OUTER           |                     |   898 | 77228 |    86   (2)|
    |   3 |    INLIST ITERATOR             |                     |       |       |            |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| ship_dtl            |   898 | 31430 |    85   (2)|
    |*  5 |      INDEX RANGE SCAN          | ship_dtl_IND_4      |  2876 |       |     1   (0)|
    |   6 |    TABLE ACCESS BY INDEX ROWID | INVN_SCOPE_DTL     |     1 |    51 |     2  (50)|
    PLAN_TABLE_OUTPUT
    |*  7 |     INDEX UNIQUE SCAN          | PK_INVN_SCOPE_DTL  |     1 |       |            |
    Predicate Information (identified by operation id):
       4 - filter("ship_dtl"."WHSE"='930' AND "ship_dtl"."STAT_CODE">=10 AND
                  "ship_dtl"."STAT_CODE"<=20)
       5 - access("ship_dtl"."OWNER_USER_ID"='*' OR "ship_dtl"."OWNER_USER_ID"='CTZDM')
       7 - access("INVN_SCOPE_DTL"."WHSE"(+)='930' AND
                  "INVN_SCOPE_DTL"."FROM_WORK_GRP"(+)='QC' AND "INVN_SCOPE_DTL"."FROM_WORK_AREA"(+)='MQN'
    PLAN_TABLE_OUTPUT
                  AND "ship_dtl"."START_CURR_WORK_GRP"="INVN_SCOPE_DTL"."TO_WORK_GRP"(+) AND
                  "ship_dtl"."START_CURR_WORK_AREA"="INVN_SCOPE_DTL"."TO_WORK_AREA"(+))
           filter("ship_dtl"."WHSE"="INVN_SCOPE_DTL"."WHSE"(+))
    25 rows selected.

    William Robertson wrote:
    I notice an OR predicate in the middle of some AND predicates without explicit bracketing. Are you sure it does what you think it does?I underline this point.
    A conjuction (AND expression) has a higher priority and will be executed (logically) before the disjunction (OR expression)! So your select looks like this
    SELECT COUNT(1)
    FROM INVN_SCOPE_DTL, ship_dtl
    WHERE
          ( ship_dtl.WHSE = INVN_SCOPE_DTL.WHSE (+)
          AND 'QC' = INVN_SCOPE_DTL.FROM_WORK_GRP (+)
          AND  'MQN' = INVN_SCOPE_DTL.FROM_WORK_AREA (+)
          AND  ship_dtl.START_CURR_WORK_GRP = INVN_SCOPE_DTL.TO_WORK_GRP (+)
          AND  ship_dtl.START_CURR_WORK_AREA = INVN_SCOPE_DTL.TO_WORK_AREA (+)
          AND  ship_dtl.WHSE = '930'
          AND  ship_dtl.OWNER_USER_ID = 'CTZDM'
    OR   ( ship_dtl.OWNER_USER_ID = '*'
          AND ship_dtl.STAT_CODE >= '10'
          AND ship_dtl.STAT_CODE <= '20'
    ;This might be want you want, but I doubt it very much. Please add parenthesis', to get it working the way it should be.
    Edited by: Sven W. on Oct 16, 2008 3:25 PM

  • Is there any way to rewrite this query?

    Is there room for improvement/rewrite for this query so that it performs well?
    select distinct shp_locn
      from shp_mstr
    where zone = to_char(:b3)
       and locn_class = 'r'
       and aisle = 'GX-08'
       and dock =  'KN'
       and locn_id not in (select locn_id from tmp_shp_out_dtl)
    order by shp_locn

    user659394 wrote:
    Alex,
    Stop your st_u_pi_d f_u_c__king sarcasm. There were lots of instances like the below thread
    where you bring your boring sarcasm to meaningful technical discussions.
    If you dont want to answer, just leave it..... you C__u__n__t
    Error for a SELECT COUNT ... in stored proc
    Alex was giving you perfectly valid assistance.
    Your post has now been reported to the moderators as it is completely offensive, unprofessional and unnecessary.

  • Thunderbird puts a new message at the end of the thread. Is there any way of changing this preference to listing new message at top of the thread?

    Thunderbird puts a new message at the end of the thread.
    Is there any way of changing this preference so that new messages are displayed at the top of the thread.
    This is is more logical. You need to see new message in thread directly, rather than scanning to end of thread to see what is there.

    No it is not possible. The newest message is attached to the message it is in reply to.
    The conversations add-on might better suit your needs. see https://addons.mozilla.org/thunderbird/addon/gmail-conversation-view/?src=ss

  • Concerning: VGA monitors using an Aluminum Powerbook G4 PowerPC 2004 15"-screen 1.5Ghz  The DVI (converted to VGA) video output stopped working on this computer after 9 years of service. This raises question 1:  Is there any way of fixing this? I've tried

    Concerning: VGA monitors using an Aluminum Powerbook G4 PowerPC 2004 15"-screen 1.5Ghz
    The DVI (converted to VGA) video output stopped working on this computer after 9 years of service. This raises question 1:
    Is there any way of fixing this? I've tried the usual: triple checked all vga cables & devices through trial & error. Bought a new DVI-VGA adapter. Reset PRAM, PMU, etc. Nothing works. Something is probably damaged, because my KVM switch was not working unless I hot-reseated the vga cable into it, leading to this DVI port, and that is pretty rough stuff.
    Question 2 (related):
    This dovetails into this: Can I drive a VGA monitor with the s-video output port on this computer. It would take an s-video (male)-to-15-pin-VGA adapter. Has anyone does this? So far, I haven't even found the adapter mentioned anywhere.
    Thanks for reading this.
    el7

    Thanks for the useful feedback, Knucklesmac. I agree. I must have blown something on the logic board -- because I had a faulty old KVM switch that would not switch between computers without some nasty hot-plugging/unplugging the VGA video cables. (wince!). It's like when Dizzy Dean ruined his arm because a line drive hit him in the foot and he readjusted his mechanics around the injury. I take the blame because this has been a great computer, and does not deserve any blame.
    If it will help anyone else reading this thread, C2G (née Cables to Go) has some interesting ideas for still getting external video out of this computer:
    -USB-to-VGA
    http://www.cablestogo.com/product/30545
    -Convert s-video or composite video signals to high resolution VGA
    http://www.cablestogo.com/product/40971
    The price range is $75-$85, which doesn't make horse sense to me for such an old computer -- which has a lot of life in it anyway, because its own 15" monitor is not chopped liver.
    el7

  • Is there any way to get the query used in discoverer from backend??

    Hi All,
    I am new to dicoverer.
    Is there any way to get the query used in discoverer from backend??
    Thanks,
    Sachin

    Hi,
    you can view the SQL from within the discoverer menu:
    in desktop: View-> SQL Inspector
    in Plus: Tools-> Show SQL
    The SQL in the DB tables is encrypted so it's a problem getting it from there.
    You can export the workbook into SQL but it is not working for every worksheet (subquery, inline pivot tables...)
    you can create a batch file to export them all using the output of this script:
    select null,null,'echo off'
    from dual
    union all
    select distinct
    qs.qs_doc_name Workbook_name,
    qs.qs_doc_details Worksheet_Name,
    'start /wait <path>\dis51usr.exe /connect '||'&p_user_name'||'/'||'&p_password'||'@'||'&p_env'||' /apps_user /apps_responsibility "&responsibility" /opendb '||
    chr(34)||qs.qs_doc_name||chr(34)||' /sheet "'||qs.qs_doc_details||'"'||' /export SQL "C:\Export Discoverer SQL\'||qs.qs_doc_name||'-'||qs.qs_doc_details||'.sql" /batch'
    from eul_us.eul5_qpp_stats qs
    where qs.qs_doc_name is not null
    --order by 1,2
    union all
    select null,null,'echo off'
    from dual
    union all
    select null,null,'exit'
    from dual

  • When I attempt to open a PDF file I saved from a website, I get the message "There was an error opening this document. The file is damaged and could not be repaired." Is there any way to correct this problem?

    When I attempt to open a PDF file I saved from a website using Safari, I get the message "There was an error opening this document. The file is damaged and could not be repaired." When I save the same PDF file using FireFox it opens up immediately. Is there any way to correct this problem with Safari?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • When I try to print a drawing imported from my ipad iphoto crops it. Is there any way to stop this?

    When I try to print a drawing imported from my ipad iphoto crops it. Is there any way to stop this?

    Usual cause: printing at the wrong aspect ratio for the image - trying to print 5 x 3 in the shape of a 6 x 4 for instance.
    Regards
    TD

  • I'm trying to add a playlist manually to my iPhone 4. It won't let me because it's trying to delete all of the music currently on my iPhone. Is there any way to prevent this from happening in order to start manually updating it?

    I'm trying to add a playlist manually to my iPhone 4. It won't let me because it's trying to delete all of the music currently on my iPhone. Is there any way to prevent this from happening in order to start manually updating it?

    Are you leaving the box unchecked to Manually manage music & videos? You don't need to to add anything to the iPhone.
    Simply drag the playlist to the iPhone to manually add it.

  • When I listen to music on my iPhone and pause it, if I come back to it later, the playlist has started over. I have a 4S running on iOS 7.0.4. Is there any way to keep this from happening so that my playlist will start off where I last was?

    When I listen to music on my iPhone and pause it, if I come back to it later, the playlist has started over. I have a 4S running on iOS 7.0.4. Is there any way to keep this from happening so that my playlist will start off where I last was?

    Dear Jody..jone5
    Good for you that can't update your iphone because I did it and my iphone dosen't work for example I can't download any app like Wecaht or Twitter..
    Goodluck
    Atousa

  • I bought my iphone 5s a week before and now its volume "up" button is not working when pressed.Does anybody know what to do to make it work?I have a one year warranty.Should i give it to apple retail shop or is there any way to solve this problem?

    I bought my iphone 5s a week before and now its volume "up" button is not working when pressed.Does anybody know what to do to make it work?I have a one year warranty.Should i give it to apple retail shop or is there any way to solve this problem?

    IF it is a manufacturing defect and you bought the device from Apple or an authorized Apple retailer, then take it into Apple.

  • HT1386 i am trying to restore a backup og my iphone 4 from itunes on my macbook, it asks me for a password which i do not recall setting up, is there any way of getting this password.

    i am trying to restore a backup og my iphone 4 from itunes on my macbook, it asks me for a password which i do not recall setting up, is there any way of getting this password.

    No there's not.  Otherwise that wouldn't be very secure, would it?

  • Don't have money for new tech or headphones. I want to watch a movie from my laptop via AirPlay (watch a movie straight from Apple TV), but hear the sound on my headphones attached to my MB Air.  Is there any way to do this??

    I don't have money for new tech or headphones. I want to watch a movie from my laptop via AirPlay (watch a movie straight from Apple TV), but hear the sound on my headphones attached to my MB Air.
    Is there any way to do this??
    http://superuser.com/questions/853821/watch-a-movie-straight-from-apple-tv-but-h ear-the-sound-on-my-headphones-on-my

    Thanks for your help.  Since I'm uninterested in loading all my photos (the only option) into photostream, I won't be able to use the settings in ATV.  I guess I'm just stuck with using iPhoto on my MB Air.  Thanks again.
    paul

  • Hi at the moment my ipod is on manual sync mode. Is there any way of changing this to auto-sync without losing the music on my ipod or library? Possibly more importantly is there a way I can transfer the ratings from my ipod onto my i-tunes?

    Hi at the moment my ipod is on manual sync mode. Is there any way of changing this to auto-sync without losing the music on my ipod or library? Possibly more importantly is there a way I can transfer the ratings from my ipod onto my i-tunes?
    This is so I can delete music from my ipod knowing its rated on my i-tunes so I can then see later if I want to re-add it based on its rating
    Thanks

    Is there any way of changing this to auto-sync without losing the music on my ipod or library?
    Unfortunately there is not.
    Possibly more importantly is there a way I can transfer the ratings from my ipod onto my i-tunes?
    Not without the help of third party software such as this one:
    http://www.copytrans.net/copytrans.php
    B-rock

  • Is there any way to create this image in photoshop?

    Is there any way to create this image in photoshop?  ,Any help would be appreciated?

    What JJMack said. An example I pulled in less than 5 minutes:
    All I did was inserted a text layer with that same inside color and a stroke layer style with that same outside color (about 3 or 4 pixels; outside position). Font used was Calibri Regular.

Maybe you are looking for

  • Adobe Reader XI installation issue

    I have installed Adobe Reader XI on my iMac but cannot find an icon anywhere to launch it. When I try to read a pdf I get a pop-up stating: Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User License Agre

  • CO integration for student accounting

    Hi All We are currently thinking about intensifying our costing related to programms of studies and are setting up different options how to track corresponding fees and eventually costs in our CO module. I've learned in last years IHE 203 with Marlie

  • Best way to query extended events file in sql server 2012

    Hello all, is there any best way to xquery extended events async file i am having hard time sorting  out data in GUI and using xquery. Any help highly appreciated. thanks, ashwin.

  • Problem with preceding zeros

    Hi i have a problem with table entries. I have one table with name 'z*' having fields of vbeln ,date, plant. when i try to display the records it displays all the vbeln records. In that some of them are having vbeln with preceding zeros like 00090507

  • DEV and Sandbox

    Cud anyone please explain the functions and uses of Development and Sandbox systems in the implementation of BW implemenation.. If u have any documents pls mail to [email protected] Thanks alot