Same sql statement two different results?

Hi,
I was wondering if anyone knows why I am getting different
results on the same query.
Basically... when I run this query in "view" in sql server, I
get the results I need, however when I run in Coldfusion, I am
getting totally different results.... It is a totally different
result...
the query:
SELECT DISTINCT
tbl_employees.indexid, tbl_employees.[Employee ID] as
employeeid, tbl_employees.[First Name] as firstname,
tbl_employees.[Last Name] as lastname,
tbl_employees.[Supervisor ID] as supervisorid,
tbl_workaddress_userdata.firstname,
tbl_workaddress_userdata.lastname,
tbl_workaddress_userdata.supervisorid,
tbl_workaddress_userdata.location,
tbl_workaddress_userdata.employeeid,
tbl_workaddress_userdata.locationdescription
FROM tbl_employees FULL OUTER JOIN
tbl_workaddress_userdata ON tbl_employees.[Employee ID] =
tbl_workaddress_userdata.employeeid
WHERE (tbl_employees.[Supervisor ID] = 7) AND
(tbl_workaddress_userdata.location IS NULL)

I suspect you and your CF DSN are looking at two different
DBs...
Adam

Similar Messages

  • Same calculation producing two differing results

    Hi All
    I have some code in a user exit on save of a delivery (VL02N) that calculates the number of bags/pallets required to furnish that delivery.
    I am now adding the same code to a user exit on save a sales order (VA02) to calculate the number of bags/pallets again but when run it is producing differing results.
    the code is as follows:
    DATA: bag_weight(12) TYPE p DECIMALS 4.
    DATA: pallet_weight TYPE marm-umrez.
    DATA: bag_denominator TYPE i.
    bag_weight = pallet_weight / bag_denominator.
    Assuming pallet_weight = 1000 and bag_denominator = 40.
    On save of a delivery it is calculating bag_weight as 25.0000 (correct):
    On save of a sales order it is calculating bag_weight as 0.0025 (incoorect).
    All data declaration, code etc is the same. Does anybody have any clue as to why it would give two differing answers, I would not like to have to add a additional multiplication step to correct the result otherwise.
    Thanks in advance
    David

    Hi,
    Whenever you are using the Packed numbers, you need to check or set the program attribute fixed point arithmetic only as only this ensure that the decimal point is calculated correctly.
    Have a look at the help.sap.com documentation link:
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
    Hope this helps.
    Thanks,
    Samantak.

  • Execute the same query twice, get two different results

    I have a query that returns two different results:
    Oracle Version : 10.2.0.1.0
    I am running the following query on the Oracle server in SQL*Plus Worksheet.
    SELECT COUNT(*)
    FROM AEJOURNAL_S1
    WHERE CHAR_TIME BETWEEN TO_DATE('12-AUG-10 01:17:39 PM','DD-MON-YY HH:MI:SS AM') AND
    TO_DATE('13-AUG-10 14:17:34','DD-MON-YY HH24:MI:SS')
    AND DESC2 LIKE '%'
    AND DESC1 LIKE '%'
    AND DESC2 LIKE '%'
    AND ETYPE LIKE '%'
    AND MODULE LIKE '%'
    AND LEVELL = '11-WARNING'
    ORDER BY ORDD DESC;
    The very first time the query is run, it will return a count of 259. The next time the query is run, lets say, 10 seconds later, it will return a count of 260. The above query is exemplary of the kind of thing I'm trying to do. It seems like the more fields filtered against '%', the more random the count return becomes. Sometime you have to execute the query three or four times before it levels out to a consistent number.
    I'm using '%' as the default for various fields, because this was the easiest thing to do to support a data-driven Web interface. Maybe I have to 'dynamically' build the entire where clause, instead of just parameterizing the elements and having default '%'. Anyway, to eliminate the web interface for the purpose of troubleshooting the above query was run directly on the Oracle server.
    This query runs against a view. The view does a transpose of data from a table.
    Below is the view AEJOURNAL_S1
    SELECT
    CHAR_TIME,
    CHAR_INST,
    BATCH_ID,
    MIN(DECODE(CHAR_ID,6543,CHAR_VALUE)) AS ORDD,
    MIN(DECODE(CHAR_ID,6528,CHAR_VALUE)) AS AREAA,
    MIN(DECODE(CHAR_ID,6529,CHAR_VALUE)) AS ATT,
    COALESCE(MIN(DECODE(CHAR_ID,6534,CHAR_VALUE)),'N/A') AS CATAGORY,
    MIN(DECODE(CHAR_ID,6535,CHAR_VALUE)) AS DESC1,
    MIN(DECODE(CHAR_ID,6536,CHAR_VALUE)) AS DESC2,
    MIN(DECODE(CHAR_ID,6537,CHAR_VALUE)) AS ETYPE,
    MIN(DECODE(CHAR_ID,6538,CHAR_VALUE)) AS LEVELL,
    MIN(DECODE(CHAR_ID,6539,CHAR_VALUE)) AS MODULE,
    MIN(DECODE(CHAR_ID,6540,CHAR_VALUE)) AS MODULE_DESCRIPTION,
    MIN(DECODE(CHAR_ID,6541,CHAR_VALUE)) AS NODE,
    MIN(DECODE(CHAR_ID,6542,CHAR_VALUE)) AS STATE,
    MIN(DECODE(CHAR_ID,6533,CHAR_VALUE)) AS UNIT
    FROM CHAR_BATCH_DATA
    WHERE subbatch_id = 1774
    GROUP BY CHAR_TIME, CHAR_INST, BATCH_ID
    So... why does the query omit rows on the first execution? Is this some sort of optimizer issue. Do I need to rebuild indexes? I looked at the indexes, they are all valid.
    Thanks for looking,
    Dan

    user2188367 wrote:
    I have a query that returns two different results:
    Oracle Version : 10.2.0.1.0
    I am running the following query on the Oracle server in SQL*Plus Worksheet.
    SELECT COUNT(*)
    FROM AEJOURNAL_S1
    WHERE CHAR_TIME BETWEEN TO_DATE('12-AUG-10 01:17:39 PM','DD-MON-YY HH:MI:SS AM') AND
    TO_DATE('13-AUG-10 14:17:34','DD-MON-YY HH24:MI:SS')
    AND DESC2 LIKE '%'
    AND DESC1 LIKE '%'
    AND DESC2 LIKE '%'
    AND ETYPE LIKE '%'
    AND MODULE LIKE '%'
    AND LEVELL = '11-WARNING'
    ORDER BY ORDD DESC;
    The very first time the query is run, it will return a count of 259. The next time the query is run, lets say, 10 seconds later, it will return a count of 260. The above query is exemplary of the kind of thing I'm trying to do. It seems like the more fields filtered against '%', the more random the count return becomes. Sometime you have to execute the query three or four times before it levels out to a consistent number.
    I'm using '%' as the default for various fields, because this was the easiest thing to do to support a data-driven Web interface. Maybe I have to 'dynamically' build the entire where clause, instead of just parameterizing the elements and having default '%'. Anyway, to eliminate the web interface for the purpose of troubleshooting the above query was run directly on the Oracle server.
    This query runs against a view. The view does a transpose of data from a table.
    Below is the view AEJOURNAL_S1
    SELECT
    CHAR_TIME,
    CHAR_INST,
    BATCH_ID,
    MIN(DECODE(CHAR_ID,6543,CHAR_VALUE)) AS ORDD,
    MIN(DECODE(CHAR_ID,6528,CHAR_VALUE)) AS AREAA,
    MIN(DECODE(CHAR_ID,6529,CHAR_VALUE)) AS ATT,
    COALESCE(MIN(DECODE(CHAR_ID,6534,CHAR_VALUE)),'N/A') AS CATAGORY,
    MIN(DECODE(CHAR_ID,6535,CHAR_VALUE)) AS DESC1,
    MIN(DECODE(CHAR_ID,6536,CHAR_VALUE)) AS DESC2,
    MIN(DECODE(CHAR_ID,6537,CHAR_VALUE)) AS ETYPE,
    MIN(DECODE(CHAR_ID,6538,CHAR_VALUE)) AS LEVELL,
    MIN(DECODE(CHAR_ID,6539,CHAR_VALUE)) AS MODULE,
    MIN(DECODE(CHAR_ID,6540,CHAR_VALUE)) AS MODULE_DESCRIPTION,
    MIN(DECODE(CHAR_ID,6541,CHAR_VALUE)) AS NODE,
    MIN(DECODE(CHAR_ID,6542,CHAR_VALUE)) AS STATE,
    MIN(DECODE(CHAR_ID,6533,CHAR_VALUE)) AS UNIT
    FROM CHAR_BATCH_DATA
    WHERE subbatch_id = 1774
    GROUP BY CHAR_TIME, CHAR_INST, BATCH_ID
    So... why does the query omit rows on the first execution? Is this some sort of optimizer issue. Do I need to rebuild indexes? I looked at the indexes, they are all valid.
    Thanks for looking,
    DanIn fact you the first time you ran the query the data has been retrived from disk to memory , in the second time the data is already in memory so the respnse time should be faster ,but if you chagne any condition or column or letter case the optimizer will do the first step (data will be retrived from disk to memory )

  • Why do I get two different results from the same coefficients?

    I am getting two different results from the Polynomial Evaluation function.
    For the first one, I am getting the coefficients from a Polynomial Fit function.  I feed the coefficients from the Fit function into the Poly Eval function and get the correct result of 12.8582 when I evaluate 49940.
    For the second one, I create constant array of the SAME values that were returned from the Polynomial Fit function (i typed them in).  However, I am getting an incorrect result of -120.7913 when I feed the constant array into the Poly Eval function when I evauate 49940.
    How can this happen when I am using the same array values?
    Attached is an image of what I am explaining.
    Solved!
    Go to Solution.
    Attachments:
    polynomial_evaluation.jpg ‏213 KB

    Hi Altran,
    are you sure about using the "same" coefficients?
    Did you compare them? Did you (atleast) set the display properties to 17 significant digits?
    Please attach a VI instead of a picture...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Will a sequence return same value for two different sessions?

    Is there a possibility that a sequence will return same value to two different sessions when it is referred exactly at the same instance of time?

    @Justin... Thanks for your insight; indeed, we too feel this shouldn't ever happen and never heard of it either, but there it is. (No, we haven't logged a TAR yet -- whatever that is -- partly because it didn't occur to us and partly because we only recently came across the issue and sensibly want to do some testing before we cry foul.)
    However, the code is pretty straight-forward, much like this (inside a FOR EACH ROW trigger body):
    SELECT <seqname>.NEXTVAL INTO <keyvar> FROM DUAL;
    INSERT INTO <tblname> (<keyfield>, <... some other fields>)
    VALUES(<keyvar>, <... some other values> );
    (where <tblname> is NOT the table on which the trigger is fired). This is the only place where the sequence is ever accessed. The sequence state is way below its limits (either MAXVALUE or <keyfield>/<keyvar> datatype size).
    In this setup, end users sometimes got an out-of-the-blue SQL error to the effect that uniqueness constraint has been violated -- as I said, we used to have a unique index on <keyfield> -- which leads us to assume that the sequence generated a duplicate key (only way for the constraint to be violated, AFAIK). We released the constraint and indeed, using a simple SELECT <keyfield>, COUNT(*) FROM <tblname> GROUP BY <keyfield> HAVING COUNT(*)>1 got us some results.
    Unfortunately, the <tblname> table gets regularly purged by a consumer process so it's hard to trace; now we created a logger trigger, on <tblname> this time, which tracks cases of duplicate <keyfield> inserts... We'll see how it goes.
    @Laurent... winks at the CYCLE thing Our sequence is (needless to say) declared as NOCYCLE and the datatype is large enough to hold MAXVALUE.

  • SQL Statement taking different path on 2 servers

    I ran the same SQL statement on two servers (8.1.7.3).
    One is taking the index path and returns results quickly but the second server, which is our production server, is going about a very different path and timing out on the query. I ran the explain plan and see the differences.
    How can I identify the cause to behave differently?
    Can you suggest some ideas and steps that I can further
    investigate?
    Thanks, Moling

    1. The statistics are run nightly on all tables.
    exec sys.dbms_stats.gather_schema_stats ...
    2. What causes BITMAP CONVERSION (TO ROWIDS)and
    BITMAP CONVERSION (From ROWIDS) that I see for table
    U_SUPPLIER_PART_PLANT_MAP? This table has DOMAIN index.
    FAST QUERY
    ==============
    i p PLAN_PLUS_EXP OBJECT_N
    0 SELECT STATEMENT optimizer=FIRST_ROWS (cost=123 card=1 bytes
    =884)
    1 0 NESTED LOOPS (cost=123 card=1 bytes=884)
    2 1 NESTED LOOPS (OUTER) (cost=122 card=1 bytes=877)
    3 2 NESTED LOOPS (OUTER) (cost=121 card=1 bytes=861)
    4 3 NESTED LOOPS (cost=120 card=1 bytes=856)
    5 4 NESTED LOOPS (cost=119 card=2 bytes=1658)
    6 5 NESTED LOOPS (OUTER) (cost=118 card=3 bytes=2472
    7 6 NESTED LOOPS (cost=117 card=3 bytes=2448)
    8 7 NESTED LOOPS (cost=116 card=3 bytes=1506)
    9 8 NESTED LOOPS (OUTER) (cost=115 card=3 byte
    s=1284)
    10 9 NESTED LOOPS (OUTER) (cost=114 card=3 by
    tes=1260)
    11 10 NESTED LOOPS (cost=113 card=3 bytes=12
    39)
    12 11 NESTED LOOPS (OUTER) (cost=112 card=
    3 bytes=1161)
    13 12 NESTED LOOPS (OUTER) (cost=111 car
    d=3 bytes=1137)
    14 13 NESTED LOOPS (OUTER) (cost=110 c
    ard=3 bytes=1113)
    15 14 NESTED LOOPS (cost=109 card=3
    bytes=1089)
    16 15 NESTED LOOPS (cost=101 card=
    87 bytes=30798)
    17 16 TABLE ACCESS (BY INDEX ROW
    ID) of 'U_SUPPLIER_PART_PLANT_MAP' (cost=99 card=87 bytes=30
    363)
    18 17 DOMAIN INDEX of 'CTX_100
    26328' (cost=88)
    19 16 INDEX (UNIQUE SCAN) of 'UK
    USITE1' UNIQUE)
    20 15 TABLE ACCESS (BY INDEX ROWID
    ) of 'U_ORGANIZATION_DIMENSION' (cost=1 card=1 bytes=9)
    21 20 INDEX (UNIQUE SCAN) of 'UK
    UORGANIZATION_DIMENSION' UNIQUE)
    22 14 TABLE ACCESS (BY INDEX ROWID)
    of 'SPM_MATERIAL_GROUP' (cost=1 card=120 bytes=960)
    23 22 INDEX (UNIQUE SCAN) of 'UK_S
    PM_MATERIAL_GROUP' UNIQUE)
    24 13 TABLE ACCESS (BY INDEX ROWID) of
    'U_PURCHASING_GROUP' (cost=1 card=269 bytes=2152)
    25 24 INDEX (UNIQUE SCAN) of 'UK_U_P
    URCHASING_GROUP' UNIQUE)
    26 12 TABLE ACCESS (BY INDEX ROWID) of '
    SPM_UOM' (cost=1 card=428 bytes=3424)
    27 26 INDEX (UNIQUE SCAN) of 'UK_SPM_U
    OM' UNIQUE)
    28 11 TABLE ACCESS (BY INDEX ROWID) of 'SP
    M_SUPP_PART' (cost=1 card=423258 bytes=11004708)
    29 28 INDEX (UNIQUE SCAN) of 'SYS_C00192
    66' UNIQUE)
    30 10 TABLE ACCESS (BY INDEX ROWID) of 'SPM_
    CURRENCY' (cost=1 card=1 bytes=7)
    31 30 INDEX (UNIQUE SCAN) of 'UK_SPM_CURRE
    NCY' UNIQUE)
    32 9 TABLE ACCESS (BY INDEX ROWID) of 'SPM_UO
    M' (cost=1 card=428 bytes=3424)
    33 32 INDEX (UNIQUE SCAN) of 'UK_SPM_UOM' UN
    IQUE)
    34 8 TABLE ACCESS (BY INDEX ROWID) of 'SPM_REFE
    RENCE_ITEM1' (cost=1 card=385224 bytes=28506576)
    35 34 INDEX (UNIQUE SCAN) of 'UK_SPM_REFERENCE
    _ITEM11' UNIQUE)
    36 7 TABLE ACCESS (BY INDEX ROWID) of 'SPD_MANUFA
    CTURER_PART' (cost=1 card=385175 bytes=120944950)
    37 36 INDEX (UNIQUE SCAN) of 'UK_SPD_MANUFACTURE
    R_PART' UNIQUE)
    38 6 TABLE ACCESS (BY INDEX ROWID) of 'SPM_UOM' (co
    st=1 card=428 bytes=3424)
    39 38 INDEX (UNIQUE SCAN) of 'UK_SPM_UOM' UNIQUE)
    40 5 INDEX (UNIQUE SCAN) of 'UK_U_SUPPLIER' UNIQUE)
    41 4 TABLE ACCESS (BY INDEX ROWID) of 'U_SUPPLIER_DIMEN
    SION' (cost=1 card=2 bytes=54)
    42 41 INDEX (UNIQUE SCAN) of 'UK_U_SUPPLIER_DIMENSION'
    UNIQUE)
    43 3 INDEX (UNIQUE SCAN) of 'UK_U_SUPPLIER' UNIQUE)
    44 2 TABLE ACCESS (BY INDEX ROWID) of 'U_SUPPLIER_DIMENSION
    ' (cost=1 card=8276 bytes=132416)
    45 44 INDEX (UNIQUE SCAN) of 'UK_U_SUPPLIER_DIMENSION' UNI
    QUE)
    46 1 TABLE ACCESS (BY INDEX ROWID) of 'S_ROT_CLASS' (cost=1 c
    ard=12943407 bytes=90603849)
    47 46 INDEX (UNIQUE SCAN) of 'UK_S_ROT_CLASS' UNIQUE)
    48 rows selected.
    SLOW QUERY
    ===========
    i p PLAN_PLUS_EXP OBJECT_N
    0 SELECT STATEMENT optimizer=FIRST_ROWS (cost=28278 card=52 by
    tes=49452)
    1 0 NESTED LOOPS (cost=28278 card=52 bytes=49452)
    2 1 NESTED LOOPS (OUTER) (cost=28273 card=52 bytes=48932)
    3 2 NESTED LOOPS (OUTER) (cost=28268 card=52 bytes=48412)
    4 3 NESTED LOOPS (OUTER) (cost=28263 card=52 bytes=47892
    5 4 NESTED LOOPS (cost=28257 card=52 bytes=47372)
    6 5 NESTED LOOPS (cost=28252 card=52 bytes=46800)
    7 6 NESTED LOOPS (cost=28251 card=52 bytes=46488)
    8 7 NESTED LOOPS (OUTER) (cost=305 card=70 bytes
    =37240)
    9 8 NESTED LOOPS (OUTER) (cost=298 card=70 byt
    es=36540)
    10 9 NESTED LOOPS (cost=291 card=70 bytes=359
    10)
    11 10 NESTED LOOPS (cost=285 card=64 bytes=3
    0784)
    12 11 NESTED LOOPS (OUTER) (cost=279 card=
    64 bytes=25792)
    13 12 NESTED LOOPS (OUTER) (cost=272 car
    d=64 bytes=24640)
    14 13 NESTED LOOPS (OUTER) (cost=271 c
    ard=64 bytes=24256)
    15 14 NESTED LOOPS (cost=265 card=64
    bytes=23616)
    16 15 NESTED LOOPS (cost=7 card=2
    bytes=72)
    17 16 TABLE ACCESS (FULL) of 'U_
    SUPPLIER_DIMENSION' (cost=6 card=2 bytes=60)
    18 16 INDEX (UNIQUE SCAN) of 'UK
    USUPPLIER' UNIQUE)
    19 15 TABLE ACCESS (BY INDEX ROWID
    ) of 'SPD_MANUFACTURER_PART' (cost=129 card=375810 bytes=125
    144730)
    20 19 INDEX (RANGE SCAN) of 'NIS
    _P649987' NON-UNIQUE)
    21 14 TABLE ACCESS (BY INDEX ROWID)
    of 'SPM_UOM' (cost=1 card=428 bytes=4280)
    22 21 INDEX (UNIQUE SCAN) of 'UK_S
    PM_UOM' UNIQUE)
    23 13 INDEX (UNIQUE SCAN) of 'UK_U_SUP
    PLIER' UNIQUE)
    24 12 TABLE ACCESS (BY INDEX ROWID) of '
    U_SUPPLIER_DIMENSION' (cost=1 card=8652 bytes=155736)
    25 24 INDEX (UNIQUE SCAN) of 'UK_U_SUP
    PLIER_DIMENSION' UNIQUE)
    26 11 TABLE ACCESS (BY INDEX ROWID) of 'SP
    M_REFERENCE_ITEM1' (cost=1 card=375842 bytes=29315676)
    27 26 INDEX (UNIQUE SCAN) of 'UK_SPM_REF
    ERENCE_ITEM11' UNIQUE)
    28 10 TABLE ACCESS (BY INDEX ROWID) of 'SPM_
    SUPP_PART' (cost=1 card=409148 bytes=13092736)
    29 28 INDEX (RANGE SCAN) of 'NIS_P651218'
    NON-UNIQUE)
    30 9 TABLE ACCESS (BY INDEX ROWID) of 'SPM_CU
    RRENCY' (cost=1 card=1 bytes=9)
    31 30 INDEX (UNIQUE SCAN) of 'UK_SPM_CURRENC
    Y' UNIQUE)
    32 8 TABLE ACCESS (BY INDEX ROWID) of 'SPM_UOM'
    (cost=1 card=428 bytes=4280)
    33 32 INDEX (UNIQUE SCAN) of 'UK_SPM_UOM' UNIQ
    UE)
    34 7 TABLE ACCESS (BY INDEX ROWID) of 'U_SUPPLIER
    PARTPLANT_MAP' (cost=28251 card=304053 bytes=110067186)
    35 34 BITMAP CONVERSION (TO ROWIDS)
    36 35 BITMAP AND
    37 36 BITMAP CONVERSION (FROM ROWIDS)
    38 37 INDEX (RANGE SCAN) of 'NIS_P651535'
    NON-UNIQUE) (cost=765)
    39 36 BITMAP CONVERSION (FROM ROWIDS)
    40 39 SORT (ORDER BY)
    41 40 DOMAIN INDEX of 'CTX_10026328' (co
    st=25098 card=304053)
    42 6 INDEX (UNIQUE SCAN) of 'UK_U_SITE1' UNIQUE)
    43 5 TABLE ACCESS (BY INDEX ROWID) of 'U_ORGANIZATION
    _DIMENSION' (cost=1 card=1 bytes=11)
    44 43 INDEX (UNIQUE SCAN) of 'UK_U_ORGANIZATION_DIME
    NSION' UNIQUE)
    45 4 TABLE ACCESS (BY INDEX ROWID) of 'SPM_MATERIAL_GRO
    UP' (cost=1 card=119 bytes=1190)
    46 45 INDEX (UNIQUE SCAN) of 'UK_SPM_MATERIAL_GROUP' U
    NIQUE)
    47 3 TABLE ACCESS (BY INDEX ROWID) of 'U_PURCHASING_GROUP
    ' (cost=1 card=269 bytes=2690)
    48 47 INDEX (UNIQUE SCAN) of 'UK_U_PURCHASING_GROUP' UNI
    QUE)
    49 2 TABLE ACCESS (BY INDEX ROWID) of 'SPM_UOM' (cost=1 car
    d=428 bytes=4280)
    50 49 INDEX (UNIQUE SCAN) of 'UK_SPM_UOM' UNIQUE)
    51 1 TABLE ACCESS (BY INDEX ROWID) of 'S_ROT_CLASS' (cost=1 c
    ard=13126048 bytes=131260480)
    52 51 INDEX (UNIQUE SCAN) of 'UK_S_ROT_CLASS' UNIQUE)
    53 rows selected.

  • Possible solution to avoid deadlock when two inserts happen on same table from two different machines.

    Possible solution to avoid deadlock when two inserts happen on same table from two different machines.
    Below are the details from deadlock trace.
    Deadlock encountered .... Printing deadlock information
    Wait-for graph
    NULL
    Node:1
    KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
    Grant List 2:
    Owner:0x00000013F494A980 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:376 ECID:0 XactLockInfo: 0x000000055014F400
    SPID: 376 ECID: 0 Statement Type: INSERT Line #: 70
    Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
    Requested by:
    ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
    NULL
    Node:2
    KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
    Grant List 2:
    Owner:0x0000000B3486A780 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:238 ECID:0 XactLockInfo: 0x0000002AA53383F0
    SPID: 238 ECID: 0 Statement Type: INSERT Line #: 70
    Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
    Requested by:
    ResType:LockOwner Stype:'OR'Xdes:0x000000055014F3C0 Mode: RangeI-N SPID:376 BatchID:0 ECID:0 TaskProxy:(0x000000080426E538) Value:0x30614e80 Cost:(0/41748)
    NULL
    Victim Resource Owner:
    ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
    deadlock-list
    deadlock victim=process5daddc8
    process-list
    process id=process5daddc8 taskpriority=0 logused=38828 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994026815 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.347 XDES=0x2aa53383b0 lockMode=RangeI-N schedulerid=43 kpid=14156 status=suspended spid=238 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.463 lastbatchcompleted=2014-07-25T12:46:57.463 clientapp=pa hostname=pa02 hostpid=1596 loginname=myuser isolationlevel=serializable (4) xactid=2994026815 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
    frame procname=mydb.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
    INSERT INTO [dbo].[Prod1] .....
    inputbuf
    Proc [Database Id = 8 Object Id = 89923542]
    process id=process5d84988 taskpriority=0 logused=41748 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994024748 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.320 XDES=0x55014f3c0 lockMode=RangeI-N schedulerid=39 kpid=14292 status=suspended spid=376 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.440 lastbatchcompleted=2014-07-25T12:46:57.440 clientapp=pa hostname=pa01 hostpid=1548 loginname=myuser isolationlevel=serializable (4) xactid=2994024748 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
    frame procname=pa.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
    INSERT INTO [dbo].[Prod1]....
    inputbuf
    Proc [Database Id = 8 Object Id = 89923542]
    resource-list
    keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
    owner-list
    owner id=process5d84988 mode=RangeS-S
    waiter-list
    waiter id=process5daddc8 mode=RangeI-N requestType=convert
    keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
    owner-list
    owner id=process5daddc8 mode=RangeS-S
    waiter-list
    waiter id=process5d84988 mode=RangeI-N requestType=convert

    Don't know. Perhaps these can help. I scanned the second link but didn't see much about Ending Deadlocks. I'd say the Fourth link probably has better information than the first three links. But maybe read them all just in case the Fourth is missing something
    one of the first three have.
    Deadlocking
    Detecting and Ending Deadlocks
    Minimizing Deadlocks
    Handling Deadlocks in SQL Server
    Google search for "SQL Deadlock"
    La vida loca

  • How to use same DFF for two different forms with :BLOCK.field reference

    Hi,
    Can anyone suggest how to use the same dff in two different forms by using :BLOCK.field reference.
    Scenario is the same DFF is referenced by two forms, viz. Form-1 & Form-2.
    Form-1 Reference Field is :BLOCK.field name, but the same block is not available in Form-2, which throws an error while opening it.
    Any pointers please.
    Thanks,

    In the environment I currently have access to do not have similar setup.
    Let say you setup the DFF1 default value to $HEADER.customer_name, the name of the DFF is CUSTOMER_NAME, description can be anything.
    In DFF2, default value should be a SQL, where you can reference the DFF1. For example, SELECT DECODE($FLEX.CUSTOMER_NAME, 'ABC', 1, 'DEF', 2, NULL) FROM dual
    In this case, you can reference the DFF1.

  • Multiple Executions Plans for the same SQL statement

    Dear experts,
    awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.
    Below is the awrsqrpt's output for your reference.
    WORKLOAD REPOSITORY SQL Report
    Snapshot Period Summary
    DB Name         DB Id    Instance     Inst Num Release     RAC Host
    TESTDB          2157605839 TESTDB1               1 10.2.0.3.0  YES testhost1
                  Snap Id      Snap Time      Sessions Curs/Sess
    Begin Snap:     32541 11-Oct-08 21:00:13       248     141.1
      End Snap:     32542 11-Oct-08 21:15:06       245     143.4
       Elapsed:               14.88 (mins)
       DB Time:               12.18 (mins)
    SQL Summary                            DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
                    Elapsed
       SQL Id      Time (ms)
    51szt7b736bmg     25,131
    Module: SQL*Plus
    UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL,
    0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE
    TEST_BATCH_DT = (:B1 )
    SQL ID: 51szt7b736bmg                  DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> 1st Capture and Last Capture Snap IDs
       refer to Snapshot IDs witin the snapshot range
    -> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC...
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    1   2960830398                 25,131             1         32542          32542
    2   3834848140                      0             0         32542          32542
    Plan 1(PHV: 2960830398)
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                            25,131       25,130.7     3.4
    CPU Time (ms)                                23,270       23,270.2     3.9
    Executions                                        1            N/A     N/A
    Buffer Gets                               2,626,166    2,626,166.0    14.6
    Disk Reads                                      305          305.0     0.3
    Parse Calls                                       1            1.0     0.0
    Rows                                        371,735      371,735.0     N/A
    User I/O Wait Time (ms)                         564            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                 26            N/A     N/A
    Execution Plan
    | Id  | Operation                    | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT             |                 |       |       |  1110 (100)|          |
    |   1 |  UPDATE                      | TEST            |       |       |            |          |
    |   2 |   TABLE ACCESS FULL          | TEST            |   116K|  2740K|  1110   (2)| 00:00:14 |
    |   3 |   TABLE ACCESS BY INDEX ROWID| ACCT            |     1 |    26 |     5   (0)| 00:00:01 |
    |   4 |    INDEX RANGE SCAN          | ACCT_DT_ACC_IDX |     1 |       |     4   (0)| 00:00:01 |
    Plan 2(PHV: 3834848140)
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                                 0            N/A     0.0
    CPU Time (ms)                                     0            N/A     0.0
    Executions                                        0            N/A     N/A
    Buffer Gets                                       0            N/A     0.0
    Disk Reads                                        0            N/A     0.0
    Parse Calls                                       0            N/A     0.0
    Rows                                              0            N/A     N/A
    User I/O Wait Time (ms)                           0            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                 26            N/A     N/A
    Execution Plan
    | Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT             |              |       |       |     2 (100)|          |
    |   1 |  UPDATE                      | TEST         |       |       |            |          |
    |   2 |   TABLE ACCESS BY INDEX ROWID| TEST         |     1 |    28 |     2   (0)| 00:00:01 |
    |   3 |    INDEX RANGE SCAN          | TEST_DT_IND  |     1 |       |     1   (0)| 00:00:01 |
    |   4 |   TABLE ACCESS BY INDEX ROWID| ACCT         |     1 |    26 |     4   (0)| 00:00:01 |
    |   5 |    INDEX RANGE SCAN          | INDX_ACCT_DT |     1 |       |     3   (0)| 00:00:01 |
    Full SQL Text
    SQL ID       SQL Text
    51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) +
                  NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB
                 RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )Your input is highly appreciated.
    Thanks for taking your time in answering my question.
    Regards

    Oracle Lover3 wrote:
    Dear experts,
    awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.If you're using bind variables and you've histograms on your columns which can be created by default in 10g due to the "SIZE AUTO" default "method_opt" parameter of DBMS_STATS.GATHER__STATS it is quite normal that you get different execution plans for the same SQL statement. Depending on the values passed when the statement is hard parsed (this feature is called "bind variable peeking" and enabled by default since 9i) an execution plan is determined and re-used for all further executions of the same "shared" SQL statement.
    If now your statement ages out of the shared pool or is invalidated due to some DDL or statistics gathering activity it will be re-parsed and again the values passed in that particular moment will determine the execution plan. If you have skewed data distribution and a histogram in place that reflects that skewness you might get different execution plans depending on the actual values used.
    Since this "flip-flop" behaviour can sometimes be counter-productive if you're unlucky and the values used to hard parse the statement leading to a plan that is unsuitable for the majority of values used afterwards, 11g introduced the "adaptive" cursor sharing that attempts to detect such a situation and can automatically re-evaluate the execution plan of the statement.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Same circuit twice with different results

    I've been having some trouble having Multisim match a circuit I have modeled in MATLAB. During the troubleshooting process I put voltage probes on each wire used. The circuit portion in question involves an AC Voltage source connected to a resistor which is then connected to an inductor. I made a copy of the circuit and started from scratch. One of the circuits gives a voltage drop across the resistor, while the other one doesn't drop any voltage at all. I've checked all of the connections and they are all good. The only difference I can see is that one has the pins labeled 1 - 2 while the other is 2 - 1. Does anyone know what the problem is here? I shouldn't not be getting two different results for the same circuit.

    Hi Jmerc,
    Maybe you can post the circuits so that we can compare.
    Tien P.
    National Instruments

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

  • How can i use the same id on two different laptops?

    When trying to use the same login on two different laptops so that i can connect my nook to either depending on which one is free, i get the error that the id is already in use on another computer?

    The issue is embedded in the way the software works.  To comply with the
    Digital Millenium Copyright Act of 2000, all software companies in this
    business keep track of where their software is installed, making
    information about the computer and ereaders part of an ID file.  So, your
    user ID is embedded in the ID file of each computer, but each computer has
    a different ID of its own that is also embedded in that file.  Adobe's
    master server (yes, there is one that you connect to even if you didn't
    know it) also has that information, and when you try to use an ID on one
    that's embedded in the file of another, Adobe's server blows the whistle,
    and as you can see, you can't do that....
    ==========

  • Use two indicators for the same variable in two different VIs

    hello, I want to use two indicators for the same variable in two different VIs running at the same time
    should I use global variables?? I want to avoid because I have lot of variables and it would takes too much memory,I tried with this code but the value of the second indicator is not updated 
    I tried to use the queue and it works but the problem is as i said previously that i have many variables shoud I use a queue for each one??
    what should I do?
    thank you in advance
    cordialy
    Attachments:
    projet.zip ‏13 KB

    CrisSTine01 wrote:
    hello, I want to use two indicators for the same variable in two different VIs running at the same time
    I'm a huge fan of User Events to send updates to GUIs from who knows where.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • HT4528 Can I put the same information on two different i-phones with different numbers and different ID's?

    Can I put the same information on two different i-phones with different numbers and different ID's?

    Yes and no it really depends on what information you are putting on the devices.

  • HT2498 If I use camera window to download my pictures to my computer, and then I copy and paste the pictures to iPhoto. Would I be ending up having the same pictures in two different files in my computer, and so wasting space in my hard drive?

    I recently bought a canon camera. The instructions of the camara recommend to use the canon software (camara window) to download pictures to my computer.  I would like to have my pictures in i-photo because it syncs them to my ipad.
    I want to download the pictures from my camera to camara window, and then drag and drop the pictures to i-photo. If I keep my pictures in both programs would I be wasting space in my computer hard drive by having the same pictures in two different files?

    Yes.
    Ignore the Canon software. It gains you nothing and adds complexity. Just use iPhoto for the lot.
    Regards
    TD

Maybe you are looking for