Problems using "decode"
What I'm trying to do is: For each employee list the value of all pending orders, the value of all completed orders and the value of all orders issued by the employee.
Using these tables:
Orders
Name
ORD_ID
SUPPLIER_ID
ISSUING_EMP_ID
ORDER_DATE
ORDER_STATUS
Sup_Pro
Name
S_ID
P_ID
CATALOG_NO
PRICE
Here is my query
select o.issuing_emp_id,
sum(decode(o.order_status, 'P', p.price, 0)) pending
sum(decode(o.order_status, 'C',p.price,0)) completed,
sum(decode(o.order_status, 'P + C', p.price,0)) all_orders
from
orders o,
sup_pro p
where o.supplier_id = p.s_id
group by o.issuing_emp_id;
The problem is with the line sum(decode(o.order_status, 'P + C', p.price,0)) all_orders. All it does is display 0, and doesn't actually add anything up. What am I doing wrong?
Edited by: user4555857 on 30-Nov-2009 13:59
select o.issuing_emp_id,
sum(decode(o.order_status, 'P', p.price, 0)) pending
sum(decode(o.order_status, 'C',p.price,0)) completed,
sum(decode(o.order_status, 'P', p.price,'C',p.price,0)) all_orders
from
orders o,
sup_pro p
where o.supplier_id = p.s_id
group by o.issuing_emp_id;max
Similar Messages
-
I have one table which stores candidates' response. The structure is like this
(Seatno, Questionnumber, Answer).
And I have another table Master as (Questionnumber, Answer)
Now I want to calculate marks by comparing Candidate's response with Master.
I tried to use decode and case. But was not successful.
My query with decode was ...
select c1.candidatesrno, sum(decode(c1.answer,(c1.answer=m1.answer),1,0))
from candidate c1,master q1
where c1.question=m1.question
group by c1.candidatesrno
And query with CASE was...
select c1.candidatesrno,
case when (c1.answer=m1.answer) then 1 else 0
end resultset
from candidate c1,master m1
where c1.questionnumber=m1.questionnumber
group by c1.candidatesrno
Can anybody help ?I want to compare candidate's response with master
table.
Now for each question of Candidate, if its answer
matches with answer in Master table I have to give 1
marks...if it does not match I have to give 0
marks...like this there are two-three conditions...
Something like this ?
test@ORA10G>
test@ORA10G> with master as (
2 select 'Q1' as question_num, 'A1' as answer_num from dual union all
3 select 'Q2', 'A2' from dual union all
4 select 'Q3', 'A3' from dual),
5 candidate_response as (
6 select 'S1' as seat_num, 'Q1' as question_num, 'A1' as answer_num from dual union all
7 select 'S1', 'Q2', 'A2' from dual union all
8 select 'S1', 'Q3', 'A3' from dual union all
9 select 'S2', 'Q1', 'A5' from dual union all
10 select 'S2', 'Q2', 'A6' from dual union all
11 select 'S2', 'Q3', 'A3' from dual)
12 --
13 select
14 cr.seat_num,
15 cr.question_num,
16 cr.answer_num,
17 case when m.question_num is null and m.answer_num is null then '0 point'
18 else '1 point'
19 end as points
20 from candidate_response cr, master m
21 where cr.question_num = m.question_num(+)
22 and cr.answer_num = m.answer_num(+)
23 order by cr.seat_num, cr.question_num, cr.answer_num;
SE QU AN POINTS
S1 Q1 A1 1 point
S1 Q2 A2 1 point
S1 Q3 A3 1 point
S2 Q1 A5 0 point
S2 Q2 A6 0 point
S2 Q3 A3 1 point
6 rows selected.
test@ORA10G>
test@ORA10G> with master as (
2 select 'Q1' as question_num, 'A1' as answer_num from dual union all
3 select 'Q2', 'A2' from dual union all
4 select 'Q3', 'A3' from dual),
5 candidate_response as (
6 select 'S1' as seat_num, 'Q1' as question_num, 'A1' as answer_num from dual union all
7 select 'S1', 'Q2', 'A2' from dual union all
8 select 'S1', 'Q3', 'A3' from dual union all
9 select 'S2', 'Q1', 'A5' from dual union all
10 select 'S2', 'Q2', 'A6' from dual union all
11 select 'S2', 'Q3', 'A3' from dual)
12 --
13 select cr.seat_num, count(*) as score
14 from candidate_response cr, master m
15 where cr.question_num = m.question_num
16 and cr.answer_num = m.answer_num
17 group by cr.seat_num
18 order by cr.seat_num;
SE SCORE
S1 3
S2 1
test@ORA10G>
test@ORA10G>pratz -
Problem using DECODE() function with a Query of Queries
I
posted
on my blog about an issue I was having trying to use the PL/SQL
DECODE() function with a Coldfusion Query of Queries. This function
works fine when you query a database for information. However, when
you query another query, it seems that CF doesn't recognize it. I
got errors stating that it found a left parenthesis where it
expected a FROM key word. Here is a simplified version of what I am
trying to do:
quote:
<!--- Simulated query; similar to what I was calling from
my database --->
<cfscript>
qOriginal = queryNew("Name,Email,CountryCode",
"VarChar,VarChar,VarChar");
newRow = queryAddRow(qOriginal, 5);
querySetCell(qOriginal, "Name", "Joe", 1);
querySetCell(qOriginal, "Email", "[email protected]", 1);
querySetCell(qOriginal, "CountryCode", "AMER", 1);
querySetCell(qOriginal, "Name", "Sally", 2);
querySetCell(qOriginal, "Email", "[email protected]", 2);
querySetCell(qOriginal, "CountryCode", "AMER", 2);
querySetCell(qOriginal, "Name", "Bob", 3);
querySetCell(qOriginal, "Email", "[email protected]", 3);
querySetCell(qOriginal, "CountryCode", "ASIA", 3);
querySetCell(qOriginal, "Name", "Mary", 4);
querySetCell(qOriginal, "Email", "[email protected]", 4);
querySetCell(qOriginal, "CountryCode", "EURO", 4);
querySetCell(qOriginal, "Name", "John", 5);
querySetCell(qOriginal, "Email", "[email protected]", 5);
querySetCell(qOriginal, "CountryCode", "EURO", 5);
</cfscript>
<cfquery name="qCountries" dbtype="query">
SELECT DISTINCT(CountryCode) AS CountryCode,
DECODE(states, "AMER", "North America & Canada",
"EURO", "Europe & Africa", "ASIA", "Japan &
Asia","") CountryName
FROM qOriginal
ORDER BY CountryCode
</cfquery>
<cfdump var="#qCountries#">
<!--- ========== END OF CODE ========== --->
So running this returned the following error:
Query Of Queries syntax error.
Encountered "(. Incorrect Select Statement, Expecting a
'FROM', but encountered '(' instead, A select statement should have
a 'FROM' construct.
Does anybody know why this doesn't work? Is it just not
supported? Please note that I have also tried to use the CASE()
function instead of DECODE() and that resulted in basically the
same error. For now I an looping over my distinct query with a
switch statement and manually loading a new query with the data how
I want it. But it would be a lot cleaner and less code to have the
DECODE() to work. Thx!DECODE() is an Oracle function, not generic SQL. Q-of-Q is a
very limited subset of SQL and lacks many functions and clauses
available in standard SQL, especially what you may be used to using
in your particular RDBMS.
See
Query
of Queries user guide
Phil -
I'm trying to decode the following, but I seem to be having a syntax issue:
decode
p.balls,p.strikes,
1,0 '1-0 Count',
2,0 '2-0 Count',
3,0 '3-0 Count',
0,1 '0-1 Count',
0,2 '0-2 Count',
1,1 '1-1 Count',
2,1 '2-1 Count',
3,1 '3-1 Count',
0,2 '0-2 Count',
1,2 '1-2 Count',
2,2 '2-2 Count',
) as Count,what I'm trying to have happen is anytime the balls column has a '1' and the strike column has a '0' to decode to '1-0 Count' etc...Decode compares the value of the first paramter with the values of the even parameters and returns the following odd parameters value when the first match is found. If the last parameter is an even numbered parameter it is taken as the default when no other matches are found.
So your code compares p.balls to p.strikes and if they match returns a 1 then it runs into a syntax error since you don't have any commas after the forth column.
If you want to perform a multicolumn compare in the manner you are showing you will need to use a CASE statement instead:
case when (p.balls, p.strikes) in ( (1, 0) ) then '1-0 Count'
when (p.balls, p.strikes) in ( (2, 0) ) then '2-0 Count'
when (p.balls, p.strikes) in ( (3, 0) ) then '3-0 Count'
when (p.balls, p.strikes) in ( (0, 1) ) then '0-1 Count'
when (p.balls, p.strikes) in ( (0, 2) ) then '0-2 Count'
end as "COUNT" -
Safari crashes or will not quit also the same problem using Yahoo Mail
Iv been having a problem using Safari & Yahoo Mail. When opening specific e-mails or opening attachments withing the e-mail, Safari will crash. Not once or twice, but 2, 3, 4 or more times. Each time I send in a report to Apple telling them what is happening. I do not have the same problem if I use "Camino" with Yahoo Mail.
I'm also having problems in that there are times when Safari seems to just be sitting there and not opening a page or will not quit when I hit the "Quit Safari" button. It will just sit there and if I bring up the "Force Quit Application" it shows that Safari is (not responding). Then I have to Force Quit Safari to get it to do something.
Know this is really 2 situations, but does it mean that Safari is corrupted? Is it possible to have to much in Safari? To many bookmarks, to many RSS, things like that? Does Safari have it's own max like your HD?Morning Maria,
Thanks for the help. I'll try to post the thing I found in the crash log, but it seems to be rather large. Checked and re-checked, but what I'm posting is the only thing that started or stopped like you said at the end. The entire thing runs for pages and pages. Remember I said that it's been an on going problem where Safari will crash 2,3,4 or more times in a 5 minute period. I send a report when ever that report window pops up. That adds up to a lot, LOL.
If I understand you right as well. You're saying that the Safari cache folder should show a big flat ZERO if the cache is emptied and then I go back to check the folder. Does that mean then that when I empty the cache from Safari>Empty Cache ... that it isn't doing exactly everything? So that I will have to start going to Preferences to do it or to remove that folder more?
BTW, does it hurt if I would remove and trash all those crash report logs that are in the files? Right now it shows 10.8MB in there.
Okay, not that this will help, but here is what I found on the Safari crash log:
Host Name: Macintosh
Date/Time: 2007-04-22 09:56:44.165 -0500
OS Version: 10.4.9 (Build 8P135)
Report Version: 4
Command: Safari
Path: /Applications/Safari.app/Contents/MacOS/Safari
Parent: WindowServer [58]
Version: 2.0.4 (419.3)
Build Version: 1
Project Name: WebBrowser
Source Version: 4190300
PID: 206
Thread: 0
Exception: EXCBADACCESS (0x0001)
Codes: KERNINVALIDADDRESS (0x0001) at 0x14218191
Thread 0 Crashed:
0 com.apple.WebCore 0x95d5e458 RenderArena::allocate(unsigned long) + 48
1 com.apple.WebCore 0x95d5f498 khtml::RenderStyle::operator new(unsigned long, RenderArena*) + 28
2 com.apple.WebCore 0x95d6ff80 khtml::CSSStyleSelector::styleForElement(DOM::ElementImpl*, khtml::RenderStyle*, bool) + 264
3 com.apple.WebCore 0x95d6fd70 DOM::NodeImpl::createRendererIfNeeded() + 104
4 com.apple.WebCore 0x95d6fcf0 DOM::ElementImpl::attach() + 24
5 com.apple.WebCore 0x95d6ed88 KHTMLParser::insertNode(DOM::NodeImpl*, bool) + 2440
6 com.apple.WebCore 0x95d6cfa0 KHTMLParser::parseToken(khtml::Token*) + 612
7 com.apple.WebCore 0x95d6a084 khtml::HTMLTokenizer::processToken() + 460
8 com.apple.WebCore 0x95d6b9c0 khtml::HTMLTokenizer::parseTag(khtml::TokenizerString&) + 6256
9 com.apple.WebCore 0x95d6990c khtml::HTMLTokenizer::write(khtml::TokenizerString const&, bool) + 928
10 com.apple.WebCore 0x95da34c4 khtml::HTMLTokenizer::timerEvent(QTimerEvent*) + 244
11 com.apple.WebCore 0x95da3384 -[KWQObjectTimerTarget sendTimerEvent] + 80
12 com.apple.Foundation 0x92be5f68 __NSFireTimer + 116
13 com.apple.CoreFoundation 0x907f2578 __CFRunLoopDoTimer + 184
14 com.apple.CoreFoundation 0x907deef8 __CFRunLoopRun + 1680
15 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
16 com.apple.HIToolbox 0x9329bb20 RunCurrentEventLoopInMode + 264
17 com.apple.HIToolbox 0x9329b1b4 ReceiveNextEventCommon + 380
18 com.apple.HIToolbox 0x9329b020 BlockUntilNextEventMatchingListInMode + 96
19 com.apple.AppKit 0x937a0ae4 _DPSNextEvent + 384
20 com.apple.AppKit 0x937a07a8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
21 com.apple.Safari 0x00006740 0x1000 + 22336
22 com.apple.AppKit 0x9379ccec -[NSApplication run] + 472
23 com.apple.AppKit 0x9388d87c NSApplicationMain + 452
24 com.apple.Safari 0x0005c77c 0x1000 + 374652
25 com.apple.Safari 0x0005c624 0x1000 + 374308
Thread 1:
0 libSystem.B.dylib 0x9000b6e8 machmsgtrap + 8
1 libSystem.B.dylib 0x9000b63c mach_msg + 60
2 com.apple.CoreFoundation 0x907deba8 __CFRunLoopRun + 832
3 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
4 com.apple.Foundation 0x92bf2170 -[NSRunLoop runMode:beforeDate:] + 172
5 com.apple.Foundation 0x92bf20a8 -[NSRunLoop run] + 76
6 com.apple.WebKit 0x95b86e30 +[WebFileDatabase _syncLoop:] + 176
7 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
8 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 2:
0 libSystem.B.dylib 0x9000b6e8 machmsgtrap + 8
1 libSystem.B.dylib 0x9000b63c mach_msg + 60
2 com.apple.CoreFoundation 0x907deba8 __CFRunLoopRun + 832
3 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
4 com.apple.Foundation 0x92c0a6a8 +[NSURLConnection(NSURLConnectionInternal) _resourceLoadLoop:] + 264
5 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
6 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 3:
0 libSystem.B.dylib 0x9000b6e8 machmsgtrap + 8
1 libSystem.B.dylib 0x9000b63c mach_msg + 60
2 com.apple.CoreFoundation 0x907deba8 __CFRunLoopRun + 832
3 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
4 com.apple.Foundation 0x92c0b7e8 +[NSURLCache _diskCacheSyncLoop:] + 152
5 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
6 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 4:
0 libSystem.B.dylib 0x9001fc2c select + 12
1 com.apple.CoreFoundation 0x907f1434 __CFSocketManager + 472
2 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 5:
0 libSystem.B.dylib 0x9002c768 semaphorewait_signaltrap + 8
1 libSystem.B.dylib 0x9003124c pthreadcondwait + 480
2 com.apple.Foundation 0x92bea30c -[NSConditionLock lockWhenCondition:] + 68
3 com.apple.Syndication 0x9b13142c -[AsyncDB _run:] + 192
4 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
5 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 6:
0 libSystem.B.dylib 0x9002c768 semaphorewait_signaltrap + 8
1 libSystem.B.dylib 0x9003124c pthreadcondwait + 480
2 com.apple.Foundation 0x92bea30c -[NSConditionLock lockWhenCondition:] + 68
3 com.apple.AppKit 0x9383d708 -[NSUIHeartBeat _heartBeatThread:] + 324
4 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
5 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 7:
0 libSystem.B.dylib 0x90055648 semaphoretimedwait_signaltrap + 8
1 libSystem.B.dylib 0x90071e88 pthreadcond_timedwait_relativenp + 556
2 ...ple.CoreServices.CarbonCore 0x90bf74b8 TSWaitOnSemaphoreCommon + 176
3 ...ple.CoreServices.CarbonCore 0x90bf730c AsyncFileThread(void*) + 56
4 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 8:
0 libSystem.B.dylib 0x9000b6e8 machmsgtrap + 8
1 libSystem.B.dylib 0x9000b63c mach_msg + 60
2 ...romedia.Flash Player.plugin 0x061bb688 nativeShockwaveFlashTCallFrame + 1368296
3 libSystem.B.dylib 0x9002c0a8 pthreadbody + 96
Thread 0 crashed with PPC Thread State 64:
srr0: 0x0000000095d5e458 srr1: 0x000000000200f030 vrsave: 0x00000000fff00000
cr: 0x28024224 xer: 0x0000000000000004 lr: 0x0000000095d5f498 ctr: 0x0000000095fdf664
r0: 0x0000000095d5f498 r1: 0x00000000bfffe070 r2: 0x0000000005e9d4ac r3: 0x0000000014218191
r4: 0x000000000000003c r5: 0x0000000000000000 r6: 0x0000000000000001 r7: 0x0000000000000001
r8: 0x0000000005f02e81 r9: 0x0000000008119a40 r10: 0x0000000005f00e7d r11: 0x0000000005e9d470
r12: 0x0000000095fdf664 r13: 0x0000000000000000 r14: 0x0000000000000001 r15: 0x0000000000000001
r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x00000000000064d7 r19: 0x0000000000000000
r20: 0x000000001017d27b r21: 0x00000000873141c0 r22: 0x0000000000000054 r23: 0x0000000000412a00
r24: 0x0000000000000000 r25: 0x0000000000000001 r26: 0x0000000008119a40 r27: 0x0000000008119a40
r28: 0x0000000000000000 r29: 0x0000000000000001 r30: 0x0000000007b91090 r31: 0x0000000095d6fe84
Binary Images Description:
0x1000 - 0xdcfff com.apple.Safari 2.0.4 (419.3) /Applications/Safari.app/Contents/MacOS/Safari
0x3734000 - 0x3736fff com.apple.textencoding.unicode 2.0 /System/Library/TextEncodings/Unicode Encodings.bundle/Contents/MacOS/Unicode Encodings
0x3fbb000 - 0x4023fff com.DivXInc.DivXDecoder 6.4.0 /Library/QuickTime/DivX Decoder.component/Contents/MacOS/DivX Decoder
0x5f05000 - 0x6219fff com.macromedia.Flash Player.plugin 9.0.28 (1.0.4f22) /Library/Internet Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash Player
0x8fe00000 - 0x8fe52fff dyld 46.12 /usr/lib/dyld
0x90000000 - 0x901bdfff libSystem.B.dylib /usr/lib/libSystem.B.dylib
0x90215000 - 0x9021afff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib
0x9021c000 - 0x90269fff com.apple.CoreText 1.0.3 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreText.framework/Versions/A/CoreText
0x90294000 - 0x90345fff ATS /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/ATS
0x90374000 - 0x9072ffff com.apple.CoreGraphics 1.258.61 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/CoreGraphics
0x907bc000 - 0x90895fff com.apple.CoreFoundation 6.4.7 (368.28) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x908de000 - 0x908defff com.apple.CoreServices 10.4 (???) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x908e0000 - 0x909e2fff libicucore.A.dylib /usr/lib/libicucore.A.dylib
0x90a3c000 - 0x90ac0fff libobjc.A.dylib /usr/lib/libobjc.A.dylib
0x90aea000 - 0x90b5afff com.apple.framework.IOKit 1.4 (???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x90b70000 - 0x90b82fff libauto.dylib /usr/lib/libauto.dylib
0x90b89000 - 0x90e60fff com.apple.CoreServices.CarbonCore 681.10 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonC ore.framework/Versions/A/CarbonCore
0x90ec6000 - 0x90f46fff com.apple.CoreServices.OSServices 4.1 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServi ces.framework/Versions/A/OSServices
0x90f90000 - 0x90fd1fff com.apple.CFNetwork 4.0 (129.20) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwo rk.framework/Versions/A/CFNetwork
0x90fe6000 - 0x90ffefff com.apple.WebServices 1.1.2 (1.1.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServ icesCore.framework/Versions/A/WebServicesCore
0x9100e000 - 0x9108ffff com.apple.SearchKit 1.0.5 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchK it.framework/Versions/A/SearchKit
0x910d5000 - 0x910fffff com.apple.Metadata 10.4.4 (121.36) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Metadata
0x91110000 - 0x9111efff libz.1.dylib /usr/lib/libz.1.dylib
0x91121000 - 0x912dcfff com.apple.security 4.6 (29770) /System/Library/Frameworks/Security.framework/Versions/A/Security
0x913db000 - 0x913e4fff com.apple.DiskArbitration 2.1 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x913eb000 - 0x913f3fff libbsm.dylib /usr/lib/libbsm.dylib
0x913f7000 - 0x9141ffff com.apple.SystemConfiguration 1.8.3 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfi guration
0x91432000 - 0x9143dfff libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib
0x91442000 - 0x914bdfff com.apple.audio.CoreAudio 3.0.4 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x914fa000 - 0x914fafff com.apple.ApplicationServices 10.4 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Application Services
0x914fc000 - 0x91534fff com.apple.AE 1.5 (297) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ AE.framework/Versions/A/AE
0x9154f000 - 0x91621fff com.apple.ColorSync 4.4.9 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ColorSync.framework/Versions/A/ColorSync
0x91674000 - 0x91705fff com.apple.print.framework.PrintCore 4.6 (177.13) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ PrintCore.framework/Versions/A/PrintCore
0x9174c000 - 0x91803fff com.apple.QD 3.10.24 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ QD.framework/Versions/A/QD
0x91840000 - 0x9189efff com.apple.HIServices 1.5.3 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ HIServices.framework/Versions/A/HIServices
0x918cd000 - 0x918f1fff com.apple.LangAnalysis 1.6.1 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LangAnalysis.framework/Versions/A/LangAnalysis
0x91905000 - 0x9192afff com.apple.FindByContent 1.5 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ FindByContent.framework/Versions/A/FindByContent
0x9193d000 - 0x9197ffff com.apple.LaunchServices 182 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LaunchServices.framework/Versions/A/LaunchServices
0x9199b000 - 0x919affff com.apple.speech.synthesis.framework 3.3 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x919bd000 - 0x91a03fff com.apple.ImageIO.framework 1.5.4 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/ImageIO
0x91a1a000 - 0x91ae1fff libcrypto.0.9.7.dylib /usr/lib/libcrypto.0.9.7.dylib
0x91b2f000 - 0x91b44fff libcups.2.dylib /usr/lib/libcups.2.dylib
0x91b49000 - 0x91b67fff libJPEG.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x91b6d000 - 0x91c24fff libJP2.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libJP2.dylib
0x91c73000 - 0x91c77fff libGIF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x91c79000 - 0x91ce1fff libRaw.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libRaw.dylib
0x91ce6000 - 0x91d23fff libTIFF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x91d2a000 - 0x91d43fff libPng.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libPng.dylib
0x91d48000 - 0x91d4bfff libRadiance.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x91d4d000 - 0x91e2bfff libxml2.2.dylib /usr/lib/libxml2.2.dylib
0x91e4b000 - 0x91e4bfff com.apple.Accelerate 1.2.2 (Accelerate 1.2.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x91e4d000 - 0x91f32fff com.apple.vImage 2.4 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.fr amework/Versions/A/vImage
0x91f3a000 - 0x91f59fff com.apple.Accelerate.vecLib 3.2.2 (vecLib 3.2.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/vecLib
0x91fc5000 - 0x92033fff libvMisc.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvMisc.dylib
0x9203e000 - 0x920d3fff libvDSP.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvDSP.dylib
0x920ed000 - 0x92675fff libBLAS.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libBLAS.dylib
0x926a8000 - 0x929d3fff libLAPACK.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libLAPACK.dylib
0x92a03000 - 0x92af1fff libiconv.2.dylib /usr/lib/libiconv.2.dylib
0x92af4000 - 0x92b7cfff com.apple.DesktopServices 1.3.6 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Desk topServicesPriv
0x92bbd000 - 0x92de8fff com.apple.Foundation 6.4.8 (567.29) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x92f15000 - 0x92f33fff libGL.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x92f3e000 - 0x92f98fff libGLU.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x92fb6000 - 0x92fb6fff com.apple.Carbon 10.4 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x92fb8000 - 0x92fccfff com.apple.ImageCapture 3.0 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture. framework/Versions/A/ImageCapture
0x92fe4000 - 0x92ff4fff com.apple.speech.recognition.framework 3.4 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecogni tion.framework/Versions/A/SpeechRecognition
0x93000000 - 0x93015fff com.apple.securityhi 2.0 (203) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.fr amework/Versions/A/SecurityHI
0x93027000 - 0x930aefff com.apple.ink.framework 101.2 (69) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework /Versions/A/Ink
0x930c2000 - 0x930cdfff com.apple.help 1.0.3 (32) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framewor k/Versions/A/Help
0x930d7000 - 0x93104fff com.apple.openscripting 1.2.5 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting .framework/Versions/A/OpenScripting
0x9311e000 - 0x9312efff com.apple.print.framework.Print 5.0 (190.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framewo rk/Versions/A/Print
0x9313a000 - 0x931a0fff com.apple.htmlrendering 1.1.2 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering .framework/Versions/A/HTMLRendering
0x931d1000 - 0x93220fff com.apple.NavigationServices 3.4.4 (3.4.3) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationSer vices.framework/Versions/A/NavigationServices
0x9324e000 - 0x9326bfff com.apple.audio.SoundManager 3.9 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.f ramework/Versions/A/CarbonSound
0x9327d000 - 0x9328afff com.apple.CommonPanels 1.2.2 (73) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels. framework/Versions/A/CommonPanels
0x93293000 - 0x935a1fff com.apple.HIToolbox 1.4.9 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.fra mework/Versions/A/HIToolbox
0x936f1000 - 0x936fdfff com.apple.opengl 1.4.7 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x93702000 - 0x93722fff com.apple.DirectoryService.Framework 3.1 /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryServi ce
0x93796000 - 0x93796fff com.apple.Cocoa 6.4 (???) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x93798000 - 0x93dcbfff com.apple.AppKit 6.4.7 (824.41) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x94158000 - 0x941cafff com.apple.CoreData 91 (92.1) /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x94203000 - 0x942c7fff com.apple.audio.toolbox.AudioToolbox 1.4.5 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x94319000 - 0x94319fff com.apple.audio.units.AudioUnit 1.4 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x9431b000 - 0x944dbfff com.apple.QuartzCore 1.4.12 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x94525000 - 0x94562fff libsqlite3.0.dylib /usr/lib/libsqlite3.0.dylib
0x9456a000 - 0x945bafff libGLImage.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dyl ib
0x945c3000 - 0x945d7fff com.apple.CoreVideo 1.4 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x9466d000 - 0x946a5fff com.apple.vmutils 4.0.0 (85) /System/Library/PrivateFrameworks/vmutils.framework/Versions/A/vmutils
0x946e8000 - 0x94704fff com.apple.securityfoundation 2.2 (27710) /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoun dation
0x94718000 - 0x9475cfff com.apple.securityinterface 2.2 (27692) /System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInter face
0x94780000 - 0x9478ffff libCGATS.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib
0x94797000 - 0x947a3fff libCSync.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
0x947e9000 - 0x94801fff libRIP.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
0x94808000 - 0x94addfff com.apple.QuickTime 7.1.5 /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
0x94ba1000 - 0x94c12fff libstdc++.6.dylib /usr/lib/libstdc++.6.dylib
0x94c85000 - 0x94ca5fff libmx.A.dylib /usr/lib/libmx.A.dylib
0x94dad000 - 0x94eddfff com.apple.AddressBook.framework 4.0.4 (485.1) /System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook
0x94f6f000 - 0x94f7efff com.apple.DSObjCWrappers.Framework 1.1 /System/Library/PrivateFrameworks/DSObjCWrappers.framework/Versions/A/DSObjCWra ppers
0x94f86000 - 0x94fb3fff com.apple.LDAPFramework 1.4.1 (69.0.1) /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
0x94fba000 - 0x94fcafff libsasl2.2.dylib /usr/lib/libsasl2.2.dylib
0x94fce000 - 0x94ffdfff libssl.0.9.7.dylib /usr/lib/libssl.0.9.7.dylib
0x9500d000 - 0x9502afff libresolv.9.dylib /usr/lib/libresolv.9.dylib
0x95b84000 - 0x95c12fff com.apple.WebKit 419 /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit
0x95c6e000 - 0x95d04fff com.apple.JavaScriptCore 418.3 /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/JavaScriptCor e.framework/Versions/A/JavaScriptCore
0x95d41000 - 0x9604dfff com.apple.WebCore 418.21 /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.frame work/Versions/A/WebCore
0x961d6000 - 0x961fffff libxslt.1.dylib /usr/lib/libxslt.1.dylib
0x974b9000 - 0x974d8fff com.apple.vecLib 3.2.2 (vecLib 3.2.2) /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
0x97cde000 - 0x97cebfff com.apple.agl 2.5.6 (AGL-2.5.6) /System/Library/Frameworks/AGL.framework/Versions/A/AGL
0x99537000 - 0x9a0e4fff com.apple.QuickTimeComponents.component 7.1.5 /System/Library/QuickTime/QuickTimeComponents.component/Contents/MacOS/QuickTim eComponents
0x9b12e000 - 0x9b164fff com.apple.Syndication 1.0.6 (54) /System/Library/PrivateFrameworks/Syndication.framework/Versions/A/Syndication
0x9b181000 - 0x9b193fff com.apple.SyndicationUI 1.0.6 (54) /System/Library/PrivateFrameworks/SyndicationUI.framework/Versions/A/Syndicatio nUI -
Problem with DECODE block in WHERE clause
Hi,
I'm facing problem with DECODE statement. I just simulated my problem in the simple way as follows. If I execute this following query, I should get "hello", but I'm not getting anything (ZERO rows returned).
SELECT 'hello' FROM DUAL
WHERE 'sample1' in (DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',
2, '''sample4'', ''sample5'', ''sample6'''
I think some problem is there in my WHERE clause.
But When I'm exeucting the following query as a seperate query, then I'm getting the value of DECODE block properly, but didn;t understnad why its not returning the same way when I'm putting the same DECODE statement in WHERE clause.
SELECT DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',
2, '''sample4'', ''sample5'', ''sample6'''
FROM DUAL;
Please help me to get out of this problem. Thank you so much in advance.
Thanks,
Ramji.The value returned by SELECT DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',2, '''sample4'', ''sample5'', ''sample6''') FROM DUAL;
'sample1', 'sample2', 'sample3' is a single string. Consider it x.
SELECT 'hello' FROM DUAL WHERE 'sample1' in ( DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',2, '''sample4'', ''sample5'', ''sample6'''));
is like SELECT 'hello' FROM DUAL WHERE 'sample1' in ('x');
or
SELECT 'hello' FROM DUAL WHERE 'sample1' in ('''sample1'', ''sample2'', ''sample3''') and not
SELECT 'hello' FROM DUAL WHERE 'sample1' in ('sample1', 'sample2', 'sample3');
For this same reason SELECT 'hello' FROM DUAL WHERE 'sample1' in (select '''sample1'', ''sample2'', ''sample3''' from dual);
also does'nt work.
Please use INSTR to find whether 'sample1' exists in the string 'sample1', 'sample2', 'sample3'. -
Problem with decode function.
Hi,
Can anyone of you help me out in solving this?
It is like i wish to give different select statements according to the value of a parameter entered by user USING DECODE FUNCTION.The select statement contains some other select statements inside it.So when i execute it,it is giving error like 'ORA-00913-too many values(even when i enclose select statements within brackets).ORA-00913 too many values
Cause: The SQL statement requires two sets of values equal in number. This error occurs when the second set contains more items than the first set. For example, the subquery in a WHERE or HAVING clause may return too many columns, or a VALUES or SELECT clause may return more columns than are listed in the INSERT.
Action: Check the number of items in each set and change the SQL statement to make them equal.
the above is from oracle documentation. the brackets is not the problem, u must be using multiple items in the integrated decode queries. If the problem still exists post ur DML for further analysis.
zaibi. -
Hello Friends,
I have a query that has different columns and I am not sure what the data type of each column is ...
I want to use decode function which displays the following if the value of the column is like this ..
if the value of column is -714E ie -700000000000000 then display as .A
if the value of column is -814E ie -800000000000000 then display as .B
NOTE ; don't know which column is having the value - and i don't know the data type of the column is ..
got to use the decode function for all the columns selected ..
I want to use decode function pls let me know how to write for this kind of requirement.
appreciate your help in this rgds.
thanks/kumarDear Sir / Madam,
Thanks for your understanding.
Right now I am facing a unique problem.
I am using decode function in a select statement. The columns are dynamic some columns are of type number and some are varchar datatypes. I want to apply decode function for every column irrespective of datatype.
What i am finding difficult is if the column is a number datatype , the decode funciton is working good but if the column datatype is varchar or char datatype then i am getting ..
here's the decode function..
decode (CHAI.EVNDRIVE,
-800000000000000,'.A',
-700000000000000, '.B',
-600000000000000 ,'.C',
-500000000000000 , '.D',
-400000000000000 , '.E',
-300000000000000 , '.F',
-200000000000000, '.G',
-100000000000000 , '.H',
-1000000000, '.R' ,CHAI.EVNDRIVE ) EVNDRIVE
report error:
ORA-01722: invalid number
pls let me know how to over come this kind of scenario.
is their a way to find whether the column datatype is number or char , so that i can check the column datatype before the decode funciton is applied ..
thanks ..
kumar -
Problems with decoding an latin1-encoded url
Hi,
i have a problem with decoding german umlaut-characters from an URL.
I'm using Tomcat 5.5 on a Linux server and one on a windows machine for development. Both webapps have the same configurations.
A servlet decodes the URL-String, parses it and stores the parsed data into a mysql-DB.
For decoding the query-string i'm using org.apache.commons.codec.net.URLCodec.URLCodec.decode .
Here's the code:
String unparsedParameters = request.getQueryString();
URLCodec codec = new URLCodec("ISO-8859-1");
result = codec.decode(unparsedParameters);Here an example for a query-string: http://servername:8080/servlet/Import?Etwas%20wurde%20am%2025.08.2010%2010%3A16%3A50%20*ge%E4ndert*
On the windows machine the word "*geändert*" is decoded correctly. But on the linux server i get "*ge?ndert*". It makes no difference if i write the result into the database or just into a logfile.
Can anyone help?
Thanks in advance.
Edited by: sol1640 on Aug 26, 2010 5:59 AMProblem resolved.
Instead of using the decode-method as described in my fist message now i'm doing the folowing:
fURLDecodigCharset = "ISO8859-1";
byte[] bytes = originalParam.getBytes(fURLDecodigCharset);
byte[] decodeUrl = URLCodec.decodeUrl(bytes);
result = new String (decodeUrl, fURLDecodigCharset);because the method "decode" decodes the string by using the defaultcharset. And that was the problem.
>
The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system.
>
Thats why i've got different behaviours on different systems.
Thanks -
Problems using GET method in JSP
Hi,
I had some problems using GET method in JSP.
I'm using Apache web server 1.3 and Tomcat 3.3.1 in windows 2000.
And I'm using language English and Korean.
When I send messages using POST method, all is good
But when I send message using GET method, English is good, but Korean is not good.
I tried to encode using
URLEncode.encode(str, "UTF-8")
and decoding it using
URLDecode.decode(request.getParameter(tag), "UTF-8")
but it didn't work.
How can I receive request including Korean using GET method in JSP?
If anyone have solutions, please let me know.
thanks.Hi,
I had some problems using GET method in JSP.
I'm using Apache web server 1.3 and Tomcat 3.3.1 in
windows 2000.
And I'm using language English and Korean.
When I send messages using POST method, all is good
But when I send message using GET method, English is
good, but Korean is not good.
I tried to encode using
URLEncode.encode(str, "UTF-8")
and decoding it using
URLDecode.decode(request.getParameter(tag), "UTF-8")
but it didn't work.
How can I receive request including Korean using GET
method in JSP?
If anyone have solutions, please let me know.
thanks.This problem appears, when one use UTF-16 encoding in JSP - am I right?
If so there are two solutions:
1) Temporary: Use "UTF-8" - or any other 8 bit encoding scheme and
encode Korean symbols with "&1234;" kind of escapes - though it
may not work
2) Absolute: get my piece of code, which I have managed to write
just a month ago resolving absolutely similar problem with UTF-16
in code using Chinese/Russian/English encodings
But I wouldn't say that it's costs 10 DDs :) - it's much more
expensive... So try 1st variant if it wouldn't help - let me know.
I'll figure :)
Paul -
How to use Decode with a variable
Maybe you've seen this done.
I want to take statement strMenu4 and subtract the previous value
that is stored in an array as shown in strMenu5.
My problem is this change as shown in strMenu5 produces
an error code:
ORA-00904 invalid column name
So either I'm coding something wrong or it can't be done within the
SUM(decode) construct. If I replace the variable with a literal
like 1000 the code works:
SUM(decode(name,'DBWR lru scans', c1.value) - 1000) DBWR_lru_scans
but with an array variable or even a constant the code fails:
SUM(decode(name,'DBWR lru scans', c1.value) - Array(3)) DBWR_lru_scans, "
Any ideas how I can use Decode with a variable and not have it interrupt it
as a invalid column name?
Thanks,
Joseph Karpinski
[email protected]
[email protected]
strMenu4 = "SELECT d1.instance, " _
& " to_char(sysdate, 'dd-mon-yy hh24:mi:ss') start_time, " _
& " SUM(decode(name,'DBWR buffers scanned', c1.value)) DBWR_buffers_scanned, " _
& " SUM(decode(name,'DBWR lru scans', c1.value)) DBWR_lru_scans, " _
& " SUM(decode(name,'db block gets', c1.value)) db_block_gets , " _
& " SUM(decode(name,'consistent gets', c1.value)) consistent_gets , " _
& " SUM(decode(name,'physical reads', c1.value)) physical_reads " _
& " from dual, v$sysstat c1, v$thread d1 " _
& " group by d1.instance "
strMenu5 = "SELECT d1.instance, " _
& " to_char(sysdate, 'dd-mon-yy hh24:mi:ss') start_time, " _
& " SUM(decode(name,'DBWR buffers scanned', c1.value) - Array(2)) DBWR_buffers_scanned, " _
& " SUM(decode(name,'DBWR lru scans', c1.value) - Array(3)) DBWR_lru_scans, " _
& " SUM(decode(name,'db block gets', c1.value) - Array(4)) db_block_gets , " _
& " SUM(decode(name,'consistent gets', c1.value) - Array(5)) consistent_gets , " _
& " SUM(decode(name,'physical reads', c1.value) - Array(6)) physical_reads " _
& " from dual, v$sysstat c1, v$thread d1 " _
& " group by d1.instance "Re-posting in the SQL and PL/SQL forum.
It's more appropriate.
Thanks,
Closing -
Can I use decode( decode...)...)
Hi,
Can I use decode function inside decode function.
It seem doesn't work. Please help
decode(lv.RANK||' / '||
decode('('||lv.ONE_YR_PCT||'%)', '(%)','N/A','('||lv.ONE_YR_PCT||'%)'),
'0 / (0%)','N/A', lv.RANK )
ThanksI'm not quite sure it's the result you intended but your nested decode statement does run ...
SQL> CREATE TABLE lv (rank number, one_yr_pct number)
2 /
Table created.
SQL> insert into lv values (1, 1)
2 /
1 row created.
SQL> insert into lv values (2,2)
2 /
1 row created.
SQL> insert into lv values (0,0)
2 /
1 row created.
SQL> select decode(lv.RANK||' / '||
2 decode('('||lv.ONE_YR_PCT||'%)', '(%)','N/A','('||lv.ONE_YR_PCT||'%)'),
3 '0 / (0%)','N/A', lv.RANK )
4 from lv
5 /
DECODE(LV.RANK||'/'||DECODE('('||LV.ONE_
1
2
N/A
SQL> If you're having problems maybe you should cut'n'paste the output from your SQL*Plus session so we can see what's happening.
Alternatively, as CD suggests, you may find it easier to express your logic using CASE.
Cheers, APC -
Problem with decode!!!
Hi guys,
I have a problem with "decode"!
How can I tell the decode expression
that if a rowset don't exists --> then doing something.
I've tried that with "NULL" but that don't works.
here my code:
I wanted that if tx.text doesn't exists then
it returns fs.anlageschwerpunkt_lang, and otherwise
it returns tx.Text.
select
decode(tx.Text,NULL,fs.anlageschwerpunkt_lang,tx.Text) Anlageschwerpunkt_1 from
POI.Fondsstamm fs,
Texte tx,
Texttypstamm txy
where
tx.match='amfcomm'
and tx.match=rtrim(fs.match)
and tx.TEXTTYPID=txy.TEXTTYPID
and txy.BEREICHSID=14
and txy.texttyp='Marketingstrategie'
I hope somebody of you can help me
thanxx
SchoeibI read Schoeibs question differently; no ROWS are being returned. In that case you cannot expect DECODE or any other function to do anything. Assuming that rows always exist in fs and txy and are only missing in tx, then you need an outer join. Note that the join of tx.match = rtrim(fs.match) has been altered to avoid outer joining to more than one table. As mentioned before, although the decode is OK, NVL could be used instead.
select
decode(tx.Text,NULL,fs.anlageschwerpunkt_lang,tx.Text) Anlageschwerpunkt_1 from
POI.Fondsstamm fs,
Texte tx,
Texttypstamm txy
where
tx.match(+)='amfcomm'
and rtrim(fs.match) = 'amfcomm'
and tx.TEXTTYPID(+)=txy.TEXTTYPID
and txy.BEREICHSID=14
and txy.texttyp='Marketingstrategie' -
Insert while using Decode Statement
Hi,
I have a unique problem(I think so). Is it possibe to insert into a table while selecting from another table using DECODE function. I am giving the select statement below. When I run this statement it says that missing expression. I could not find out the mistake. Is this query right or any changes to be made. Moreover I would like to know whether it is the right way of doing.
The SQL Statement is as follows.
SQL> select decode(EV,'E',(INSERT INTO assets1 VALUES
(31,NULL,NULL))) from assets;
Thanking in advance for timely help.
Guru Prasad.Hi,
U Cannot do that ... B'cos u cannot have Insert Inside a Select.
What you can do is... Right a Small Pl/SQL Block which will do that for you.
Regards,
Ganesh R -
Use DECODE in sqlloader with DIRECT=TRUE?
hi.. i have this .ctl
load data
infile 'invoice.dat'
APPEND
into table INVOICE_TMP1
when (43:50)='RIN4331'
bill_date position(1:8) DATE 'YYYYMMDD'
,acct_no position(9:22)
,bill_period position(51:52)
,due_date position(139:146) DATE 'YYYYMMDD' "decode(:due_date,00000000,null,:due_date)"
,last_bill_amt position(84:94) DECIMAL EXTERNAL
,sys_appl_id CONSTANT "CTLA"
i have to use DIRECT=TRUE because my .dat file contains large file (about 17 million records)
my problem now is because i use direct=true, so i cannot use decode because it is in SQL string. My data for due_date maybe contains 00000000 for datatype date. that is why i have to use decode.
How to solve my problem?
please help ASAP.
TQ.Duplicate post
Re: Using DIRECT=TRUE in SQLLOADER
Maybe you are looking for
-
Wish for next version Labview - group of references created
Everytime I create large Labview application, I tend to create constant references and control/indicator references for every controls and indicator, before grouping them tinto clusters and wires so that i do not have to search for it high and low.
-
How to change midi velocities after recording?
previously when I used EZdrummer i would just write out the beats using the piano roll and a mouse, and then i could easily click the little tab at the bottom of the piano roll and change the velocity of any note. But recently i've started actually r
-
Is there a way to 'undo' deleting images from iPhoto? I've also emptied the trash, and deleted them from my camera! YIKES!!!!!
-
CLI0108E Communication link failure. After clone machine
AIX 5.3 SAP R / 3 4.7 Enterprise 110 DB2 9.5 fix pack 2 We did a clone machine that already had SAP and DB2 9.5 installed and changed the host and ip. After adjustments sidadm user profiles, user db2prd and adjust db2conf password file, database and
-
Display"Number of Displayed XML Messages" in SXMB_MONI transaction screen
I used to have this information "Number of Displayed XML Messages XX" in the SXMB_MONI transaction screen just above the ALV toolbar. Somehow, it's not there anymore. How can I put back this message on this screen? Thanks. Joey