Subquery inside NVL using a view
Hello
A subquery can not be used inside a NVL.
But I read that it can be done using a view.
Can any one give an example of how we can acheive the effect of NVL (select statement, <expr>) using a view.
(Just in general ....)
Thank you
Who said that
SQL>SELECT empno
2 ,ename
3 ,comm
4 ,NVL(to_char(comm), (SELECT 'Commision is NULL' FROM DUAL)) null_comm
5 FROM emp ;
EMPNO ENAME COMM NULL_COMM
7369 SMITH Commision is NULL
7499 ALLEN 300 300
7521 WARD 500 500
7566 JONES Commision is NULL
7654 MARTIN 1400 1400
7698 BLAKE Commision is NULL
7782 CLARK Commision is NULL
7788 SCOTT Commision is NULL
7839 KING Commision is NULL
7844 TURNER 0 0
7876 ADAMS Commision is NULL
7900 JAMES Commision is NULL
7902 FORD Commision is NULL
7934 MILLER Commision is NULL
14 rows selected.
SQL>Regards
Arun
Similar Messages
-
I have a Folder with 10 Folders inside it, 8 of the Folders will not function when I use "show view options", they always default back the default. The "show view options" works on all my other Folders in my system, even on the first two of the Folder in question. How can I correct it? I have tried every thing I can think of, even deleting the Folders & reintalling them. For some strange reason the "show view options" only does not work on the last 8 Folders in the Folder in question.
Instead GarageBand recognize my keyboard and i can play normally, also, if it can help, those are the Audio and Midi Logic Preferences and the Controller Surfaces Setup with the keyboard connected :
-
This is the issue but I'm not sure there is a resolution:
Firefox: Version 3.5.1
Adobe: Version 9.1.3
When navigating the web, click a URL that opens a PDF inside the browser and you get an error * "The Adobe Acrobat/Reader that is
running can not be used to view PDF files in a Web Browser". Please exit Adobe Acrobat/Reader and exit your Web Browser and try again". I did read a post that doing a "repair" from the Adobe Reader application should fix this, they also reference a few registry keys to check becuase the post states it's lost the application path to Adobe version X. I don't necessarily buy that "fix" and here are my details below.
In FireFox if you navigate to Tools > Options > Applications > Adobe Acrobat Document
You're given choices:
Always ask: DOES NOT WORK, produces afore mentioned error *
Save File: Works, saves the file to a directory on your PC
Use Adobe Reader 9.1 (defau...: Works, opens your PDF's outside of your web browser
Use Adobe Acrobat (in Firefox): DOES NOT WORK, produces afore mentioned error *
Use other...:
IE seems to just work as expected.
If you open Adobe Reader > Edit > Preferences > Internet > Check "Display PDF in browser" - DOES NOT WORK, produces afore mentioned error *
This would seem to be an Adobe error rather than a FireFox web browser problems since FireFox does seem to know the correct path although I suppose you can't rule out that this is a FireFox problem since 2 out of the 4 PDF open options DON'T WORK.
Any thoughts on this issue would be greatly appreciated.
Other information:
Adobe 8.1.5 works perfectly with FF 3.5.1+ when opening PDF's in the web browser, we also had no problems with previous versions either.
MSI push via Active Directory from Adobe 8.1.5 upgrade to Licensed Distribution I signed up for, Adobe 9.1.3 which was upgraded from 9.1.0, to 9.1.2, to 9.1.3 via an MSP patch.
Operating system: Windows XP SP 2, plenty of RAM, plenty of Drive
IE version this works with the new version of Adobe 9.1.3 is version 7 (7.0.5730.13)
Our FireFox MSI's come from Front Motions website and as far as I know we've never had problems with their MSI's, also tried the new release of FF 3.5.2 from their website.
I think that about covers it. Anyone else experiencing the same problems or have a patch?After troublshooting this for the entire day today the issue seems to be a MIME problem.
If everything is woking perfectly, in Tools > Options > Applications...
You should see 4 or more things related to Adobe like "Adobe Acrobat Forms Document", etc. If you don't see at least 4 MIME entries either your Adobe installation is hosed or your FF installation is hosed. I haven't figured out which is causing the issue.
What I did was remaster my patches from my original Adobe 9.1.0 MSI with the two updates via the command line in the directories with the source files. On the 9.1.0 original file I first remastered my MST transform with the Adobe MST utility. I then applied my patches.
msiexec /a AcroRead.msi /p AdbeRdrUpd912_all_incr.msp
msiexec /a AcroRead.msi /p AdbeRdrUpd913_all_incr.msp
I then uploaded that to my network share, unlinked my group policy, made a new group policy, added a batch file to delete adobe.com from program file and the desktop on system startup even though my MST was supposed to take care of that - it's not a perfect world is it? :-)
I then reapplied my GPO's for both FireFox 3.5.2 and Adobe 9.1.3, I checked to make sure the MIME extensions were there and they were. You might have to go into your Adobe Preferences and select that open in browser setting depending on what happens or adjust your MIME settings in FireFox's options but it should work.
That's what worked for me. It's possible a few other things I did along the way tweaked it out, in my group policy on the first run I did select to upgrade previous group policies, for the remaster and repush I didn't select any previous GPO's to upgrade.
It's hard to tell what one thing tweaked it out or what combination of things tweaked out the install. I did also reinstall Adobe 8.1.5 and FF 3.0.10 before doing all this since our machines currently have that setup, I'm not sure if that affected it either, it's just hard to tell but I don't think it did simply because I had done that several times in troubleshooting this issue.
If anyone else has more specifics that would be great! -
Open BI Publisher report using URL View activity
Hi,
i need to call BI Publisher report and I want to use URL View activity (i followed instruction on http://oraclebizint.wordpress.com/2007/07/30/customizing-obi-ee-%e2%80%93-go-url-parameters/ but i can't have HTML Form inside af:form)
But parameters on URL View activity are visible and i have to send username and pass..
Is there another way?
Tnx.
AndrejaYes, I can put HTML form at top or bottom of page but i wanted to put in panelCollection (because of page design)....
but I will think out something to look nicely too :)
Tnx -
Using a view to join two tables
Thank you in advance for any advice you can lend.
I am using this code in my MySQL db to create a view.
select
job.id as job_id,
umr_cost_calculation.plant_name,
max(umr_cost_calculation.id) as max_id
from
job,
umr_cost_calculation
where
job.id = umr_cost_calculation.job_id
group by job.id , umr_cost_calculation.plant_name
I did this so I can join two tables and pull in the most current cost data for a specific plant. The report will, at times, show the wrong (older) data. I can re-run the report, filter to just the one job and see again the wrong data. When I add the max_id to the report, it display the id and updates the report with the correct data. It appears that the view was stale and by adding the ID to the report this fixed the issue.
1) Is this the best way to make this join? I don't see how Crystal supports a subquery to make a join (this is why I used the view).
2) If I leave the max_id on the report, will this force the view to always update?Try:
Select
D1.EmpLoginID,
Count(D1.ID),
Count(D1.AlarmCode),
D1.EmpName,
D1.EmpAddress,
D2.Db2Count
FROM DB1.Data D1
LEFT JOIN (SELECT
empLoginID, Count(*) as Db2Count
FROM DB2.ALL_Database
WHERE site = 'Atlanta'
GROUP BY empLoginID
) D2
ON D1.EmpLoginID = D2.EmpLoginID
GROUP BY D1.empLoginID, D1.EmpName, D2.EmpAddress, D2.Db2Count
Order BY D1.empLoginID ASC
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
PayPal buttons inside table scramble Design View in DW CS5.5
I developed my web site using Dreamweaver 8:
http://www.harmonize.com/hatleymusic/classic.html
As you see, I have PayPal buttons inside table cells. I did this using Design View, putting the insertion point in the table cell, going to code view, and pasting the PayPal button code at the insertion point. This all worked fine.
I just upgraded to DW CS5.5. and now when I try to use the same procedure, the Design View image gets scrambled after I paste the button code in code view. The table format is no longer in place, and I can no longer see where the cells of the table are. However, when I go to Live View, everything looks fine including the table and the buttons.
Can anyone tell me how to overcome this problem? As it stands, I cannot use DW to work on my web site, which is a major problem for me.
Thanks.How do I get someone to respond to my question here?
Let me try again.
With DW CS5.5 when I try to insert a PayPal button into a table (which I always did with DW8) the table in Design View gets scrambled, making it unusable. Please would one of you out there who is much more knowledgeable about DW than me try it and see if there is a solution? If you create a new HTML page in Design view, create a table in it, place the insertion point inside one of the table cells, go to the code view and locate the insertion point there, then paste the PayPal button code at that point. Here's the code:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XSXQ9CUMUVLQC">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Now go back to Design view and see how it looks. If it acts the way it does for me, the table is no longer visible, but if you go to Live View everything looks fine with the table and the button inside it. Of course, I can't design in Live View.
PLEASE can someone out there help me.
Many thanks. -
Creating a view and use the view in a model
Hi All,
I am new to OBIEE and i have a requirement that i have two fields to be added to a subject area. Since we can't add queries directly to a model, i have to create a view and then put the query in it and then use the view in that model.
I couldn't understand this much, if anybody could help me explaining in detail about the views and adding a query in it?
Thanks
GohanHi,
Please refer the screen short below link
http://imgur.com/b9sXS
Right click any of one physial table(RPD physical layer) -> Select Properties -> from the properties windows choose 'Select' as Table type ->
Please enable feature 'CREATE_VIEW_SUPPORTED' view just go to 'Features' tab and from the available option select 'CREATE_VIEW_SUPPORTED' is checked or not. If it is not checked then check the option.
can you explain your current model and scenario?
for example to you can use to fetch two fields from Subqueries,all trypes of joins(inner,left outer,right outer etc..,) its upto you case
e.x:fetching two tables columns mapping subquery:
SELECT column1, column2 FROM table1 WHERE column1 IN (SELECT column1 FROM table1
INTERSECT SELECT column1 FROM table2 )
SELECT column1, column2 FROM table1,table2 WHERE table1.column1 = table2.column1
Alternative there is feature call "mulitple subject area" method will work (Union,Union all etc..,)
Thanks
Deva
Edited by: Devarasu on Jun 6, 2012 4:40 PM -
Unable to use Existing view after importing interface
Hi All,
1. I am unable to import View as Datastore from one environment to another environment as that is already present as a datastore.
This is the error I am getting.
ODI-23040 : Import File
xml Error
I agree this may be because this datastore is already present .
2. But If I am importing one Interface where this VIEW is used then it is giving ERROR(Created Missing References) st the time of importing
Error:--
SNP_MODEL : PCS_TARGET #SNP_SUBMODEL : Global #SNP_TABLE : DIM_PROJECT_TIME_MON_V
Interface Target Table
DIM_PROJECT_TIME_MON_V
276603
Where as I am able to export import other Interface and data models successfully where I didnt use any view .
Please help in this regard.
FYI - I am using ODI 11.1.1.6.3
- I am importing all the datastores before importing the Interface.
- Only where I am using view inside interface I amfacing this problem so I am creating the Interface manually in all the environments which is a time consuming work.
- I am able to Import the Interface but with error and inside the interface the View datastore is coming as blank and showing missing reference where as inside models that same name datastore is already present.
Thanks in Advance1004780 wrote:
2. But If I am importing one Interface where this VIEW is used then it is giving ERROR(Created Missing References) st the time of importing
Error:--
SNP_MODEL : PCS_TARGET #SNP_SUBMODEL : Global #SNP_TABLE : DIM_PROJECT_TIME_MON_V
Interface Target Table
DIM_PROJECT_TIME_MON_V
276603
Where as I am able to export import other Interface and data models successfully where I didnt use any view
check your model logical schema where view is reside , might be they are different in each environment.
and check SNP_MISSING_REF table in work repo to verify exact cause.
Thanks. -
How to replicate parentheses using a view?
Hi,
I want to create a view, but I have some problem to replicate some concept that normally I use within SQL here in a R/3 system.
I have created this view inside SE11:
CABN ATNAM LIKE '%_MOD' OR
CABN ATNAM LIKE 'SC4%_102' AND
CABN ATNAM NOT LIKE '%_MOD'
The problem is that I can't use the parentheses inside the transaction
Using the parentheses, I have to create something like this:
CABN ATNAM LIKE '%_MOD' OR
(CABN ATNAM LIKE 'SC4%_102' AND
CABN ATNAM NOT LIKE '%_MOD')
Any idea to solve this problem?
Thank you a lotHi.
CABN ATNAM LIKE '%_MOD' OR " 1
CABN ATNAM LIKE 'SC4%_102' AND CABN ATNAM NOT LIKE '%_MOD' " 2
Create one view with first condition and then use created view in another
view with second conditions. -
Hi !
I have a problem to put a Subquery inside an INSERT INTO-Statement.
I try it this way: (the select-statemnet alone is running fine) (the listing is shortened)
INSERT INTO W_CACS_ENTRY
location_code
,case_num
,billing_account_id
select
a.location_code
,a.case_num
,billing.billing_account_id
from
select
max(billing_account_id) as billing_account_id
from
select /*+ parallel ( a 4)*/
account_no
,external_id
) case,
w_billing_accounts bill
where
case.account_no = bill.account_no
) billing
w_CO_CASE_HIST a
where .....bla...
When I try to compile it i get the following error:
ORA-Seperator S223:
(S223) Expecting: statement_terminator BEGIN CASE DECLARE END IDENTIFIER IF LOOP
Is it forbidden to use Subquerys inside an INSERT TO statement?
Are there any other possibilities?
thanks and greets
bangyes, it's inside a PL/SQL-Package. I'm using TOAD to develop it.
Here is the whole query:
INSERT INTO W_CACS_ENTRY
location_code
,case_num
,EVENT_TYPE
,EVENT_DATE
,event_id
,cacs_case_sequence
,part
,billing_account_id
select
a.location_code
,a.case_num
,'CACS IN' as EVENT_TYPE
,a.DATE_TIME as EVENT_DATE
,a.sequence_number as event_id
,seq_cacs_case_dwh.nextval as cacs_case_sequence
,substr(seq_cacs_case_dwh.currval, -1) as part
,billing.billing_account_id
from
select /*+ use_hash (case bill) parallel (bill 4) */
case_num
,LOCATION_CODE
,max(billing_account_id) as billing_account_id
from
select /*+ parallel ( a 4)*/
account_no
,external_id as case_num
,101010 as LOCATION_CODE
from
w_CUSTOMER_ID_ACCT_MAP ar
union all
select /*+ parallel ( a 4)*/
account_no
,external_id as case_num
,202020 as LOCATION_CODE
from
c_CUSTOMER_ID_ACCT_MAP ar
) casec,
w_billing_accounts bill
where
casec.account_no = bill.account_no
group by
case_num
,LOCATION_CODE
) billing
w_CO_CASE_HIST a
where a.coll_activity_code in ('EN','MS')
and a.DATE_TIME > to_date ('01.01.2006','dd.mm.yyyy')
and billing.case_num = a.case_num
and billing.location_code = a.location_code
; -
How to use Query-views as input-ready
I have a input-ready query working fine saying the IP field is input-ready, and a value can be entered.
If I save the query as a query-view and want to use the view instead, the input-ready field change to 'not input-ready'.
Hence, can query views not be used in IP ?
Thanks in advance, MikkelHello,
My first question is can Apex 3.1 work with 9.2 - 10.1 - 10.2 and 11.1?Correct. That's said in the installation guide.
My second question is how can I open the Query Builder inside the Create Region>SQL Report wizard to my users inside a custom user defined form?This does not yet exist out of the box. You can have a look how Oracle did it and try to mimic it in your own application.
My third question is if the answer of second question is it is not possible, then anyone can advice on alternatives for this kind of a need with Apex?Import app 4500 in your own workspace. On page 1002 you should find the query builder.
Again you can't just run this, you would need to make customizations to it. Alternatively you can add just a textarea on a page where you can run SQL statements from. But I guess you want to have the graphical display?
My last question is how Apex can handle a distributed database environment, like Java applications can it open several database connections as needed?APEX is living in the Oracle database. So everything inside that database you can potentially work with. If you need data from other sources you can use a database link or hytrogenous connectivity. Basically if you can do it from the Oracle database, you can also do it from within APEX.
Regards,
Dimitri
-- http://dgielis.blogspot.com/
-- http://www.apex-evangelists.com/
-- http://www.apexblogs.info/ -
Error using Disco Viewer 10.1.2 through vpn
We have upgraded Discoverer from release 9.0.4 to 10.1.2.
When using Discoverer Viewer 9.0.4 through a VPN connection (Oracle Application Server is on the other side of the VPN) the browser waits for pages for a while then it displays them correctly.
When using Discoverer Viewer 10.1.2 in the same network configuration the browser displays part of the page (it seems that it tries to display it in an incremental way) then it shows the error page (the classic error page for the browser: "impossible to display the page: the page is not available at the moment....").
When using Viewer 10.1.2 from inside the LAN this error does not occur.
Anyone has an idea?
Thanks in advanceThe problem seems to be related to the release of the browser.
For example with MS IE 6.0.2900 this problem occurs, while with MS IE 6.0.2800 it doesn't.
I understand that this issue is related to timings in communication between browser and application server, but why didn't it occur with 9.0.4 release??? -
Generating mixed case columns for XML using Object views
I am trying to model a query involving joins to generate hierarchical levels for XML document. I model it with an object view with a multicast subquery and the generated XML works fine except the following :
The generated XML creates a tag <view_column_name>_ITEM for the nested multicase subquery columns in the view and all the nested subquery view columns in upper case because the underlying table columns are in upper case. To better illustrate, please see the following example :
CREATE TYPE Tillinstance_t as object (
"Tillinstanceid" number
,"Stationid" number
,"Comment" varchar2(2000)
,"DepositID" number(38)
,"TimestampCreate" date
,"UseridCreate" number
,"TimestampChange" date
,"UseridChange" number
,"TimestampClosed" date
,"UseridClosed" number
,"TimestampBalance" date
,"UserIDBalance" number )
create type insts as table of Tillinstance_t ;
CREATE OR REPLACE VIEW till_view AS
SELECT t.tillid as "TillID"
, t.description as "Descr"
, t.word as "Word"
, t.Scopetypeid as "ScopeTypeId"
, t.displayOrder as "DisplayOrder"
, t.useridcreate as "UserIDCreate"
, t.newid as "NewID"
, t.flagactive as "FlagActive"
, t.timestampcreate as "TSCR"
, t.useridcreate as "UIDCR"
, t.timestampchange as "TSCH"
, t.useridchange as "UIDCH"
, CAST( MULTISET ( SELECT i.Tillinstanceid as "TillinstanceID"
, i.stationid as "StationID"
, i.ocomment as "Comment"
, i.depositid as "DepositID"
, i.Timestampcreate as "TSCR"
, i.useridcreate as "UIDCR"
, i.Timestampchange as "TSCH"
, i.useridchange as "UIDCH"
, i.timestampclosed as "TSCL"
, i.useridclosed as "UIDCL"
, i.timestampbalance as "TSBAL"
, i.useridbalance as "UIDBAL"
FROM TillInstance i
WHERE t.tillid = i.tillid)
AS Insts)
AS "Insts"
FROM ucTill t
The generated XML shows up in the form of :
<?xml version = '1.0'?>
<Tills>
<Till TillID="1002" Descr="Till #3" Word="Till3" ScopeTypeId="8"
DisplayOrder="0" UserIDCreate="296" TSCR="3/26/2001 0:0:0" UIDCR="296"
TSCH="5/4/2001 14:12:32" UIDCH="298">
<Insts>
<Insts_ITEM TILLINSTANCEID="1278" STATIONID="1057" OCOMMENT="Morning Till3"
TIMESTAMPCREATE="3/26/2001 0:0:0" USERIDCREATE="296" TIMESTAMPCHANGE="6/7/2001
8:26:49" USERIDCHANGE="99" TIMESTAMPCLOSED="6/7/2001 8:26:49"
USERIDCLOSED="99"/>
<Insts_ITEM TILLINSTANCEID="1362" STATIONID="1057" TIMESTAMPCREATE="6/7/2001
8:27:13" USERIDCREATE="99" TIMESTAMPCHANGE="6/11/2001 11:32:58"
USERIDCHANGE="320"/>
</Insts>
</Till>
</Tills>
Now How do I stripe out the _ITEM from the generated XML and change the columns TIMESTAMPCREATE, USERIDCLOSED etc to mixed case?
Any ideaI could generate the mixed case columns with no problem. It was my mistake and sorry for the inconvinience.
However I am running into problems modelling a nested hierarchical set of queries with levels more than 2.
Please advise of any sample code available anywhere.
For example I could do :
create table x1 ( id number , f1 varchar2(10));
creat table x2 ( id number , id_x1 number references x1(id) , f1 varchar2(10)) ;
create table x3 ( id number , id_x2 number references x2(id), f1 varchar2(10)) ;
To model this, I did
create type x3_typ as object ( id number, id_x2 number , f1 varchar2(10)) ;
create type x3_typ_t is table of x3_typ ;
create type x2_typ as object ( id number, id_x1 number , f1 varchar2(10), x3_list x3_typ_t ) ;
create type x2_typ_t is table of ref x2_typ ;
create type x1_typ as object ( id number
, f1 varchar2(10) , x2_list x2_typ_t ) ;
create or replace view x3_x2 as
select id , f1 , cast(multiset(select * from x3 ) as x3_typ_t ) as x3_list
If I try to use a view again like as given below, I get the Oracle inconsistent datatypes error.
create or replace view x2_x1 as
select id , f1 , cast(multiset(select * from x3_x2 ) as x2_typ_t ) as x2_list
I there a better way? Am I missing something? Please help. -
Whenever i try to open a PDF file it says " The adobe/acrobar reader that is running can not be used to view files in a web browser. Plz exit adobe/acrobat readerand exit your web browser and try again." Wt do i need to do, plz suggest.
Regards
Aditya BhargavaHi adityabhargava01-
My first suggestion is to upgrade to the most recent version of Firefox by going to this link:
http://www.mozilla.org/en-US/firefox/new/
My second suggestion is to read this article on how to many your preferences on how Firefox deals with PDFs and all other file types:
[[Options window - Applications panel]]
I hope that helps! -
I just got Windows 7 and have been having problems since loading it. Most of my drivers only go to Vista and don't recognize 7.
I have trying to download some manuals from their website
and keep getting this message; Adobe Acrobat/reader that is running can not be used to view PDF files in Web Browser.Could I suggest a workaround for PDFs until a solution is posted? Open them directly in the Adobe application rather than in a browser tab.
In your Adobe application(s), go to:
Edit > Preferences > Internet
Then uncheck "Display PDF in browser"
(There are very few sites where having PDF integrated is really beneficial.)
Maybe you are looking for
-
Co-pa and cost center with different profit centers?
I have a requirement to post (from fb50) to: 1) True posting: A profitability segment with profit center XXX 2) Statistical posting: A cost center assignet to profit center YYY I enter values in cost center, profit center and Prof.segm., but as soon
-
What is the best setting to import songs from a CD. Right now I'm using the Apple Lossless, but is there one that will take up less memory?
-
My iMac does not start.
My iMac does not start. When I turn it on, it stays loading in the half and doesn't continue. Some days before I had updated my iMac to Yosemite 10.10. Everything was ok but yesterday I decided tu reboot it and when it was turning on this happened, i
-
Hai I am creating a Photoshop panel using Adobe configurator4 and i want to do buttons which have name already defined eg Silo, Retouch, Skin etc to rename both single or multiple layer which are selected . There are many script which will open it
-
What is the need of xi in idoc to idoc related scenarios
Hi all, Can any one explain me what is the need of xi in idoc to idoc related scenarios.\ we can Send Idoc with out Xi right?