Question regarding an inline view or function inside SQL
Hi All,
I want to know whether using an inline view with in an sql query is better or a function call within the sql query is better.
When I check the explain plan in both the case I can see no difference in the cost.
Appreciate your valuable suggestions on this.
Thanks,
Maddy K.
Hi, Maddy,
It depends. The answer to this kind of question is always "it depends" on several factors. It would help if you gave a specific example.
In general, a function is not an alternative to an in-line view. They're so different, that I suspect I don't really understand the question. Also, I don't understand why you're concerened with in-line views, and not with, for example, regular views or WITH clause sub-queries.
In general, calling user-defined functions from SQL statements is slow. If there's a simple way to get the same results without calling a user-defined function, then it will probably be faster not to call the function.
Don't pay much attention to the cost that explain plan gives it. It doesn't mean much to you.
Similar Messages
-
Question regarding the pen tool (w/ picture inside)
Hello everyone! I have a question regarding the pen tool. I think this picture is very helpful for my question:
So in this pic is an orange rectangle and within that rectangle is a blue stripe. I would like the blue stripe to be perfectly flush (not over, and not under) the edge of the rectangle. For example, on the bottom end of the blue stripe, you can clearly see that the stripe does not extend far enough to the edge of the orange rectangle. At the top of the stripe, it goes a little bit over (a bit hard to see). I work with some complex shapes when using the pen tool and it is really slowing me down to compensate for over/under shapes. If it could just snap to the borders of other shapes it would make my life a lot easier. Thanks for reading and please help!A couple of thoughts come to mind:
1. You could create the shape "face on", using guides, and the points will snap to guides with snap enabled. Then you could transform the whole thing together by selecting all the shape layers.
2. Holding down the shift key while dragging a point seems to cause it to snap to some things under some conditions. However, on having just tried to recreate what you're showing I didn't see the proper snap happening sometimes.
3. There's the full manual approach, of course where you zoom into thousands of percent and move the points by hand manually. I assume this is what you're trying to avoid.
-Noel -
Can i use function inside sql in a form ?????
Here SERIAL_NUM is a function, this sql work fine in TOAD and SQLPLUS but inside the form iam getting error saying "function serial_num cannot be used in a sql" Why is it like that ?? Is there anyother way to execute this sql ?
cursor c1 is
SELECT msn.ATTRIBUTE7 Order_No,
SERIAL_NUM(i.SERIAL_NUMBER) Serial_No,
msn.ATTRIBUTE5 Firmware,
msn.ATTRIBUTE15 Site_Pref
FROM atrd.INSTALLER_INFO i,
mtl_serial_numbers msn
where SERIAL_NUM(i.SERIAL_NUMBER)=msn.SERIAL_NUMBERhi,
yes of course you can use the functions in sql as well as in forms( within sql statements).
here i think you are not connected to the Specified user which is having the function Serial_num
or other thing may that ur syntax
just check both of them that may help you.
enjoy
Tehzeeb Ahmed -
Question regarding the If-then-else function
Hi folks ,
I have been constantly putting threads on this subject for the past day, hope it doesn't annoy any one here.
My scenario is really simple, and i am almost close to the solution, but there is just 1 thing missing and i know that is a very small thing, could be the context too. Hope some one can help by pointing it out>
Mapping:
In my source i have a header(0-unbounded) & detail(0-unbounded). At a given instant either header / detail will occur in source, depending on that the target node "response" will occur(0-n times)
i have achieved this in the mapping.
the problem is this:
Both the Header/Detail have a field in it called Sequence# which is mandatory and can occur only once in the Header/Detail node.
Now depending on what occurs: ie Header/Detail i need to map that particular seq# into my Target Respone's SEQ_#.
I have done the mapping for this and have done a standalone testing.
Mapping: Check if HEADER EXISTS, if yes? then map the HEADER.Seq# to TARGET.Seq#
Here are my findings:
Scenario1: 3 header nodes(No Detaili) each with a seq # in it. Out put 3 Target node each with 3 seq # in it.
Scenario2: 2 Detail Nodes(No header) each with a seq # in it. Output fails to produce the 2nd Target Structure's Seq# and Fails
When i look into the Display Queue in the mapping , i examine the iF-Then-Else function:
Since HEADER doesn't exist i c 1 Suppress in my If-Condition hence the if condition becomes FALSE., now since its false its supposed to map the seq# from my detail. (This case i have 2 ).
But in the output of the IF-Then Else, i get out only 1 seq # which is the 1st one,
What i am thinking is that the exists condition is giving out only 1 FALSE instead of 2, If there were 2 false from the exists then i would have had both the seq # in my output,
I hope my question is clear, Would appreciate anysort of help . And i apologize if I seem to be brigning up the same question over again experts.
I don't wnt to create a UDF for this matter because i know there is something i am not doing right,
HankSorry I could not give my udf in my last post.
Udf1:
Create a context udf and name it as RemoveSuppress. Take two input arguments a and b. Imports: java.*;
Add this code:
//write your code here
boolean found = false;
for (int i=0;i<a.length;i++) {
if (a<i>.equals(b[0])) {
found = true;
break;
if (found == true)
result.addValue("true");
else
result.addValue("false");
Then it should work.
Regards,
---Satish -
Questions on ICR reconciliation process 002 (functionality)
Dear all,
I am implementing ICR reconciliation process 002 and I have some
questions regarding process's behaviour and functionality. I have set
u201CDefine Rules for Document Assignments" as following:
1 POPER Posting period = Equal POPER Posting
period
10 RTCUR Transaction currency = Equal RTCUR
Transaction currency
20 TSL Transaction Currency -1 Opposite Amount (Only for Value
Fields) TSL Transaction Currency
4/I need to reconcile accounts (process 002) not only for GL accounts w/o
open items but also Open Items GL accounts and vendor and customer GL
accounts (reconciliation accounts).
I do not need to manage open items nor vendor customer items (which would
be supported with processes 001 and 003); I just need to reconcile these
accounts as if they were GL accounts. I have tested in my test client and
seems to work. Is it possible?
CheersHello Rafael,
The advantage of using process 001 or 003 is that you get a clear overview of the unpaid receivables and payables taking key date information into account. This is why the recommended procedure for dealing with payables and receivables is to use process 001 or process 003. You basically have a different angle when analyzing open items...
Having said all this it is possible to include any type of account in process 002. All you need to do is to not be quite as restrictive in your ledger selections. Then other line items will be posted to your ledger and can be analyzed within process 002. If this is what you need then go ahead and do it. Just make sure that you are sure your customer does not want to analyze receivables and payables on a different level...
Hope this helps,
Ralph -
Questions regarding Optimizing formulas in IP
Dear all,
This weekend I had a look at the webinar on Tips and Tricks for Implementing and Optimizing Formulas in IP.
Im currently working on an IP-implementation and encounter the following when getting more in-depth.
Id appreciate very much if you could comment on the questions below.
<b>1.)</b> I have a question regarding optimization 3 (slide 43) about Conditions:
If the condition is equal to the filter restriction, then the condition can be removed.
I agree fully on this, but have a question on using the Planning Function (PF) in combination with a query as DataProvider.
In my query I have a filter in the Characteristic restriction.
It contains variables on fiscal year, version. These only allow single value entry.
The DataProvider acts as filter for my PF. So Id suppose I dont need a condition for my PF since it is narrowed down on fiscal year and version by my query.
<b>a.) Question: Is that correct?</b>
I just one to make sure that I dont get to many records for my PF as input. <u>How detrimental for performance is it to use conditions anyway?</u>
<b>2.)</b> I read in training BW370 (IP-training) that a PF is executed for the currently set filter (navigational state) in the query and that characteristics that are used in restricted keyfigures are ignored in the filter.
So, if I use version in the restr. keyfig it will be ignored.
<b>Questions:
a.) Does this mean that the PF is executed for all versions in the system or for the versions that are in the filter of the Characteristic Restrictions and not the currently set filter?</b>
<b>b.) Id suppose the dataset for the PF can never be bigger than the initial dataset that is selected by the query, right?
c.) Is the PF executed anaway against navigational state when I use filtering? If have an example where I filter on field customer thus making my dataset smaller, but executing the PF still takes the same amount of time.
d.) And I also encounter that the PF is executed twice. A popup comes up showing messages regarding the execution. After pressing OK, it seems the PF runs again...</b>
<b>3.)</b> If I use variables in my Planning Function I dont want to fill in the parameter VAR_VALUE with a value. I want to use the variable which is ready for input from the selection screen of the query.
So when I run the PF it should use the BI-variable. Its no problem to customize this in the Modeler. But when I go into the frontend the field VAR_VALUE stays empty and needs a value.
<b>Question:
a.) What do I enter here? For parameter VAR_NAME I use the variable name, but what do I use for parameter VAR_VALUE? Also the variable name?</b>
<b>4.)</b> Question regarding optimization 6 (slide 48) about Formulas on MultiProviders:
'If the formula is using data of only one InfoProvider but is defined on a MultiProvider, the the complete formual should be moved to the single base InfoProvider'.
In our case we have three cubes in the MP, two realtime and one normal one. Right now we have one AggrLevel (AL) on op of the MP.
For one formula I can use one cube so it's better to cretae another AL with the formula based on that cube.
For another formula I need the two <u>realtime</u> cubes. This is interesting regarding the optimization statement.
<b>Question:
a.) Can I use the AL on the MP then or is it better to create a <u>new</u> MP with only these two cubes and create an AL on top of that. And than create the formula on the AL based on the MP with the two cubes?</b>
This makes the architecture more complex.
Thanks a lot in advance for your appreciated answers!
Kind regards, Harjan
<b></b><b></b>Marc,
Some additional questions regarding locking.
I encounter that the dataset that is locked depends on the restrictions made in the 'Characteristic Restrictions'-part of the query.
Restrictions in the 'Default Values'-part are not taken into account. In that case all data records of the characteristic are locked.
Q1: Is that correct?
To give an example: Assume you restrict customer on hierarchy node in Default Values. If you want people to plan concurrently this is not possible since all customers are locked then. When customer restriction is moved to Char Restr the system only locks the specific cutomer hier node and people can plan concurrently.
Q2: What about variables use in restricted keyfigures like variable for fy/period? Is only this fy/period locked then?
Q3: We'd like to lock on a navigational attribute. The nav attr is put as a variable in the filter of the Characteristic Restrictions. Does the system then only lock this selection for the nav.attr? Or do I have to change my locking settings in RSPLSE?
Then question regarding locking of data for functions:
Assume you use the BEx Analyzer and use the query as data_provider_filter for your planning function. You use restricted keyfigures with char Version. First column contains amount for version 1 and second column contains amount for version 2.
In the Char Restrictions you've restricted version to values '1' and '2'.
When executing the inputready query version 1 and 2 are locked. (due to the selection in Char Restr)
But when executing the planning function all versions are locked (*)
Q4: True?
Kind regards, Harjan -
Questions regarding new functionalities in EhP 4 - Reporting Financials 2
Dear Forum,
in a project we would like to use some new functionalities from Reporting Financials 2 - ie. Datasource 0FI_AA_20 for Depreciation and Amortization loading to BI for following years as this can not be done by old extractor.
We are know looking for reliable information about impact and changes that are made in ERP if we switch on the functionality Reporting Financials 2 via SFW5? Will old extracors work nevertheless? Will all reports in ERP work without problems? Is there any impact on business processes? Or is this just additional functionality which will not affect current implementation?
Can anybody give information about this?
Thanks, regards
Lars
Edited by: Lars Hermanns on Jun 2, 2010 10:29 AM
Edited by: Lars Hermanns on Jun 2, 2010 10:29 AMMarc,
Some additional questions regarding locking.
I encounter that the dataset that is locked depends on the restrictions made in the 'Characteristic Restrictions'-part of the query.
Restrictions in the 'Default Values'-part are not taken into account. In that case all data records of the characteristic are locked.
Q1: Is that correct?
To give an example: Assume you restrict customer on hierarchy node in Default Values. If you want people to plan concurrently this is not possible since all customers are locked then. When customer restriction is moved to Char Restr the system only locks the specific cutomer hier node and people can plan concurrently.
Q2: What about variables use in restricted keyfigures like variable for fy/period? Is only this fy/period locked then?
Q3: We'd like to lock on a navigational attribute. The nav attr is put as a variable in the filter of the Characteristic Restrictions. Does the system then only lock this selection for the nav.attr? Or do I have to change my locking settings in RSPLSE?
Then question regarding locking of data for functions:
Assume you use the BEx Analyzer and use the query as data_provider_filter for your planning function. You use restricted keyfigures with char Version. First column contains amount for version 1 and second column contains amount for version 2.
In the Char Restrictions you've restricted version to values '1' and '2'.
When executing the inputready query version 1 and 2 are locked. (due to the selection in Char Restr)
But when executing the planning function all versions are locked (*)
Q4: True?
Kind regards, Harjan -
Regardin handling exception in a function, while using that function in sql
Hi gurus,
I have a question regarding logging exceptions while using functions.
I wrote a separate package to handle errors, where i have a procedure.
In this proc i'm logging my error into a table and then raise the error to the front end.
Ex:
proc_log_and_raise -- this proc... inserts my error into a table and then raisenow i included this error procedure in all functions and procedures.
consider an example with a sample procedure and function.
function func_1(( v_var varchar2) return varchar2 is
begin
select column2
from table2
where col1 = v_var;
exception
when others then
proc_log_and_raise;
end;
procedure proc_1( v_var varchar2) is
begin
select func_1(v_var) -- error occurs here..
from table_a
where col1 = v_var;
exception
when others then
proc_log_and_raise;
end; now i do
exec proc_1( v_var );but now my problem is, when an error occurs in func_1, i'm getting an error with DML operation ( as we are inserting into error table)
ORA-14551: cannot perform a DML operation inside a query.
so what i want to do is, log both function and procedure where error occured.
So is there any other better way, we can write our exception handling, so that i can log error and use function in a select statement.
thank you.I changed my procedure a little, to make it simple.
FUNCTION PKG_WEEKLY.FUNC_1
RETURN NUMBER IS
exc exception;
BEGIN
raise exc;
RETURN v_provr_rcoupt;
EXCEPTION
when exc then
PKG.PKG_ERROR.USP_LOG_AND_RAISE(
'batch_1',
'func_1',
SQLCODE,
DBMS_UTILITY.FORMAT_ERROR_STACK || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE());
END FUNC_1;
PROCEDURE PKG_WEEKLY.PROC_1(
cur_details OUT sys_refcursor) IS
BEGIN
OPEN cur_details FOR
SELECT NVL(PKG.PKG_WEEKLY.FUNC_1,0)) FROM DUAL;
EXCEPTION
WHEN OTHERS THEN
REPORT_APP_PKG.PKG_REPORT_ERROR.USP_LOG_AND_RAISE(
'batch_1',
'PROC_1',
SQLCODE,
DBMS_UTILITY.FORMAT_ERROR_STACK || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE());
END PROC_1; Now i execute it.
exec PKG_WEEKLY.PROC_1(:cursor); Error logged into the table:
242 batch_1 func_1 ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "REPORT_APP_PKG.PKG_REPORT_WEEKLY_CAO", line 230
04/14/2009 16:09:25
ERRORS displayed to the front end:
ORA-20156: ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "PKG.PKG_WEEKLY", line 230
ORA-06512: at "PKG.PKG_ERROR", line 48
ORA-06512: at "PKG.PKG_ERROR", line 226
ORA-06512: at "PKG.PKG_WEEKLY", line 261
thank you -
Oracle Execution Time for function inside view
Hi Guys,
i would like to ask if i call a function inside a view , how does it behave in term of execution time and performance
For Example i have a view as below
create or replace view CUST.CUST_VIEW
select a.nice , a.getCustomDisplay(a.name,a.pin,a.dos,b.master_key) as custom from CUST.customer as a , CUST.master as b
where a.idno = b.main_id_no
AND the function look like this
create or replace function getCustomDisplay(a varchar2,b varchar2,c varchar2,d varchar2)
begin
select * from CUST.MAPPING_MATRIX order by idno asc;
for loop
//logic goes here to determine the result return from matrix
end
My Question is for example
1. If i do select * from CUST.CUST_VIEW ( return 1000 records for example ) , so the function getCustomDisplay will be executed 1000 times also right ( that means select * from CUST.MAPPING_MATRIX order by idno asc; will also be executed 1000 times ) ?
2. If i do select * from CUST.CUST_VIEW where rownum <= 20 , how many times getCustomDisplay() function will be executed ?
The reason i ask this because recently we saw a few million execution times per day from AWR report for this query
"select * from CUST.MAPPING_MATRIX order by idno asc;"
But when i investigate , and put a logger whenever it call getCustomDisplay , the query above as mention in item no 2 only will be executed as many as the record that will be returned from ( view + where condition ).
3. will it affect performance if my view return a lot of records ? or is there any way to improve it?
ThanksHi
i have other solutions that seems work for reducing number of execution times but do you think its scalable and feasible ?
CREATE OR REPLACE package body ACER.TYPE_CAT_PASS_UTIL_TEST as
*/* Private package data */*
TYPE g_rec IS RECORD (
id_no VARCHAR2 (4),
type_pass VARCHAR2 (3),
scheme_ind VARCHAR2 (5),
cat_pass VARCHAR2 (2),
entrepass VARCHAR2 (2),
display_type_pass VARCHAR2 (15),
display_cat_pass VARCHAR2 (5),
display_type_pass_desc VARCHAR2 (80),
rule_id VARCHAR2 (5)
TYPE g_tab_type IS TABLE OF g_rec INDEX BY BINARY_INTEGER;
g_tab g_tab_type;
i BINARY_INTEGER;
procedure initializeTypePassMatrix(test IN varchar2) as
begin
if(g_tab.COUNT < 1)then
FOR appln_rec in (
SELECT tb_type_cat_pass_matrix.id_no,
tb_type_cat_pass_matrix.type_pass,
tb_type_cat_pass_matrix.scheme_ind,
tb_type_cat_pass_matrix.cat_pass,
tb_type_cat_pass_matrix.entrepass,
tb_type_cat_pass_matrix.display_type_pass,
tb_type_cat_pass_matrix.display_cat_pass,
tb_type_cat_pass_matrix.display_type_pass_desc,
tb_type_cat_pass_matrix.rule_id
FROM tb_type_cat_pass_matrix ORDER BY id_no asc)
LOOP
dbms_output.put_line('g_tab.COUNT before insert: ' || g_tab.COUNT);
i := g_tab.COUNT + 1;
g_tab (i).id_no := appln_rec.id_no;
g_tab (i).type_pass := appln_rec.type_pass;
g_tab (i).scheme_ind := appln_rec.scheme_ind;
g_tab (i).cat_pass := appln_rec.cat_pass;
g_tab (i).entrepass := appln_rec.entrepass;
g_tab (i).display_type_pass := appln_rec.display_type_pass;
g_tab (i).display_cat_pass := appln_rec.display_cat_pass;
g_tab (i).display_type_pass_desc:= appln_rec.display_type_pass_desc;
g_tab (i).rule_id := appln_rec.rule_id;
DBMS_OUTPUT.put_line ('g_tab.count after insert: ' || g_tab.COUNT);
END LOOP;
else
DBMS_OUTPUT.put_line ('g_tab>=1, no need to initialize');
end if;
exception
when others then
dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
Logger.ERROR('TYPE_CAT_PASS_UTIL.initializeTypePassMatrix',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
end initializeTypePassMatrix;
procedure populateTypeCatPassFullDesc(typePass IN varchar2, schemeInd IN varchar2,catPass IN varchar2,entrePass IN varchar2, displayTypePass IN OUT varchar2,displayTypePassDesc IN OUT varchar2, displayCatPass IN OUT varchar2 )is
v_displayTypePass varchar2(15) :='-';
v_displayTypePassDesc varchar2(100) :='-';
v_displayCatPass varchar2 (2):='-';
v_type_pass varchar2(3) := '';
v_scheme_ind varchar2(5) := '';
v_cat_pass varchar2(2);
v_entrepass varchar2(2);
v_flag_valid_1 boolean:=false;
v_flag_valid_2 boolean:=false;
v_flag_valid_3 boolean:=false;
v_flag_valid_4 boolean:=false;
v_appln_rec g_rec;
begin
dbms_output.put_line('line 1');
initializeTypePassMatrix('test');
FOR nomor in g_tab.FIRST .. g_tab.LAST
LOOP
v_appln_rec := g_tab(nomor);
dbms_output.put_line('line 2.1');
v_flag_valid_1 :=false;
v_flag_valid_2 :=false;
v_flag_valid_3 :=false;
v_flag_valid_4 :=false;
v_type_pass := v_appln_rec.type_pass;
v_scheme_ind := v_appln_rec.scheme_ind;
v_cat_pass := v_appln_rec.cat_pass;
v_entrepass := v_appln_rec.entrepass;
dbms_output.put_line('line 2.2');
if(typePass = v_type_pass or v_type_pass = 'NA') then
v_flag_valid_1:= true;
end if;
if(schemeInd = v_scheme_ind or v_scheme_ind='NA') then
v_flag_valid_2 := true;
elsif(schemeInd is null and v_scheme_ind is null) then
v_flag_valid_2 := true;
end if;
if(catPass = v_cat_pass or v_cat_pass='NA') then
v_flag_valid_3 := true;
elsif(catPass is null and v_cat_pass is null) then
v_flag_valid_3 := true;
end if;
if(entrePass = v_entrepass or v_entrepass='NA') then
v_flag_valid_4 := true;
end if;
if(v_flag_valid_1 = true and v_flag_valid_2 = true and v_flag_valid_3 = true and v_flag_valid_4 = true) then
v_displayTypePass := v_appln_rec.display_type_pass;
v_displayCatPass := v_appln_rec.display_cat_pass;
v_displayTypePassDesc := v_appln_rec.display_type_pass_desc;
dbms_output.put_line('rule id got :'||v_appln_rec.rule_id);
dbms_output.put_line('rule no got :'||v_appln_rec.id_no);
exit when (0 = 0);
end if;
END LOOP;
displayTypePass := v_displayTypePass;
displayCatPass := v_displayCatPass;
dbms_output.put_line('1type:' || v_displayTypePassDesc);
displayTypePassDesc := v_displayTypePassDesc;
dbms_output.put_line('2type:' || displayTypePassDesc);
dbms_output.put_line('type:' || v_displayTypePass);
dbms_output.put_line('cat :' || v_displayCatPass);
exception
when others then
dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
Logger.ERROR('TYPE_CAT_PASS_UTIL.populateTypeCatPass',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
end populateTypeCatPassFullDesc;
function getDisplayTypePass(typePass IN varchar2, schemeInd IN varchar2,catPass IN varchar2,entrePass IN varchar2) return varchar2 is
v_displayTypePass varchar2(15) :='-';
v_displayTypePassDesc varchar2(100) :='-';
v_displayCatPass varchar2(2) :='-';
begin
populateTypeCatPassFullDesc(typePass,schemeInd,catPass,entrePass,v_displayTypePass,v_displayTypePassDesc,v_displayCatPass);
return v_displayTypePass;
exception
when others then
dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
Logger.ERROR('TYPE_CAT_PASS_UTIL.populateTypeCatPass',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
end getDisplayTypePass;
end TYPE_CAT_PASS_UTIL_TEST;
By Using like above even i do query on select * from <some_view) it will be only one execution for
SELECT tb_type_cat_pass_matrix.id_no,*
**tb_type_cat_pass_matrix.type_pass,**
**tb_type_cat_pass_matrix.scheme_ind,**
**tb_type_cat_pass_matrix.cat_pass,**
**tb_type_cat_pass_matrix.entrepass,**
**tb_type_cat_pass_matrix.display_type_pass,**
**tb_type_cat_pass_matrix.display_cat_pass,**
**tb_type_cat_pass_matrix.display_type_pass_desc,**
**tb_type_cat_pass_matrix.rule_id**
**FROM tb_type_cat_pass_matrix ORDER BY id_no asc*
the key point is the initializeTypePassMatrix function but it seems the variable only works for one session ?
if i open new session it will be reset again . -
Question regarding decode function.
Hi friends,
I have a question regarding using decode.
I'm try'g to explain my problem using emp table.
Can you guys please help me out.
For example consider emp table, now i want to get all manager id's concatenated for 2 employees.
I tried using following code
declare
v_mgr_code number(10);
v_mgr1 number(4);
v_mgr2 number(4);
begin
select mgr into v_mgr1
from scott.emp
where empno = 7369;
select mgr into v_mgr2
from scott.emp
where empno = 7499;
select v_mgr1||'-'||v_mgr2 into v_mgr_code from dual;
end;now instead of writing 2 select statements can i write one select statement using decode function ?
Edited by: user642856 on Mar 8, 2009 11:18 PMi don't know wheter your looking for this or not.if i am wrong correct me.
SELECT Ename||' '||initcap('manager is ')||
DECODE(MGR,
7566, (SELECT Ename
FROM Emp
WHERE Empno = 7566),
7698, (SELECT Ename
FROM Emp
WHERE Empno = 7698),
7782, (SELECT Ename
FROM Emp
WHERE Empno = 7782),
7788, (SELECT Ename
FROM Emp
WHERE Empno = 7788),
7839, (SELECT Ename
FROM Emp
WHERE Empno = 7839),
7902, (SELECT Ename
FROM Emp
WHERE Empno = 7902),
'Do Not Know') Manager from empor
SELECT Ename||' '||initcap('manager is ')||
DECODE(MGR,
7566, (SELECT empno
FROM Emp
WHERE Empno = 7566),
7698, (SELECT empno
FROM Emp
WHERE Empno = 7698),
7782, (SELECT empno
FROM Emp
WHERE Empno = 7782),
7788, (SELECT empno
FROM Emp
WHERE Empno = 7788),
7839, (SELECT empno
FROM Emp
WHERE Empno = 7839),
7902, (SELECT empno
FROM Emp
WHERE Empno = 7902)) manager
from empEdited by: user4587979 on Mar 8, 2009 9:52 PM -
I have a very simple question: how do I view where Lion has autosaved my current version to (without the convoluted route of using finder)? In days gone by i'd simply use the save as function to see where it was being saved.
It's actually even easier than using Save As to see the full path to the currently open document. Just do a "Secondary click" on the document title in its window's title bar.
Like you, I relied upon Save As my whole life to check a file's location and considered it a must-have capability. Turns out it's even faster to use the single-click method to reveal the full path to the open document. It displays the entire path to the current document starting from the level of your Mac, and works for files stored on drives as well as iCloud.
If you're not sure how to do a secondary click, go into System Preferences, select Trackpad, Point & Click to find the current preference for secondary click on your Mac. If you happen to have a mouse with more than one button, it's probably the right button. As a trackpad user, I check the box to "Click or tap with two fingers," so a simple two finger tap on the title of an open document reveals its full path. This feature actually has been around for a very long time.
Note that this is not the same thing as the Autosave and Versions menu, which is exposed using a little drop down triangle to the right of the title. There is no visual clue for the presence of this feature - you just have to know it's there, probably because this feature goes all the way back to pre-OS X days. -
Is the inline view functions causes more ?
Hi,
I am getting ORA-07445 CORE DUMP ERROR...
IT IS COMING ONLY SOMETIMES WHEN EXECUTING A STRORED PROCEDURE
WITH 10 STATEMENTS.
OUT OF THEM ONE REFERES TO REFCURSOR FOR OUT PARAMETER,
THAT QUERY IS LIKE
SELECT * FROM(SELECT * FROM (SELECT * FROM(.....))));
So is this inline view statement causes for such errors?
Please help me.
thanks in advance,
khaleelThe link for the Resource mentioned in Reply 2 is
http://digital.ni.com/public.nsf/allkb/F70DB3441DC5AB9986256E97005BA825
Probably regular FFT functions from Labview Signal Analysis and Processing Pallete can be used as well. In this case the following articles are worth reading:
http://zone.ni.com/devzone/conceptd.nsf/webmain/C045A890751303A6862568650061EA98
http://zone.ni.com/devzone/conceptd.nsf/webmain/66A9E8BFA65260F886256C5A00792BC6
http://zone.ni.com/devzone/conceptd.nsf/webmain/E0F0B1FFE86A14A986256F2E0005AF4D
Regards -
Question regarding ONT connection via Ethernet and Cable cards
Hi,
We recently upgraded to Fios Quation 150Mbps/65 plan. We are not getting the advertised speeds (we only get like 5mbps upload) so verizon is sending a tech to switch the ONT connection from coax to ethernet.
I have 2 questions regarding this new setup:
1. If the ONT communicates with the Fios Actiontect router via ethernet instead of coax from now on, How will the set top boxes and Tivo-esque cable card powered device I currently have connected to coax, talk to the verizon system from now on, if coax is taken out of the equation? Will fios signal still flow through the internal coax wiring of the house? And moreover, I was under the impression that coax was the way set top boxes communicated and derived independent ip addresses from the Fios router, for on deman purposes and what not. How will this work from now on?
Quiestion 2.
Right next to the wall where the ONT sits, theres's a basement office where we have a PC that connects to the Fios system via an Actiontect MoCa adapter (ECB2500C) which I assume derives it internet connection from the Fios Actiontec router which sits upstairs in the living room.
Again, with the Coax about to be disabled next Friday in favor of ethernet connection from the ONT, I assume this PC will be left without internet because of the lack of internet signal in the coax? Is this correct?
Question 2.5 If my above assumption is correct, since this office is right on the other side of the wall where the ONT sits outside the house, would it be possible to run an ethernet wire through the wall that connects straight from the ONT to an ethernet switch inside the office, from which I would derive a connection for this basement PC (properly firewalled of course) and then, from said switch, continue running the ethernet wire that would ultimately reach the Actiontec Fios router upstairs from which the rest of the house derives it's internet? and would this setup affect in any way the propper functioning of the cable boxes in the house?
I'd appreciate your input and any help you can provide so I can have a ballpark idea of what to tell the Fios guy to do when he comes on Friday.
Cheers.
Solved!
Go to Solution.It's not valid to have two devices connected to the ONT, PC and VZ Router. Must be a single device. The ONT locks onto the MAC Address of the first device it sees. Since you have TV you should have the VZ router as the internet facing router.
Other options:
1. Have the VZ Router located next to the PC in the basement and then use Wireless for all other PC's.
2. Have the VZ Router located next to the PC in the basement but run one wire upstairs and connect a switch where other PCs and devices can connect via a wire.
Hope that helps. -
Passing a value to Inline View WHERE clause through JDev...
Hi ,
I need to pass a value to inline view which is mentioned in below VIEW query.
That view is created inside a view using jDev. Note that there are two WHERE clauses one in the Main query and the other in the Inline view.
How to set the value for the innerView.
//copied the code from Java
view.volAlertsHistroyView.setWhereClauseParam(1, new Integer(clientId));
Gives an error Missing IN or OUT parameter at index:: 1
SELECT Alerts.SEND_TIME,
Alerts.STATUS,
Alerts.TEXT ,
Groups.NAME,
VolRoles.ROLE_NAME,
VolRoles.ID as vid,
Groups.ID as gid
FROM ALERTS Alerts, ALERTS_GROUPS AlertsGroups, GROUPS Groups, VOL_ROLES VolRoles,
--Inline view starts
(SELECT GRP_ID, VRL_ID FROM vol_groups WHERE cli_id = :1) user_group_role
--Inline view ends
--Actual WHERE clause starts
WHERE ((Alerts.ID = AlertsGroups.ALT_ID)AND (AlertsGroups.GRP_ID = Groups.ID))AND (AlertsGroups.VRL_ID = VolRoles.ID)
AND AlertsGroups.VRL_ID = user_group_role.VRL_ID AND AlertsGroups.GRP_ID = user_group_role.GRP_ID
Please get back to me .
Regards
Mohan
[email protected]What happens when you change your Java code to:
view.volAlertsHistroyView.setWhereClauseParam(0, new Integer(clientId));
The ":1" does not directly relate to the where clause param index you use in Java. In your query you could also use a ":2" for example. In BC4J you still use "0" for the first param.
Sascha -
Disable inline viewing of attachments in Mavericks mail
Dear all
In previous version of the OS, there was an easy terminal fix to disable inline viewing of attachments in mail. Instead of bulky and cumbersome images and PDFs, I used to get nice, neat icons.
This terminal fix doesn't seem to work in Mavericks.
Online sources tell me to buy a separate app called Attachment Tamer to fix this.
Just wanted to find out whether there is a way to do this without additional software.
Thanks in advance
Best regards
ZamSorry, that page is a description of the basic functionality that is supposed to work in Mavericks, but is entirely failing to work for me. I tried calling Apple Support on the phone, and went through many attempted fixes with the experts, but they eventually threw up their hands in despair.
Maybe you are looking for
-
but my laptop will. so my grandson restarted the home network and the ipad 2 still wont pick it up. but my laptop will pick the home network.
-
System Preferences crashes when I open screensaver panel after iTunes SS.
Whenever I try to open the screen saver panel in System Preferences (I'm actually just trying to change my desktop background, but I have to go through there first), System Preferences crashes. It seems to have started happening after I changed the n
-
In inadvertently created a new event (it is empty of any pictures) and want to delete it, but I cannot seem to do so. I did a search here, but the recommendation to drag it to the trash or hit the delete button did not work. Is there a way to delete
-
Starting TNSLSNR strange message
I am using 10.2.0 under Fedora Core 4 During startup of TNSLSNR i get a very strange message. see last line of following block Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOS
-
My ibook g4 1.33ghz 14 inch is not charging and the fault is the dc in board. If I push the power connector into the socket very firmly the it charges but otherwise it doesn't so the fault is internal. How can i remove the case without the special to