Layout with functions
Hi,
Can we apply the planning function to input ready queries?
If yes, pls let me know.
Thanks®ards,
sohail.
Hi Bindu,
I have a requirement where i need to develop the Planning layout. What user enter the keyfigure values in Input ready query that values should copy into other version. Iam going to use same set of data for both. But I think to develop input ready query we should go upto filter tab only. Then how we can implement the copy function to this layout.
Thanks®ards,
Md.Irfan
Similar Messages
-
Hierarchial Layout Saving with function modules
Hai to all
i am facing a problem while saving layout in Hierarchial list display with function module.
below error message is coming when i am going save my layout.
210 if l_def_variant-variant eq rs_variant-variant.
211 l_default = 'X'.
212 endif.
213 endif.
214
215 call function 'LT_FC_SAVE'
216 exporting
217 * I_TOOL = 'LT'
218 i_tabname = r_tabname
219 i_tabname_slave = r_tabname_slave
220 is_variant = rs_variant
221 it_fieldcat = rt_fieldcat[]
222 it_sort = rt_sort[]
223 it_filter = rt_filter[]
224 is_layout = rs_layout
225 i_default_variant = l_default
226 exceptions
227 fc_not_complete = 1
228 others = 2.
229 case sy-subrc.
230 when '0'.
231 message s018(0k).
232 when '1'.
>>>>> message x000(0k) with 'LT_FC_SAVE' sy-subrc
234 raising fc_not_complete.
235 endcase.
it is very urgent...
Subhash.Mdata: ls_vari type disvariant.
DATA: w_repid TYPE sy-repid.
ls_vari-report = w_repid.
ls_vari-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
i_callback_program = w_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
is_layout = wa_layout
it_fieldcat = i_fcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = i_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
i_default = 'X'
i_save = 'X'
IS_VARIANT = ls_vari
it_events = i_event[]
IT_EVENT_EXIT =
i_tabname_header = 'I_FINAL1'
i_tabname_item = 'I_FINAL2'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
is_keyinfo = wa_key
IS_PRINT =
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IR_SALV_HIERSEQ_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab_header = i_final1
t_outtab_item = i_final2
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
i have passed the parameters
but i am getting same dump again..
Subhash.M -
Layout with rows defined by variables
Joint Venture Name is one of our characteristics. We will create a planning layout with two rows, for two different Joint Venture Names selected by the user. The Joint Venture Names should be selected by the user, preferably when opening the layout using a planning folder.
We are already using variables for making the user select year and period in other layouts. This is easily done by using variables in the planning level (or package) selection. But these values are only a part of the header area in those layouts.
Variables may easily be inserted in the rows of the layout. The problem is to set their values. The variables are defined as Fixed Value. "Restriction of Value Required by User" is checked. When entering a range in the the Selection Conditions (or nothing), we get an error message when trying to insert the variable into the layout: Variable ASSET1 could not be replaced in row. The problem is we need a single value and not a range. We would like the user to be able to select that single value. Using "Set Variables" doesn't work. We are not allowed to select a value for those variables. No error message though. If we instead enter possible values in the Selection Conditions, one per line, we may use Set Variables to select a single value per variable and then insert them into the layout. The user will then be able to change value later. However, the number of values is large and may change. So adding all possible values is both time consuming to do the first time and to maintain. Any ideas how to avoid this?Alrighty! Got it working =]
onClipEvent(Load){this.mt="Portfolio";
this.mc=mt // used elsewhere for transition effects
this.texter.autoSize = "left"
rt = this.texter.textWidth
_x=(_root.intro.footer.Home._x)+(_root.intro.footer.Home.rt)+10
on(rollOver){this.gotoAndPlay(11)}
on(rollOut){this.gotoAndPlay(1)}
on(release){
this.gotoAndPlay(21);
_root.sectioncontrol.nextsection=mt;}
What id like to know now if possible, is how to refresh the movie clips?
In the last "link area" of the lower linkbar I have this line of code to determine the correct placement of the first link area upon which all the rest are aligned
widther= (_x+((_root.intro.footer.Home._x)*-1)+rt)
_root.intro.footer.Home._x=(widther/2)*-1
And that places the "Home" link area in the correct location for what I'm looking for,
since all of the other areas get their x locations on load, and I dont want them sitting there checking the area every frame, I know there is a "refresh" function, I'd just like to know how to apply it (when placing after the "middle location" code for home) to the rest of the clips =] -
Upload a flat file to BPS layout with hierarchy: is it possible?
Hello, BPS people!
I used a known "HowTo...using SAPGUI" to load a flat file to BPS layout. Finally I need to use a predefined layout with several variables and hierarchical representation of characteristic values in the key field ( I can't use a special layout for file uploading!). The procedure works fine if I use a flat structure of characteristic in the key field (no hierarchy). But once I choose a hierarchical representation of key characteristic in the level (but nonhierarchical model in the first screen of layout builder!) the layout data after uploading is absolutely wrong!
1) whether is it possible to perform that without ABAP coding?
2) If not, how can I change the function modules to use hierarchy?
Thank you!
YurijSorry again!
I have solved it.
Probably nobody understood my question. First, I have tried to attach file upload function (see "How To..load a flat file into BW-BPS using SAPGUI") to the same planning level where original planning layout with hierarchical structure in the key field already existed. But now I realized that it's impossible!
SOLUTION: It is necessary to build the file upload function at the separated planning level with the same structure as that in the uploaded file. No hierarchies allowed in the "Selection" tab of planning level !!
Such upload function operates perfectly in the planning folder where original layout with the hierarchical structure of key characteristic is presented. After the file upload you can perform all further activities in the planning folder (including that with uploaded data).
Thanks,
Yurij -
I was not able to find a specific keyboard layout with the following word "Apple" in parenthesis.
Using Keyboard Layout Creator v1.4
Did someone else?
Thank you.All those layouts should work with Windows XP, Vista, 7 and 8...
You get the parenthesis, the @ sign and other symbols exactly on the same key on OS X and Windows (see last 2 screen shots for the Swiss French layout).
The only difference is that on Windows to "alt/option" you must either [ctrl] + [alt left] or [alt right].
For a reminder if you want to toggle between "standard function keys" and "special features printed on each key" you can set this in "System Preferences > Keyboard" and "BootCamp Control Panel" respectively on OS X and Windows.
French AZERTY keyboard : http://apple.lu/public/archives/akfr.zip
Swiss French QWERTZ keyboard : http://apple.lu/public/archives/akswfr.zip
You may change or create your own by downloading :
http://msdn.microsoft.com/en-us/goglobal/bb964665.aspx
http://support.apple.com/kb/HT5636?viewlocale=en_US (helping page by Apple)
Keywords : BootCamp, VMWare, Parrallels, Virtual Box, ... -
Populate a calendar layout with BC Webapps
How would I go about populating a calendar view with web app items? I am not sure how something like this would be built as it seems like a semi-complex layout.
Would I use a third party app that has the calendar layout and functionality already built in? If this is the case, how would I read in the web app items as a lot of the third party javascript calendars use JSON to read in dates and html.
Thanks for any feedback.I did and my initial logic was based upon them. I don't see where it shows how to manipulate the data before writing it to the file layout fields. Maybe you can send me a link to that section?
I was hoping that I would be able to reference the file layout fields directly to allow for manipulating the field values. Re-reading the file layout section and the application engine PeopleBooks I believe I need to create a temporary record which matches the file layout fields; i.e., the second alternative that I listed. Then, make my updates to the temp record fields as I load them. Then, load them to the file layout as a row.
I'm not sure how this would break down in Application Engine; would the insert into the temp table and the writerecord be different steps/actions, etc. -
Line Layout with Reference Key in F-03
Dear all,
Iu2019m facing the following problem.
I modified the line layouts for F-03 through O7Z4S. In particular I created a line layouts with the field Reference key 1. The problem is that in F-03, using this variant, the field XREF1 appeared always blank. The same thing happens for XREF2 while for XREF3 everthing is ok.
Is something that I forgot in customizing?
Thanks in advanceDear Alberto,
I created the same - Reference Key in IDES it works if you create with text and then insert Reference key as part of Field with this.
Hope this would surely help...
Deven. -
How do I create a crystal report layout with a table and borders
My crystal report is a signin sheet. The sign in sheet has an ID column, Name column, Institution column, Place to signin column, and Weekday columns with checkboxes in each column for the visitor to checkoff.
How do I display the data that is being used int he crystal report in a table layout with borders around each cell? And is it possible to center vertical alignment of the data within eacvh cell like Excel?Blahahaha! Great answer Deb!
Seriously though... There is no vertical alignment in CR. There have been several past threads related to this issue and all of them have various workarounds. None of them are very elegant.
The best workaround I've found (especially if you are grid or borders) is to turn off the boarders for the field itself and drawl a rectangle around the field(s). Now you can place the field in the lower portion of the rectangle and adjust the rectangles height to place the field text in the center of the rectangle.
This will give you more control over the height of your elements than using a carriage return before the text.
Jason -
How to display 2 layouts with 2 different Header and Footer in a template.
Hi,
I am using XML Publisher 5.5. I have created one template which is having two layouts. I am using <?Start: Body?> and <?end body?> for displaying Headers and footers. Now my problem is, I need to display first layout with it's associated Header and footer and then second layout with other header and footer. But the two layouts should come in single template file. How is it possible?. Is there any work around? Please help me as this is the urgent requirement to my client.
Thanks.
Siva.No problem. Select Insert -> Break from the menu bar. Then select a "Section Break" - Next page.
Header 1
<?start:body?>
Page 1
<?end: body?>
Footer 1
==================Section Break (Next Page)=================
Header 2
<?start:body?>
Page 2
<?end: body?>
Footer 2
Worked like a charm.
Klaus -
the background behind my pages has turned black, how do i get it to go back to grey? i have switched between preview, normal, bleed, slug and presentation and closed and opened in design and it is still black. I can't imagine layouts with the black background please help!
or maybe the interface has been set to Dark?
Go to Preferences > Interface tab, choose Light from Color Theme dropdown on Apearance section (upper part of the window) -
COPA Report Layout with Object List (ALV)
Hi,
I have question about the COPA report layout with object list (ALV). Everytime I executed the report with ALV format, the amount for quantity column always shows with 3 decimal number, menwhile for amount column always follow by 2 decimal number.
Can anyone help me regarding this matter? I do not know how to turn off the decimal number to be 0 in this type of layout, although in the form itself I already put 0 decimal number.
Thanks.Hi,
Better to raise this issue in CO Forum. You can expect some solution.
regards -
PDF Documents with Functional Buttons - Works for IE and FireFox but not for Chrome and Safari
To all,
Good morning. Our institution developed a PDF document with functional buttons for printing and e-mailing. When the document is viewed via Internet Explorer and Firefox, the functional buttons work as expected. However if the document is viewed via Chrome and Safari, the functional buttons do not work. The workaround for those who are using Chrome and Safari, the PDF document needs to be saved to their local drive before the functional buttons work.
Has anyone experienced this issue before? If yes, what was your solution other than the workaround.
Thanks.
Babylon5Here's how to configure your browser to run Adobe Reader: http://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html
-
ALV Standard Layout with problem for excel download
Hi, i have a alv grid report with this problem:
I execute the report and see all data ok.
chose the download option to spreadsheet.
*When open the spreadshet only see headers and no data.
The report have a standard Layout with 4 of 12 column selected, if i execute this report and add a new column for the pool the download works fine, if i save this new layout as default and execute the report again the download don't work fine.
¿Some idea? ThxsJust a wild guess. In your system, check the MS excel security settings. Excel->File->options->Trust center settings. We had some similar issues with excel columns visibility when you click on the ALV spreadsheet button or download which was corrected by changing the trust center settings. I don't exctly remember which settings affect this. You may have to compare the settings with another system (If it works fine in some other system which was the case in our issue). Pls ignore if not relevant.
Regards,
Gokul -
Fluid Grid Layout with Sidebar
I am fairly new to dreamweaver and trying to build a fluid grid layout with a sidebar which needs to span the full height of the website and I am having trouble. I cant get the sidebar to span multiple columns using the fluid grids. I know I can do it with pure css using display options but wanted to know if. Can do it visually using dreamweaver's built in tools and UI.
Can someone point out if I am going about this correctly? I can provide more info if needed.
Thanks.I started using FGL when first introduced. In the meantime they have improved quite a bit, but I was so taken aback that I decided not to go down that path again.
I have used Foundation and am now using Bootstrap. Although I would prefer to use the former as I think that it is better, the general trend is towards Bootstrap.
You can start with the free of charge Bootstrap extension. -
Scaleability with Functions in SQL queries
Hi,
In one of our applications we have many views that use a packaged function in the where clause to filter data. This function uses a SYS_CONTEXT() to set and get values. There are couple of issues while using this approach:
1/ The deterministic function doesn't allow any scability with PQ-server.
2/ Another issue with this function and also the SYS_CONTEXT-function, they manuipulate the estimated CBO-statistics.
CREATE TABLE TAB_I
COLUMN1 NUMBER(16, 0) NOT NULL
, COLUMN2 VARCHAR2(20)
, CONSTRAINT TAB_I_PK PRIMARY KEY
COLUMN1
ENABLE
CREATE TABLE TAB_V
I_COL1 NUMBER(16,0) NOT NULL ENABLE,
VERSION_ID NUMBER(16,0) NOT NULL ENABLE,
CRE_DATIM TIMESTAMP (6) NOT NULL ENABLE,
TERM_DATIM TIMESTAMP (6) NOT NULL ENABLE,
VERSION_VALID_FROM DATE NOT NULL ENABLE,
VERSION_VALID_TILL DATE NOT NULL ENABLE,
CONSTRAINT TAB_V_PK PRIMARY KEY (I_COL1, VERSION_ID) USING INDEX NOCOMPRESS LOGGING ENABLE,
CONSTRAINT COL1_FK FOREIGN KEY (I_COL1) REFERENCES TAB_I (COLUMN1) ENABLE
CREATE OR REPLACE
PACKAGE app_bitemporal_rules IS
FUNCTION f_knowledge_time RETURN TIMESTAMP DETERMINISTIC;
END app_bitemporal_rules;
create or replace
PACKAGE BODY app_bitemporal_rules IS
FUNCTION f_knowledge_time RETURN TIMESTAMP DETERMINISTIC IS
BEGIN
RETURN TO_TIMESTAMP(SYS_CONTEXT ('APP_USR_CTX', 'KNOWLEDGE_TIME'),'DD.MM.YYYY HH24.MI.SSXFF');
END f_knowledge_time;
END app_bitemporal_rules;
explain plan for select *
FROM tab_i
JOIN tab_v
ON tab_i.column1 = tab_v.i_col1
AND app_bitemporal_rules.f_knowledge_time BETWEEN tab_v.CRE_DATIM AND tab_v.TERM_DATIM
where tab_i.column1 = 11111;
select * from table(dbms_xplan.display);
Plan hash value: 621902595
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 95 | 5 (0)| 00:00:06 |
| 1 | NESTED LOOPS | | 1 | 95 | 5 (0)| 00:00:06 |
| 2 | TABLE ACCESS BY INDEX ROWID| TAB_I | 1 | 25 | 1 (0)| 00:00:02 |
|* 3 | INDEX UNIQUE SCAN | TAB_I_PK | 1 | | 1 (0)| 00:00:02 |
|* 4 | TABLE ACCESS FULL | TAB_V | 1 | 70 | 4 (0)| 00:00:05 |
Predicate Information (identified by operation id):
3 - access("TAB_I"."COLUMN1"=11111)
4 - filter("TAB_V"."I_COL1"=11111 AND
"TAB_V"."CRE_DATIM"<="APP_BITEMPORAL_RULES"."F_KNOWLEDGE_TIME"() AND
"TAB_V"."TERM_DATIM">="APP_BITEMPORAL_RULES"."F_KNOWLEDGE_TIME"())
Note
- 'PLAN_TABLE' is old version
- dynamic sampling used for this statement (level=2)
explain plan for select *
FROM tab_i
JOIN tab_v
ON tab_i.column1 = tab_v.i_col1
AND '10-OCT-2011' BETWEEN tab_v.CRE_DATIM AND tab_v.TERM_DATIM
where tab_i.column1 = 11111;
select * from table(dbms_xplan.display);
Plan hash value: 621902595
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 256 | 24320 | 5 (0)| 00:00:06 |
| 1 | NESTED LOOPS | | 256 | 24320 | 5 (0)| 00:00:06 |
| 2 | TABLE ACCESS BY INDEX ROWID| TAB_I | 1 | 25 | 1 (0)| 00:00:02 |
|* 3 | INDEX UNIQUE SCAN | TAB_I_PK | 1 | | 1 (0)| 00:00:02 |
|* 4 | TABLE ACCESS FULL | TAB_V | 256 | 17920 | 4 (0)| 00:00:05 |
Predicate Information (identified by operation id):
3 - access("TAB_I"."COLUMN1"=11111)
4 - filter("TAB_V"."I_COL1"=11111 AND "TAB_V"."CRE_DATIM"<=TIMESTAMP'
2011-10-10 00:00:00.000000000' AND "TAB_V"."TERM_DATIM">=TIMESTAMP' 2011-10-10
00:00:00.000000000')
Note
- 'PLAN_TABLE' is old version
- dynamic sampling used for this statement (level=2) As can be seen in the second plan the cardinality has been guessed correctly, but not in the first case.
I have also tried with:
ASSOCIATE STATISTICS WITH packages app_bitemporal_rules DEFAULT COST (1000000/*246919*/,1000,0) DEFAULT SELECTIVITY 50;
But, this just leads to a increased cost, but no change in cardinality.
The (1) problem gets solved if I directly use "TO_TIMESTAMP(SYS_CONTEXT ('APP_USR_CTX', 'KNOWLEDGE_TIME'),'DD.MM.YYYY HH24.MI.SSXFF')" in the where clause. But am not able to find a solution for the (2) issue.
Can you please help.
Regards,
Vikram RHi Vikram,
On the subject of using [url http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/statements_4006.htm#i2115932]ASSOCIATE STATISTICS, having done a little investigation on 11.2.0.2, I'm having trouble adjusting selectivity via "associate statististics ... default selectivity" but no problems with adjusting default cost.
I've also tried to do the same using an interface type and am running into other issues.
It's not functionality that I'm overly familiar with as I try to avoid/eliminate using functions in predicates.
Further analysis/investigation required.
Including test case of what I've done so far in case anyone else wants to chip in.
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL> drop table t1;
Table dropped.
SQL>
SQL> create table t1
2 as
3 select rownum col1
4 from dual
5 connect by rownum <= 100000;
Table created.
SQL>
SQL> exec dbms_stats.gather_table_stats(USER,'T1');
PL/SQL procedure successfully completed.
SQL>
SQL> create or replace function f1
2 return number
3 as
4 begin
5 return 1;
6 end;
7 /
Function created.
SQL>
SQL> create or replace function f2 (
2 i_col1 in number
3 )
4 return number
5 as
6 begin
7 return 1;
8 end;
9 /
Function created.
SQL> Created one table with 100000 rows.
Two functions - one without arguments, one with (for later).
With no associations:
SQL> select * from user_associations;
no rows selected
SQL> Run a statement that uses the function:
SQL> select count(*) from t1 where col1 >= f1;
COUNT(*)
100000
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID gm7ppkbzut114, child number 0
select count(*) from t1 where col1 >= f1
Plan hash value: 3724264953
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 139 (100)| |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
|* 2 | TABLE ACCESS FULL| T1 | 5000 | 25000 | 139 (62)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("COL1">="F1"())
19 rows selected.
SQL> Shows that default selectivity of 5% for an equality predicate against function.
Let's try to adjust the selectivity using associate statistics - the argument for selectivity should be a percentage between 0 and 100:
(turning off cardinality feedback for clarity/simplicity)
SQL> alter session set "_optimizer_use_feedback" = false;
Session altered.
SQL>
SQL> ASSOCIATE STATISTICS WITH FUNCTIONS f1 default selectivity 100;
Statistics associated.
SQL> select count(*) from t1 where col1 >= f1;
COUNT(*)
100000
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID gm7ppkbzut114, child number 1
select count(*) from t1 where col1 >= f1
Plan hash value: 3724264953
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 139 (100)| |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
|* 2 | TABLE ACCESS FULL| T1 | 5000 | 25000 | 139 (62)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("COL1">="F1"())
19 rows selected.
SQL> Didn't make any difference to selectivity.
An excerpt from a 10053 trace file had the following:
** Performing dynamic sampling initial checks. **
** Dynamic sampling initial checks returning FALSE.
No statistics type defined for function F1
No default cost defined for function F1So, crucially what's missing here is a clause saying:
No default selectivity defined for function F1But there's no other information that I could see to indicate why it should be discarded.
Moving on, adjusting the cost does happen:
SQL>exec spflush;
PL/SQL procedure successfully completed.
SQL> disassociate statistics from functions f1;
Statistics disassociated.
SQL>
SQL> ASSOCIATE STATISTICS WITH FUNCTIONS f1 default selectivity 100 default cost (100,5,0);
Statistics associated.
SQL> select count(*) from t1 where col1 >= f1;
COUNT(*)
100000
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID gm7ppkbzut114, child number 0
select count(*) from t1 where col1 >= f1
Plan hash value: 3724264953
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 500K(100)| |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
|* 2 | TABLE ACCESS FULL| T1 | 5000 | 25000 | 500K (1)| 00:41:41 |
Predicate Information (identified by operation id):
2 - filter("COL1">="F1"())
19 rows selected.
SQL> And we see the following in a 10053:
No statistics type defined for function F1
Default costs for function F1 CPU: 100, I/O: 5So, confirmation that default costs for function were found and applied but nothing else about selectivity again.
I wondered whether the lack of arguments for function F1 made any difference, hence function F2.
Didn't seem to:
Vanilla:
SQL> select count(*) from t1 where col1 >= f2(col1);
COUNT(*)
100000
SQL>
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID 2wxw32wadgc1v, child number 0
select count(*) from t1 where col1 >= f2(col1)
Plan hash value: 3724264953
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 139 (100)| |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
|* 2 | TABLE ACCESS FULL| T1 | 5000 | 25000 | 139 (62)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("COL1">="F2"("COL1"))
19 rows selected.
SQL> Plus association:
SQL>exec spflush;
PL/SQL procedure successfully completed.
SQL>
SQL> associate statistics with functions f2 default selectivity 90 default cost (100,5,0);
Statistics associated.
SQL> select count(*) from t1 where col1 >= f2(col1);
COUNT(*)
100000
SQL>
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID 2wxw32wadgc1v, child number 0
select count(*) from t1 where col1 >= f2(col1)
Plan hash value: 3724264953
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 500K(100)| |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
|* 2 | TABLE ACCESS FULL| T1 | 5000 | 25000 | 500K (1)| 00:41:41 |
Predicate Information (identified by operation id):
2 - filter("COL1">="F2"("COL1"))
19 rows selected.
SQL> Just to confirm associations:
SQL> select * from user_associations;
OBJECT_OWNER OBJECT_NAME COLUMN_NAME OBJECT_TY
STATSTYPE_SCHEMA STATSTYPE_NAME DEF_SELECTIVITY DEF_CPU_COST DEF_IO_COST DEF_NET_COST
INTERFACE_VERSION MAINTENANCE_TY
RIMS F2 FUNCTION
90 100 5
0 USER_MANAGED
RIMS F1 FUNCTION
100 100 5
0 USER_MANAGED
SQL> So.... started thinking about whether using an interface type would help?
SQL> CREATE OR REPLACE TYPE test_stats_ot AS OBJECT
2 (dummy_attribute NUMBER
3 ,STATIC FUNCTION ODCIGetInterfaces (
4 ifclist OUT SYS.ODCIObjectList
5 ) RETURN NUMBER
6 ,STATIC FUNCTION ODCIStatsSelectivity (
7 pred IN SYS.ODCIPredInfo,
8 sel OUT NUMBER,
9 args IN SYS.ODCIArgDescList,
10 strt IN NUMBER,
11 stop IN NUMBER,
12 --i_col1 in NUMBER,
13 env IN SYS.ODCIEnv
14 ) RETURN NUMBER
15 --,STATIC FUNCTION ODCIStatsFunctionCost (
16 -- func IN SYS.ODCIPredInfo,
17 -- cost OUT SYS.ODCICost,
18 -- args IN SYS.ODCIArgDescList,
19 -- i_col1 in NUMBER,
20 -- env IN SYS.ODCIEnv
21 -- ) RETURN NUMBER
22 );
23 /
Type created.
SQL> CREATE OR REPLACE TYPE BODY test_stats_ot
2 AS
3 STATIC FUNCTION ODCIGetInterfaces (
4 ifclist OUT SYS.ODCIObjectList
5 ) RETURN NUMBER
6 IS
7 BEGIN
8 ifclist := sys.odciobjectlist(sys.odciobject('SYS','ODCISTATS2'));
9 RETURN odciconst.success;
10 END;
11 STATIC FUNCTION ODCIStatsSelectivity
12 (pred IN SYS.ODCIPredInfo,
13 sel OUT NUMBER,
14 args IN SYS.ODCIArgDescList,
15 strt IN NUMBER,
16 stop IN NUMBER,
17 --i_col1 in NUMBER,
18 env IN SYS.ODCIEnv)
19 RETURN NUMBER
20 IS
21 BEGIN
22 sel := 90;
23 RETURN odciconst.success;
24 END;
25 -- STATIC FUNCTION ODCIStatsFunctionCost (
26 -- func IN SYS.ODCIPredInfo,
27 -- cost OUT SYS.ODCICost,
28 -- args IN SYS.ODCIArgDescList,
29 -- i_col1 in NUMBER,
30 -- env IN SYS.ODCIEnv
31 -- ) RETURN NUMBER
32 -- IS
33 -- BEGIN
34 -- cost := sys.ODCICost(10000,5,0,0);
35 -- RETURN odciconst.success;
36 -- END;
37 END;
38 /
Type body created.
SQL> But this approach is not happy - perhaps not liking the function with no arguments?
SQL> disassociate statistics from functions f1;
Statistics disassociated.
SQL> ASSOCIATE STATISTICS WITH FUNCTIONS f1 USING test_stats_ot;
Statistics associated.
SQL> select count(*) from t1 where col1 >= f1;
select count(*) from t1 where col1 >= f1
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-06550: line 12, column 22:
PLS-00103: Encountered the symbol "ÀÄ" when expecting one of the following:
) , * & = - + < / > at in is mod remainder not rem =>
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
SQL> So, back to F2 again (uncommenting argument i_col1 in ODCIStatsSelectivity):
SQL> disassociate statistics from functions f1;
Statistics disassociated.
SQL> disassociate statistics from functions f2;
Statistics disassociated.
SQL> ASSOCIATE STATISTICS WITH FUNCTIONS f2 USING test_stats_ot;
Statistics associated.
SQL> select count(*) from t1 where col1 >= f2(col1);
COUNT(*)
100000
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID 2wxw32wadgc1v, child number 0
select count(*) from t1 where col1 >= f2(col1)
Plan hash value: 3724264953
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 139 (100)| |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
|* 2 | TABLE ACCESS FULL| T1 | 5000 | 25000 | 139 (62)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("COL1">="F2"("COL1"))
19 rows selected.
SQL> Nothing obviously happening.
You'll note also in my interface type implementation that I commented out a declaration of ODCIStatsFunctionCost.
This post is probably already too long already so I've skipped some of the detail.
But when ODCIStatsFunctionCost was used with function F2, I presume I've made a mistake in the implementation because I had an error in the 10053 trace as follows:
Calling user-defined function cost function...
predicate: "RIMS"."F2"("T1"."COL1")
declare
cost sys.ODCICost := sys.ODCICost(NULL, NULL, NULL, NULL);
arg0 NUMBER := null;
begin
:1 := "RIMS"."TEST_STATS_OT".ODCIStatsFunctionCost(
sys.ODCIFuncInfo('RIMS',
'F2',
NULL,
1),
cost,
sys.ODCIARGDESCLIST(sys.ODCIARGDESC(2, 'T1', 'RIMS', '"COL1"', NULL, NULL, NULL))
, arg0,
sys.ODCIENV(:5,:6,:7,:8));
if cost.CPUCost IS NULL then
:2 := -1.0;
else
:2 := cost.CPUCost;
end if;
if cost.IOCost IS NULL then
:3 := -1.0;
else
:3 := cost.IOCost;
end if;
if cost.NetworkCost IS NULL then
:4 := -1.0;
else
:4 := cost.NetworkCost;
end if;
exception
when others then
raise;
end;
ODCIEnv Bind :5 Value 0
ODCIEnv Bind :6 Value 0
ODCIEnv Bind :7 Value 0
ODCIEnv Bind :8 Value 4
ORA-6550 received when calling RIMS.TEST_STATS_OT.ODCIStatsFunctionCost -- method ignoredThere was never any such feedback about ODCIStatsSelectivity.
So, in summary, more questions than answers.
I'll try to have another look later.
Maybe you are looking for
-
Item Text in FBL3N copied automatically from MIRO line item
All, When a purchase order is created to a cost centre, G/L account and cost centre are entered manually. Often Purchase Order only uses short text field as reference, ie, Material is not mandatory. MIRO process is then done for PO after GR, and the
-
Connecting comp. to HDTV- need help w/ cables
I recently bought a Panasonic HDTV, an E3 series, and i want to hook it up to my macbook. My macs a little old, bought it in the spring of 08 so it's a macbook 4,1. I've already got the sound issue taken care of, and i was wondering what adapter i ne
-
Usage tracking on OBIEE 10.1.3.3.1
Hi All, We want to implement the usage tracking on the OBIEE version 10.1.3.3.1. But the default rpd provided by the Oracle from the link: http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/usage_tracking/files/SH_UsageTracking.zip belongs to the
-
Why were the new tab and new window right click menu items reversed from FF3.6 on FF4?
I've been using Firefox since before version 1. when you right click on a hyperlink the first menu item had always been "open in new tab" and the second item was "open in new window" Now in Firefox 4, they have been reversed and it is a major pain in
-
-50 error on iMovie '09 when exporting a movie! What should I do?
I am trying to export a movie with iMovie and a message keeps popping up that it is unable to export my video due to an error. It says (-50) at the end as well. What should I do?