Distinct function in view
Hi i am having one query which is not getting executed in 10g database but in 9i it is getting executed.
it is a select statement which uses distinct function on a view.
Eg. select distinct(custid) from cust_view cview (where custid is the column present in the view cust_view and cview is the alias name)
is it the problem with the database or the query.
If i give select (custid) from cust_view cview it is working.is there any parameter to be set in database or distinct or any other function can't be used on the views.
pls help
Instead of waiting for the query to be execute. you can only fetch the execution plan of the query. like:
SQL> set autot off
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> set autot traceonly
SQL> select * from emp where empno = 7369;
Execution Plan
Plan hash value: 3956160932
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 37 | 3 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| EMP | 1 | 37 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter("EMPNO"=7369)
Statistics
1 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
822 bytes sent via SQL*Net to client
381 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> set autot off
SQL>
Similar Messages
-
Create sequence, function and view all at once -script or something similar
Hi I would like to know in what way can I write a script or something like that which would define names for a sequence, function and a view in the beginning (for example TEST_SEQ, TEST_FJ, TEST_VIEW...) and after that create this sequence, function and view with definitions like
CREATE SEQUENCE TEST_SEQ
MINVALUE 1 MAXVALUE 999999999999999999999999999
INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE;
create or replace FUNCTION TEST_FJ RETURN NUMBER AS
tmp number;
BEGIN
select TEST_SEQ.NEXTVAL into tmp from dual
RETURN tmp;
END TEST_FJ;
and so on...
In the end I would also like to grant some rights on these objects I just created:
grant select on TEST_SEQ to public;
grant execute on TEST_FJ to public;
So my question is how to package all these things together so I can execute them from a single file in SQL Developer, and if i need to change the names of these tables I want do it in one place in the beginning of this script (or something like a script, I'm not sure what)...
Thanks in advance!hi,
hope help you...
this is my basic generic solution...
create or replace procedure createSequence( psequenceName in varchar2 ) is
begin
execute immediate 'create sequence ' || psequenceName ;
execute immediate 'grant select on ' || psequenceName || ' to public ';
end ;
create or replace function getNextVal( psequenceName in varchar2 ) return number is
queryText varchar2(100) := 'select <sequence_name>.nextval into :next_value from DUAL' ;
next_value number ;
begin
queryText := replace(queryText,'<sequence_name>',psequenceName);
execute immediate queryText into next_value ;
return( next_value ) ;
end ;
Edited by: edogt on Nov 27, 2008 5:33 AM
Edited by: edogt on Nov 27, 2008 5:35 AM
Edited by: edogt on Nov 27, 2008 5:35 AM -
Using Max Function in View Criteria
Hi
I am having a requirement where by i need to make use of max function in view criteria but not able to see any such option. Can someone please help me over it. Here is the requirement.
In table i will be having multiple rows for an employee and i need to pick latest row based on a column say request_id For e.g.
Emp RequestId
A 1
A 2
A 3
A 4
So if i pass the employee id i should get Row Number 4. In simple SQL language I want something like this
select * from emp where empid=A and requestid=( select max(requestid) from emp where empid=A)
Just wanted to know is there any approach that i can use to do all this as part of View Criteria or any other way.
Any help is appreciated!!!
Thanks
AJOne way is this -
1)https://blogs.oracle.com/adf/entry/using_groovy_aggregate_functions_in (You might need to create a self-referencing VL for this , try if it works using a ViewAccessor too)
OR
Order by RequestId descending in your SQL for the VO if thats ok , then have the ViewCriteria for the EmpId and programmatically pickup the first row... -
Can we call custom functions in view objects?
Can we call custom functions in view objects?these custom functions are from my backing bean...
Please help.....User,
You can certainly add code to your view objects to do whatever you like.
However, it would be considered a very bad practice to call something in the backing bean from your view object. It violates the whole MVC design principle of ADF.
Perhaps if you can share your real use case, someone will give you ideas about the best way to do it, but I, for one, would advise you to forget about calling a backing bean function from your view object.
Best,
John -
I am trying to use the DISTINCT function to work with a column that has a LONG datatype and I get an error that states: "ORA-00932: inconsistent datatypes: expected NUMBER got LONG". Here is the code I used to create the table and then run the DISTINCT function:
CREATE TABLE PS_R_EMPL_DATA
EMPLID VARCHAR2(11 BYTE) NOT
NULL,
EMPL_RCD INTEGER NOT
NULL,
R_401K_VESTING_DT DATE,
R_UNPAID_LEAVE_DT DATE,
R_PAID_LEAVE_DT DATE,
R_EXPECTED_RETN_DT DATE,
R_DISIB_VERIF_THRU DATE,
R_CIGNA_NOTIFIED VARCHAR2(1 BYTE) NOT
NULL,
R_LEAVE_REASON VARCHAR2(1 BYTE) NOT
NULL,
R_BIRTH_DUE_DT DATE,
R_PARTIAL_LEAVE_DT DATE,
R_PARTIAL_WORK_HRS NUMBER(4,2) NOT
NULL,
R_CUBE VARCHAR2(10 BYTE) NOT
NULL,
R_FLOOR VARCHAR2(10 BYTE) NOT
NULL,
R_ACQUISITION_DT DATE,
R_PENSION_START_DT DATE,
R_PENSION_END_DT DATE,
R_RMID VARCHAR2(13 BYTE) NOT
NULL,
MAIL_DROP VARCHAR2(50 BYTE) NOT
NULL,
R_NO_USERID VARCHAR2(1 BYTE) NOT
NULL,
R_KEEP_NTID VARCHAR2(1 BYTE) NOT
NULL,
R_CE_START_DT DATE,
R_NOTICE_PERIOD VARCHAR2(2 BYTE) NOT
NULL,
R_EXACT_COST_CTR VARCHAR2(6 BYTE) NOT
NULL,
R_GEN_ID VARCHAR2(3 BYTE) NOT
NULL,
COMMENTS LONG
-- Then I ran the DISTINCT function
SELECT DISTINCT EMPLID, SUBSTR(COMMENTS, 1, 10) FROM
ps_r_empl_data
Any help would be greatly appreciated.
ThanksHi,
You cannot use the Long datatype with distinct function... Oracle doesnt allow that. I am sure there is a work around though... -
Distinct function in Advance Sql
Hi
In OBIEE 10g, i need to write a distinct query for an attribute(City) in Advance SQL filter.
Please send me the syntax to use Distinct function in Advanced SQL filter.Hi,
In Advanced Filter write this
"Table"."Column Name" IN (SELECT DISTINCT "Table"."Column Name" FROM "Subject Area") -
Distinct function in Discoverer
Is there a way to use a distinct function in discoverer on a text field? I have the below calculation which concatenates 4 fields.
Point Of Sales His.Submitting Partner Number||' - '||Point Of Sales His.Cleansed Submit Partner Number||' - '||Point Of Sales His.Submitting Partner Name||' - '||Point Of Sales His.Cleansed Submit Partner Name
without a distinct function the report pulls in well over a million records and cant be used in excel. The 4 fields i am pulling in contain information that is repeated hundreds of times over within the table, but i only want to see 1 record for each unique return. Each record contains additional information which make the entire record unique, but I am not interested in that information at this time.
Any ideas?
Thanks
ChrisHi Chris
If you have millions of rows of data then although Tamir's suggestion will work you might find that it takes a while to run.
If your data does not have to be up to the minute I would consider creating a new table and populating it nightly with the data that you need. You can then use a SELECT DISTINCT query in a procedure and even index the column in question. This will make report performance must, much faster.
Best wishes
Michael -
Hi,
I need to create a SQL View in Java Dictionary component. Is it possible to use SQL functions like "UPPER", "LCASE" and so on in SELECT statement? For example I need to divide one column in table with type of TIMESTAMP on two columns in View with types DATA and TIME. But when I try to create a View in Java Dictionary like:
CREATE VIEW "Z_TMP_DOMAIN_VIEW"
("Z_TMP_DOMAIN_ID","NAME")
AS SELECT
"a"."ID", left("a"."NAME",30) "name"
FROM
"Z_TMP_DOMAIN" "a"
The build failed with the error:
Z_TMP_DOMAIN_VIEW': View is not generated
[ddgen] [Error] DtDbView 'Z_TMP_DOMAIN_VIEW': View statement is incorrect: CREATE VIEW "Z_TMP_DOMAIN_VIEW"
[ddgen] ("Z_TMP_DOMAIN_ID","NAME")
[ddgen] AS SELECT
[ddgen] "a"."ID", left("a"."NAME",30) "name"
[ddgen] FROM
[ddgen] "Z_TMP_DOMAIN" "a"
Perhaps someone knows how can I work out or work around this problem?Hi,
I need to create a SQL View in Java Dictionary component. Is it possible to use SQL functions like "UPPER", "LCASE" and so on in SELECT statement? For example I need to divide one column in table with type of TIMESTAMP on two columns in View with types DATA and TIME. But when I try to create a View in Java Dictionary like:
CREATE VIEW "Z_TMP_DOMAIN_VIEW"
("Z_TMP_DOMAIN_ID","NAME")
AS SELECT
"a"."ID", left("a"."NAME",30) "name"
FROM
"Z_TMP_DOMAIN" "a"
The build failed with the error:
Z_TMP_DOMAIN_VIEW': View is not generated
[ddgen] [Error] DtDbView 'Z_TMP_DOMAIN_VIEW': View statement is incorrect: CREATE VIEW "Z_TMP_DOMAIN_VIEW"
[ddgen] ("Z_TMP_DOMAIN_ID","NAME")
[ddgen] AS SELECT
[ddgen] "a"."ID", left("a"."NAME",30) "name"
[ddgen] FROM
[ddgen] "Z_TMP_DOMAIN" "a"
Perhaps someone knows how can I work out or work around this problem? -
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 . -
Issue in LEAD Function with View.
Hii Friends,
I am using a view in which i have used LEAD function and i am facing issue with the first record.
This is my View
DROP VIEW APPS.VW_TBL_TEST_1;
CREATE OR REPLACE FORCE VIEW APPS.VW_TBL_TEST_1 (
OHR,
EFFECTIVE_START_DATE,
EFFECTIVE_END_DATE,
PREVIOUS_COE,
PREVIOUS_SDO,
PREVIOUS_PID,
PREVIOUS_BAND,
PREVIOUS_LOCATION,
PREVIOUS_COUNTRY,
PREVIOUS_DESIGNATION,
PREVIOUS_BUSINESS_FUNCTION,
RUN_DATE,
PRODUCT_LEVEL1,
PRODUCT_LEVEL2
AS
SELECT OHR,
NVL (
LEAD (EFFECTIVE_END_DATE)
OVER (ORDER BY OHR, EFFECTIVE_START_DATE DESC)
+ 1,
EFFECTIVE_START_DATE
EFFECTIVE_START_DATE,
effective_end_date,
previous_coe,
FROM XX_WORK_HIS;
and output of this view for one employee is
OHR EFFECTIVE_START_DATE EFFECTIVE_END_DATE PREVIOUS_COE
103021253 1-May-10 ------------- AC1
103021253 15-Apr-10 ------------- 30-Apr-10 America's Corporate
103021253 23-Mar-10 ------------- 14-Apr-10 America's Corporate
103021253 1-May-09 ------------- 22-Mar-10 America's Corporate
103021253 5-Mar-09 ------------- 30-Apr-09 America's Corporate
103021253 10-Feb-09 ------------- 4-Mar-09 America's Corporate
103021253 1-Jan-09 ------------- 9-Feb-09 America's Corporate
103021253 13-Aug-08 ------------- 31-Dec-08 Creditek
103021253 1-Jan-08 ------------- 12-Aug-08 Creditek-LLC
103021253 13-Apr-07 ------------- 31-Dec-07
103021253 1-Sep-06 ------------- 12-Apr-07
103021253 12-Aug-06 ------------- 31-Aug-06
103021253 8-Aug-06 ------------- 11-Aug-06
103021253 26-Oct-10 ------------- 7-Aug-06
You can check in the last row Effective Start date is 26-Oct-10 which is wrong, why it is comming i dont know.
If i run this directly from Query insted of View i am getting the correct record.
Query-------------------
SELECT OHR,
NVL (
LEAD (EFFECTIVE_END_DATE)
OVER (ORDER BY OHR, EFFECTIVE_START_DATE DESC)
+ 1,
EFFECTIVE_START_DATE
EFFECTIVE_START_DATE,
effective_end_date,
previous_coe,
FROM XX_WORK_HIS
where OHR = '103021253';
Correct Record
OHR EFFECTIVE_START_DATE EFFECTIVE_END_DATE PREVIOUS_COE
103021253 1-May-10 ------------- AC1
103021253 15-Apr-10 ------------- 30-Apr-10 America's Corporate
103021253 23-Mar-10 ------------- 14-Apr-10 America's Corporate
103021253 1-May-09 ------------- 22-Mar-10 America's Corporate
103021253 5-Mar-09 ------------- 30-Apr-09 America's Corporate
103021253 10-Feb-09 ------------- 4-Mar-09 America's Corporate
103021253 1-Jan-09 ------------- 9-Feb-09 America's Corporate
103021253 13-Aug-08 ------------- 31-Dec-08 Creditek
103021253 1-Jan-08 ------------- 12-Aug-08 Creditek-LLC
103021253 13-Apr-07 ------------- 31-Dec-07
103021253 1-Sep-06 ------------- 12-Apr-07
103021253 12-Aug-06 ------------- 31-Aug-06
103021253 8-Aug-06 ------------- 11-Aug-06
103021253 7-Jul-03 ------------- 7-Aug-06
Check the last row EFFECTIVE_START_DATE its 7-Jul-03 which is the correct record.
I am not getting If i am using same condition in View why i am getting incorrect record at last row.
Please suggest.
Thanks
Bachan.My problem is solved, but can you tell me what is the issue with the query i was using and what happens with PARTIONED BYSee the documentation for the PARTITION BY clause :
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions001.htm#i1000371
... and a previous thread dealing with the same problem you experienced : {thread:id=1044458}
(Note the post from Solomon and the link to AskTom) -
Hai..
i had a problem regarding the creation of function..
the problem is:
i need to compare the column values to get the minimum rate..
i.e
my problem goes like this..
i have a view with four fields of number datatype
how to get minimum valu of each row
eg..
weigh1 weigh2 weigh3
25 50 70
50 70 70
the result should be:
weigh1 weigh2 weigh3 result
25 50 70 25
50 70 70 50
here the result col contains min value of each row..
thanks
nandakumarcSelect w1,w2,w3,Least(w1,w2,w3) from ...
-
[iPhone] Call app delegate function from view controller
I'm using the app delegate to manage the high scores for my iPhone game. I have a function in the app delegate called something like "getAString" which I'd like to call from a view controller. I tried:
[[[UIApplication sharedApplication] delegate] getAString];
It works but gives me a warning "getAString not found in protocol(s)" and "no -getAString method found". I assume this is because the application object thinks the delegate only implements the delegate protocol methods and doesn't know about any custom methods. Is there a different/better way to do this or a way to get rid of the warning?jmzorko wrote:
I think you just need a simple cast:
[((YourAppDelegate *)[[UIApplication sharedApplication] delegate]) getAString];
... that is, if I grok your problem correctly
I have a similar problem, with this twist: the selector call is in shared-code and, hence, the [UIApplication sharedApplication] isn't of a known type. It is only known that it implements the shared callback and/or the myProtocol.
Coming from a Java background, I'd do something like this:
[((YourProtocol *)[[UIApplication sharedApplication] delegate]) getAString];
But, of course, in Obj-C, protocols aren't object-types, and objects don't "inherit" from protocols. So, what's the similar thing that I want to do, here?
Thanks! -
Poor performance of LAG function in view
Hi,
I have a query, containing a LAG function, that runs supper fast. I've created a view based on the exact query but when I select from it the performance is very slow. If I exclude the column, that gets its value from the LAG function in the underlying query, the performance is the same as the original query. Does anybody know how I can get the view's performance to be the same as the query, and why the view is so much slower when it uses the exact same SQL as the query?
Many thanks,
JohanThanks Rob,
The sql in the view is not very complicated (I removed some of the columns to make it more readable). When I select all the columns from the view except prev_credit_balance the performance is great but when I add the prev_credit_balance column performance is slow. If I run the query from the create view statement below it is fast and include the LAG function. I do select from a rather large table (but then, why doesn't the query give the same problems as the view?)
CREATE OR REPLACE VIEW CALL_MONITOR_VIEW AS
select TT.Name Transaction_Type,
SUBSTR('27'||TD.Subscriber_UID,1,11) Msisdn,
TD.Subscriber_UID,
IN_PLATFORM_PREFIX,
TD.End_Of_Call,
TD.Called_Party Other_Party,
TD.Call_Duration,
TD.Value,
(TD.Value*TT.Display_Sign) DISPLAY_VALUE,
TD.Credit_Balance,
LAG(TD.credit_balance,1) over (order by TD.Subscriber_UID asc, TD.end_of_call asc) prev_credit_balance,
TD.File_UID,
TD.File_Type_UID,
FT.Name File_Type
from Transaction_Detail TD,
Transaction_Type TT,
File_Types FT,
In_Platform ip,
TC_Unitization_Map UM
where TD.Transaction_Type_UID = TT.Transaction_Type_UID(+)
and TD.IN_PLATFORM_UID = IP.IN_PLATFORM_UID(+)
and TD.File_Type_Uid = FT.File_Type_uid
and TD.Provider_ID = UM.Provider_ID (+)
) -
Shutdown function and view album art by Genre..
Is it only me that would find a Shutdown at end of album function useful? When your lying in bed listening to music, i don't want to have to get up and switch my machine off, i want an option in iTunes that will shutdown my machine at the end of the playlist or Album.. any one else think thats useful?
What about viewing Album art via Genre? When you select a Genre, then click on the scroll album art button it shows the whole of your library!?!?! how stupid! i only want the albums in that Genre!
Grr... how many times i've sent that to Apple as a feature request i have no idea... since itunes 5 i think!! C'MON!Please add your computer info to your profile using the My Settings link on the right side of the page.
I don't know about Windows, but on a Mac, there is a scheduled sleep/shutdown option in the Energy Saver Preference pane.. There are also quite a few free and cheap options available for download that can do it. If you're on Windows, you might look around to see what options you have.
When you select a Genre, then click on the scroll album art button it shows the whole of your library!?!?! how stupid! i only want the albums in that Genre!
Not sure where you're selecting the Genre, but if you're talking about the Browse option (the eye icon), when you switch to CoverFlow view, you are no longer Browsing, you are in CoverFlow.
If you switch between the different views (List, AlbumArt, CoverFlow) you'll notice that the Browse function is disabled for CoverFlow.
Of course, you could always create Smart Playlists to group your songs by Genre which would eliminate the need to rely on the Browse function.
Message was edited by: Mike N. (nahyunil) -
Duplicate functionality of viewer toolbar
<span style="font-size: 9pt; font-family: Verdana"><p>With Webelements is it possible to duplicate some of the functionality of the Crystal viewer toolbar. </p><p>Such as:</p><p>Export - We want the user to be able to export to Excel and rtf only. Can we use Webelements create a link button to export to either Excel or rtf?</p><p>Page Navigation - while the Crystal viewer toolbar has page navigation, we want to limit what the user can do, so we want the page navigation buttons, but not print or refresh. Can this be done?</p><p>Thanks</p></span>
hello,
below is some later syntax (beta syntax so you'll be a test subject) for hiding the above mentioned buttons. for your test report, replace the syntax in your weviewer custom function with the syntax below. the switches for hiding / showing the buttons are in the function itself and are not function parameters...i.e. the buttons are on by default, but for a particular report if you want to hide the buttons, disconnect the function from the repository and change the "true" to "false" for the applicable buttons.
let me know what you think. also, this does not negate the user from refreshing a report using the right click menu or the f5 button. you should also disable refresh in the cmc at the object level. see your admin person on that one.
// WEViewer 2.1 last revision February 23, 2007, JWiseman
Function (stringvar ToolbarDisplay, stringvar ScrollbarsDisplay)
// the following can be customized
booleanvar showprintbutton:= true;
booleanvar showrefreshbutton:= true;
booleanvar showexportbutton:= true;
// the code below should not be modified
stringvar output;
ToolbarDisplay:= lowercase(ToolbarDisplay);
ScrollbarsDisplay:= lowercase(ScrollbarsDisplay);
if ScrollbarsDisplay = "hide" then ScrollbarsDisplay:= "hidden";
if ScrollbarsDisplay = "show" then ScrollbarsDisplay:= "visible";
output:= output <br />'<DIV ID="tbCustomizer" NAME="tbCustomizer">'
''<br />'[△ | ]'
''<br />'<SPAN ID="tbShow" NAME="tbShow" STYLE="display:none;position:absolute;top:0;text-align:right;height:26;width:expression(crvObj.width);padding-right:6px;">'
'[▽ | ]'<br />'</SPAN>'
''<br />'[|| | ]'
''<br />'</DIV>'
'<br />'var tbState; var sbState;'
'if (tbState == null){tbState = "'ToolbarDisplay'"};'<br />'toolbarObj=document.getElementById("cridfulltoolbar").style;'
'crvObj=document.getElementById("cridreportpage").style;'<br />'hideObj=document.getElementById("tbHide").style;'
'showObj=document.getElementById("tbShow").style;'<br />'bodyObj=document.body.style;'
'sbdObj=document.getElementById("sbDiv").style;' +
(if ToolbarDisplay = "show" then 'sbdObj.top=-20;') +
(if ToolbarDisplay = "hide" then 'sbdObj.top=0;')
if showprintbutton = false then
output:= output <br />'printbuttonObj=document.getElementById("crprint").style;'
'printbuttonObj.display="none";';
if showrefreshbutton = false then
output:= output <br />'refreshbuttonObj=document.getElementById("refresh").style;'
'refreshbuttonObj.display="none";';
if showexportbutton = false then
output:= output <br />'exportbuttonObj=document.getElementById("exportdlg").style;'
'exportbuttonObj.display="none";';
if ToolbarDisplay in ["hide", "show"] then
output:= output <br />'if (tbState!="show") {toolbarObj.display="none";showObj.display="";hideObj.display="none";}'
'else {showObj.display="none";hideObj.display="";}'<br />'function delToolbar(chgState) {'
'Â Â if (chgState=="show") {tbState="show";toolbarObj.display="";showObj.display="none";hideObj.display="";}'<br />'Â Â else {tbState="hide";toolbarObj.display="none";showObj.display="";hideObj.display="none";}'
'Â Â if (tbState=="show"){sbdObj.top=-20;}else {sbdObj.top=0;}'+
if ToolbarDisplay = "suppress" then
output:= output +
'toolbarObj.display="none";showObj.display="none";hideObj.display="";';
if ScrollbarsDisplay in ["hidden", "visible"] then
output:= output <br />'sbdObj.display="";'
'if (sbState==null){sbState="'ScrollbarsDisplay'"};'<br />'if (sbState!="visible"){bodyObj.overflow="hidden";}else {bodyObj.overflow="";}'
'function delScrollbar() {'+
'Â Â if
(sbState=="hidden"){sbState="visible";bodyObj.overflow="";}'<br />'Â Â else {sbState="hidden";bodyObj.overflow="hidden";}'
if ScrollbarsDisplay = "suppress" then
output:= output +
'bodyObj.overflow="hidden";';
output:= output + '';
if ToolbarDisplay = "suppress" then
output:= output <br />'<style type="text/css">'
'.crtoolbar '+
output;
Maybe you are looking for
-
CS5.5 Gripes/CS6 Wish List (from the perspective of an FCP switcher)
I have been a Final Cut Pro user for more than 10 years (starting with version 1.2 on a 500 MHz G4). Final Cut Pro X is a disaster, but that’s a well-covered topic for a different forum. After experimenting with Premiere Pro CS5.5 for a few months,
-
I am looking for a way to print out my slides in a word document so that my copy editor can not only read my slide notes, but also view what is on my slide making sure there are not any errors. When I build my slides, I stack images up with things fa
-
Hi, Current Interface Flow - File (xml) to Idoc (single Idoc type) Thirdparty sends a File for Goods Receipt. This file may have multiple orders. Orders are sorted in an xslt by ORDNUM. Each record has a delivery type (Deliver Type PO or Delivery Typ
-
Hi, this piece of code use to work for opening a new browser, but now it has problem in opening browser window. There is no exception thrown, can anyone has suggestion whats wrong in this. I am using JRE1.3. I have a feeling that something is conflic
-
Gantt Chart in Project Status Report
Hi Folks, We are doing a custom development and creating our own Project Status Report PDF form. Is there a way (standard FM or otherwise) to generate a Gantt chart and show it on the PDF form. The Gantt chart itself is not of the whole project struc