Help optimizing query with function

Hello experts,
I need your help optmizing this query which has a condition that matches on results of non-deterministic function. The non-deterministic functino is fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY. Values that it returns depends on contents of a table, so I can't really create a function index.
Any input will be appreciated. Thanks in advance!
Sorry I couln't format the query plan properly. Can somebody advise how? Thanks again!
Giovanni
explain plan for
WITH tg AS
(SELECT taxgroup_code FROM taxgroup
WHERE taxgroup_code = 'TAXGROUP2' --?
AND taxgroup_delete_ind = 'N' AND taxgroup_active_ind = 'A'),
le_hb AS
(SELECT tgi.taxgroup_code, tgi.legalentity_id, tgi.hyperionbase_id, ou.orgunit_code, ou.hyperionbase_code
FROM tg, taxgroupitem tgi, orgunit_vw ou
WHERE tg.taxgroup_code = tgi.taxgroup_code
AND tgi.legalentity_id = ou.legalentity_id AND tgi.hyperionbase_id = ou.hyperionbase_id
UNION
SELECT tgi.taxgroup_code, tgi.legalentity_id, ou.hyperionbase_id, ou.orgunit_code, ou.hyperionbase_code
FROM tg, taxgroupitem tgi, orgunit_vw ou
WHERE tg.taxgroup_code = tgi.taxgroup_code
AND tgi.legalentity_id = ou.legalentity_id AND tgi.hyperionbase_id IS NULL),
au AS
(SELECT appusage_code FROM appusage WHERE appusage_code = 'CONSOLIDATION'),
prs AS
(SELECT prs_key,
(CASE WHEN instr(prs_key, ':') = 0 THEN prs_key
ELSE SUBSTR(prs_key, 1, (instr(prs_key, ':')-1) ) END) first_val
FROM
(SELECT fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY(164415 --?
) prs_key
FROM dual
grs AS
(SELECT prs.*, fd.fielddata_group_sequence fd_grpseq
FROM prs, fielddata fd, le_hb
WHERE prs.first_val = fd.fielddata_value
AND le_hb.legalentity_id = fd.legalentity_id
AND le_hb.hyperionbase_id = fd.hyperionbase_id),
fdk AS
(SELECT
cd.celldef_id, fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY(fd.fielddata_group_sequence) fd_key,
fd.fielddata_value fd_val, fd.fielddata_group_sequence fd_grpseq,
ROW_NUMBER() OVER (PARTITION BY cd.celldef_id, fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY(fd.fielddata_group_sequence)
ORDER BY fd.fielddata_group_sequence) rn,
grs.prs_key
FROM le_hb, grs, fielddata fd, tablecell tc, celldef cd, tabledef td, appusage au
WHERE le_hb.legalentity_id = fd.legalentity_id AND le_hb.hyperionbase_id = fd.hyperionbase_id
AND fd.fielddata_id = tc.fielddata_id AND tc.celldef_id = cd.celldef_id
AND cd.tabledef_id = td.tabledef_id
AND grs.fd_grpseq = fd.fielddata_parent_row_sequence
and grs.prs_key = fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY(fd.fielddata_parent_row_sequence)
AND cd.celldef_key_ind = 'Y'
AND fd.fielddata_delete_ind = 'N'
AND td.tabledef_id = 2265
fda AS
(SELECT
cd.celldef_id, fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY(fd.fielddata_group_sequence) fd_key,
TO_CHAR(TO_NUMBER(SUM(fd.fielddata_value))) fd_val,
MIN(fd.fielddata_group_sequence) fd_grpseq,
grs.prs_key
FROM le_hb, grs, fielddata fd, tablecell tc, celldef cd, tabledef td
WHERE le_hb.legalentity_id = fd.legalentity_id AND le_hb.hyperionbase_id = fd.hyperionbase_id
AND fd.fielddata_id = tc.fielddata_id AND tc.celldef_id = cd.celldef_id
AND cd.tabledef_id = td.tabledef_id
AND grs.fd_grpseq = fd.fielddata_parent_row_sequence
and grs.prs_key = fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY(fd.fielddata_parent_row_sequence)
AND cd.celldef_adjustable_ind = 'Y'
AND fd.fielddata_delete_ind = 'N'
AND td.tabledef_id = 2265
GROUP BY cd.celldef_id, fedtaxpk.fedtaxpk_pkg.GETFIELDDATAGROUPSEQKEY(fd.fielddata_group_sequence),
grs.prs_key
SELECT NULL LEGALENTITY_ID, NULL hyperionbase_id, fdk.celldef_id, TO_CHAR(NULL) role_code, NULL userinfo_id, cd.celldef_adjustable_ind,
'N' celldef_editable_ind, cd.celldef_filter_code, cd.celldef_validate_rule, cd.celldef_list_code,
cd.celldef_longstring_ind, aua.appusageaccess_visible_ind celldef_viewable_ind,
cd.celldef_column_sequence, cd.celldef_column_label,
cd.celldef_column_sort_order, NULL tablecell_id, fdk.fd_grpseq tablecell_row_sequence, NULL tablecell_row_label,
'N' tablecell_delete_ind, NULL tablecell_create_by, TO_DATE(NULL) tablecell_create_dt, TO_CHAR(NULL) tablecell_update_by,
TO_DATE(NULL) tablecell_update_dt, NULL fielddata_id, TO_CHAR(NULL) datatype_code, NULL fielddata_adjref_id,
fdk.fd_grpseq fielddata_group_sequence, NULL fielddata_parent_row_sequence, NULL lookup_id,
fdk.fd_val fielddata_value, 'N' fielddata_delete_ind, TO_CHAR(NULL) fielddata_create_by,
TO_DATE(NULL) fielddata_create_dt, TO_CHAR(NULL) fielddata_update_by, TO_DATE(NULL) fielddata_update_dt,
fdk.fd_key
FROM fdk, celldef cd, appusageaccess aua, au
WHERE fdk.celldef_id = cd.celldef_id
AND cd.celldef_id = aua.celldef_id
AND aua.appusage_code = au.appusage_code
AND fdk.rn = 1
UNION ALL
SELECT NULL LEGALENTITY_ID, NULL hyperionbase_id, fda.celldef_id, TO_CHAR(NULL) role_code, NULL userinfo_id, cd.celldef_adjustable_ind,
'N' celldef_editable_ind, cd.celldef_filter_code, cd.celldef_validate_rule, cd.celldef_list_code,
cd.celldef_longstring_ind, aua.appusageaccess_visible_ind celldef_viewable_ind,
cd.celldef_column_sequence, cd.celldef_column_label,
cd.celldef_column_sort_order, NULL tablecell_id, fda.fd_grpseq tablecell_row_sequence, NULL tablecell_row_label,
'N' tablecell_delete_ind, NULL tablecell_create_by, TO_DATE(NULL) tablecell_create_dt, TO_CHAR(NULL) tablecell_update_by,
TO_DATE(NULL) tablecell_update_dt, NULL fielddata_id, TO_CHAR(NULL) datatype_code, NULL fielddata_adjref_id,
fda.fd_grpseq fielddata_group_sequence, NULL fielddata_parent_row_sequence, NULL lookup_id,
fda.fd_val fielddata_value, 'N' fielddata_delete_ind, TO_CHAR(NULL) fielddata_create_by,
TO_DATE(NULL) fielddata_create_dt, TO_CHAR(NULL) fielddata_update_by, TO_DATE(NULL) fielddata_update_dt,
fda.fd_key
FROM fda, celldef cd, appusageaccess aua, au
WHERE fda.celldef_id = cd.celldef_id
AND cd.celldef_id = aua.celldef_id
AND aua.appusage_code = au.appusage_code
ORDER BY fielddata_group_sequence, celldef_column_sequence
Query Plan:
Plan hash value: 522363234
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 6227 | 249 (2)| 00:00:03 |
| 1 | TEMP TABLE TRANSFORMATION | | | | | |
| 2 | LOAD AS SELECT | | | | | |
|* 3 | TABLE ACCESS BY INDEX ROWID | TAXGROUP | 1 | 14 | 1 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | PK_TAXGROUP | 1 | | 0 (0)| 00:00:01 |
| 5 | LOAD AS SELECT | | | | | |
| 6 | SORT UNIQUE | | 4 | 224 | 12 (59)| 00:00:01 |
| 7 | UNION-ALL | | | | | |
| 8 | TABLE ACCESS BY INDEX ROWID | ORGUNIT | 1 | 29 | 2 (0)| 00:00:01 |
| 9 | NESTED LOOPS | | 1 | 56 | 5 (0)| 00:00:01 |
| 10 | NESTED LOOPS | | 1 | 27 | 3 (0)| 00:00:01 |
| 11 | VIEW | | 1 | 10 | 2 (0)| 00:00:01 |
| 12 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B51_2EBE182 | 1 | 10 | 2 (0)| 00:00:01 |
|* 13 | TABLE ACCESS BY INDEX ROWID | TAXGROUPITEM | 1 | 17 | 1 (0)| 00:00:01 |
|* 14 | INDEX RANGE SCAN | XF1_TAXGROUPITEM_TAXGROUP | 1 | | 0 (0)| 00:00:01 |
|* 15 | INDEX RANGE SCAN | XF1_ORGUNIT_ID | 1 | | 1 (0)| 00:00:01 |
| 16 | TABLE ACCESS BY INDEX ROWID | ORGUNIT | 3 | 87 | 2 (0)| 00:00:01 |
| 17 | NESTED LOOPS | | 3 | 168 | 5 (0)| 00:00:01 |
| 18 | NESTED LOOPS | | 1 | 27 | 3 (0)| 00:00:01 |
| 19 | VIEW | | 1 | 10 | 2 (0)| 00:00:01 |
| 20 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B51_2EBE182 | 1 | 10 | 2 (0)| 00:00:01 |
|* 21 | TABLE ACCESS BY INDEX ROWID | TAXGROUPITEM | 1 | 17 | 1 (0)| 00:00:01 |
|* 22 | INDEX RANGE SCAN | XF1_TAXGROUPITEM_TAXGROUP | 1 | | 0 (0)| 00:00:01 |
|* 23 | INDEX RANGE SCAN | XF1_ORGUNIT_ID | 3 | | 1 (0)| 00:00:01 |
| 24 | LOAD AS SELECT | | | | | |
|* 25 | INDEX UNIQUE SCAN | PK_APPUSAGE | 1 | 10 | 0 (0)| 00:00:01 |
| 26 | LOAD AS SELECT | | | | | |
|* 27 | TABLE ACCESS BY INDEX ROWID | FIELDDATA | 7 | 147 | 28 (0)| 00:00:01 |
| 28 | NESTED LOOPS | | 27 | 1269 | 117 (1)| 00:00:02 |
| 29 | NESTED LOOPS | | 4 | 104 | 4 (0)| 00:00:01 |
| 30 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
| 31 | VIEW | | 4 | 104 | 2 (0)| 00:00:01 |
| 32 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B52_2EBE182 | 4 | 388 | 2 (0)| 00:00:01 |
|* 33 | INDEX RANGE SCAN | XF11_DATA_LE_HB | 117 | | 12 (0)| 00:00:01 |
| 34 | SORT ORDER BY | | 2 | 6227 | 248 (51)| 00:00:03 |
| 35 | UNION-ALL | | | | | |
| 36 | NESTED LOOPS | | 1 | 4110 | 125 (2)| 00:00:02 |
| 37 | MERGE JOIN CARTESIAN | | 1 | 4093 | 124 (2)| 00:00:02 |
| 38 | NESTED LOOPS | | 1 | 4076 | 122 (2)| 00:00:02 |
|* 39 | VIEW | | 1 | 4043 | 121 (2)| 00:00:02 |
|* 40 | WINDOW SORT PUSHED RANK | | 1 | 2099 | 121 (2)| 00:00:02 |
| 41 | MERGE JOIN CARTESIAN | | 1 | 2099 | 120 (1)| 00:00:02 |
| 42 | NESTED LOOPS | | 1 | 2099 | 119 (1)| 00:00:02 |
| 43 | NESTED LOOPS | | 1 | 2088 | 118 (1)| 00:00:02 |
|* 44 | HASH JOIN | | 1 | 2077 | 117 (1)| 00:00:02 |
|* 45 | TABLE ACCESS BY INDEX ROWID| FIELDDATA | 117 | 3744 | 28 (0)| 00:00:01 |
| 46 | NESTED LOOPS | | 466 | 28892 | 114 (0)| 00:00:02 |
| 47 | NESTED LOOPS | | 4 | 120 | 2 (0)| 00:00:01 |
|* 48 | INDEX UNIQUE SCAN | PK_TABLEDEF | 1 | 4 | 0 (0)| 00:00:01 |
| 49 | VIEW | | 4 | 104 | 2 (0)| 00:00:01 |
| 50 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B52_2EBE182 | 4 | 388 | 2 (0)| 00:00:01 |
|* 51 | INDEX RANGE SCAN | XF11_DATA_LE_HB | 117 | | 12 (0)| 00:00:01 |
| 52 | VIEW | | 27 | 54405 | 2 (0)| 00:00:01 |
| 53 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B54_2EBE182 | 27 | 1269 | 2 (0)| 00:00:01 |
| 54 | TABLE ACCESS BY INDEX ROWID | TABLECELL | 1 | 11 | 1 (0)| 00:00:01 |
|* 55 | INDEX UNIQUE SCAN | XF1_TBLCEL_DATA | 1 | | 0 (0)| 00:00:01 |
|* 56 | TABLE ACCESS BY INDEX ROWID | CELLDEF | 1 | 11 | 1 (0)| 00:00:01 |
|* 57 | INDEX UNIQUE SCAN | PK_CELLDEF | 1 | | 0 (0)| 00:00:01 |
| 58 | BUFFER SORT | | 5 | | 120 (2)| 00:00:02 |
| 59 | INDEX FULL SCAN | PK_APPUSAGE | 5 | | 1 (0)| 00:00:01 |
| 60 | TABLE ACCESS BY INDEX ROWID | CELLDEF | 1 | 33 | 1 (0)| 00:00:01 |
|* 61 | INDEX UNIQUE SCAN | PK_CELLDEF | 1 | | 0 (0)| 00:00:01 |
| 62 | BUFFER SORT | | 1 | 17 | 123 (2)| 00:00:02 |
| 63 | VIEW | | 1 | 17 | 2 (0)| 00:00:01 |
| 64 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B53_2EBE182 | 1 | 10 | 2 (0)| 00:00:01 |
| 65 | TABLE ACCESS BY INDEX ROWID | APPUSAGEACCESS | 1 | 17 | 1 (0)| 00:00:01 |
|* 66 | INDEX UNIQUE SCAN | AK_APPUSAGEACCESS | 1 | | 0 (0)| 00:00:01 |
| 67 | NESTED LOOPS | | 1 | 2117 | 124 (2)| 00:00:02 |
| 68 | MERGE JOIN CARTESIAN | | 1 | 2100 | 123 (2)| 00:00:02 |
| 69 | NESTED LOOPS | | 1 | 2083 | 121 (2)| 00:00:02 |
| 70 | VIEW | | 1 | 2050 | 120 (2)| 00:00:02 |
| 71 | HASH GROUP BY | | 1 | 2091 | 120 (2)| 00:00:02 |
| 72 | NESTED LOOPS | | 1 | 2091 | 119 (1)| 00:00:02 |
| 73 | NESTED LOOPS | | 1 | 2080 | 118 (1)| 00:00:02 |
|* 74 | HASH JOIN | | 1 | 2069 | 117 (1)| 00:00:02 |
|* 75 | TABLE ACCESS BY INDEX ROWID | FIELDDATA | 117 | 3744 | 28 (0)| 00:00:01 |
| 76 | NESTED LOOPS | | 466 | 28892 | 114 (0)| 00:00:02 |
| 77 | NESTED LOOPS | | 4 | 120 | 2 (0)| 00:00:01 |
|* 78 | INDEX UNIQUE SCAN | PK_TABLEDEF | 1 | 4 | 0 (0)| 00:00:01 |
| 79 | VIEW | | 4 | 104 | 2 (0)| 00:00:01 |
| 80 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B52_2EBE182 | 4 | 388 | 2 (0)| 00:00:01 |
|* 81 | INDEX RANGE SCAN | XF11_DATA_LE_HB | 117 | | 12 (0)| 00:00:01 |
| 82 | VIEW | | 27 | 54189 | 2 (0)| 00:00:01 |
| 83 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B54_2EBE182 | 27 | 1269 | 2 (0)| 00:00:01 |
| 84 | TABLE ACCESS BY INDEX ROWID | TABLECELL | 1 | 11 | 1 (0)| 00:00:01 |
|* 85 | INDEX UNIQUE SCAN | XF1_TBLCEL_DATA | 1 | | 0 (0)| 00:00:01 |
|* 86 | TABLE ACCESS BY INDEX ROWID | CELLDEF | 1 | 11 | 1 (0)| 00:00:01 |
|* 87 | INDEX UNIQUE SCAN | PK_CELLDEF | 1 | | 0 (0)| 00:00:01 |
| 88 | TABLE ACCESS BY INDEX ROWID | CELLDEF | 1 | 33 | 1 (0)| 00:00:01 |
|* 89 | INDEX UNIQUE SCAN | PK_CELLDEF | 1 | | 0 (0)| 00:00:01 |
| 90 | BUFFER SORT | | 1 | 17 | 122 (2)| 00:00:02 |
| 91 | VIEW | | 1 | 17 | 2 (0)| 00:00:01 |
| 92 | TABLE ACCESS FULL | SYS_TEMP_0FD9D9B53_2EBE182 | 1 | 10 | 2 (0)| 00:00:01 |
| 93 | TABLE ACCESS BY INDEX ROWID | APPUSAGEACCESS | 1 | 17 | 1 (0)| 00:00:01 |
|* 94 | INDEX UNIQUE SCAN | AK_APPUSAGEACCESS | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - filter("TAXGROUP_DELETE_IND"='N' AND "TAXGROUP_ACTIVE_IND"='A')
4 - access("TAXGROUP_CODE"='TAXGROUP2')
13 - filter("TGI"."HYPERIONBASE_ID" IS NOT NULL)
14 - access("TG"."TAXGROUP_CODE"="TGI"."TAXGROUP_CODE")
15 - access("TGI"."LEGALENTITY_ID"="OU"."ORGUNIT_ID" AND "TGI"."HYPERIONBASE_ID"="OU"."HYPERIONBASE_ID")
21 - filter("TGI"."HYPERIONBASE_ID" IS NULL)
22 - access("TG"."TAXGROUP_CODE"="TGI"."TAXGROUP_CODE")
23 - access("TGI"."LEGALENTITY_ID"="OU"."ORGUNIT_ID")
25 - access("APPUSAGE_CODE"='CONSOLIDATION')
27 - filter("FD"."FIELDDATA_VALUE"=CASE INSTR("FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(164415),':') WHEN 0
THEN "FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(164415) ELSE
SUBSTR("FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(164415),1,INSTR("FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(16441
5),':')-1) END )
33 - access("LE_HB"."LEGALENTITY_ID"="FD"."LEGALENTITY_ID" AND
"LE_HB"."HYPERIONBASE_ID"="FD"."HYPERIONBASE_ID")
39 - filter("FDK"."RN"=1)
40 - filter(ROW_NUMBER() OVER ( PARTITION BY "CD"."CELLDEF_ID","FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"("FD"
."FIELDDATA_GROUP_SEQUENCE") ORDER BY "FD"."FIELDDATA_GROUP_SEQUENCE")<=1)
44 - access("GRS"."FD_GRPSEQ"="FD"."FIELDDATA_PARENT_ROW_SEQUENCE" AND
"GRS"."PRS_KEY"="FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"("FD"."FIELDDATA_PARENT_ROW_SEQUENCE"))
45 - filter("FD"."FIELDDATA_DELETE_IND"='N')
48 - access("TD"."TABLEDEF_ID"=2265)
51 - access("LE_HB"."LEGALENTITY_ID"="FD"."LEGALENTITY_ID" AND
"LE_HB"."HYPERIONBASE_ID"="FD"."HYPERIONBASE_ID")
55 - access("FD"."FIELDDATA_ID"="TC"."FIELDDATA_ID")
56 - filter("CD"."TABLEDEF_ID"=2265 AND "CD"."CELLDEF_KEY_IND"='Y')
57 - access("TC"."CELLDEF_ID"="CD"."CELLDEF_ID")
61 - access("FDK"."CELLDEF_ID"="CD"."CELLDEF_ID")
66 - access("AUA"."APPUSAGE_CODE"="AU"."APPUSAGE_CODE" AND "CD"."CELLDEF_ID"="AUA"."CELLDEF_ID")
74 - access("GRS"."FD_GRPSEQ"="FD"."FIELDDATA_PARENT_ROW_SEQUENCE" AND
"GRS"."PRS_KEY"="FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"("FD"."FIELDDATA_PARENT_ROW_SEQUENCE"))
75 - filter("FD"."FIELDDATA_DELETE_IND"='N')
78 - access("TD"."TABLEDEF_ID"=2265)
81 - access("LE_HB"."LEGALENTITY_ID"="FD"."LEGALENTITY_ID" AND
"LE_HB"."HYPERIONBASE_ID"="FD"."HYPERIONBASE_ID")
85 - access("FD"."FIELDDATA_ID"="TC"."FIELDDATA_ID")
86 - filter("CD"."TABLEDEF_ID"=2265 AND "CD"."CELLDEF_ADJUSTABLE_IND"='Y')
87 - access("TC"."CELLDEF_ID"="CD"."CELLDEF_ID")
89 - access("FDA"."CELLDEF_ID"="CD"."CELLDEF_ID")
94 - access("AUA"."APPUSAGE_CODE"="AU"."APPUSAGE_CODE" AND "CD"."CELLDEF_ID"="AUA"."CELLDEF_ID")

Thanks cd.
Here's the query plan:
Query Plan:
Plan hash value: 522363234
| Id  | Operation                               | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT                        |                            |     2 |  6227 |   249   (2)| 00:00:03 |
|   1 |  TEMP TABLE TRANSFORMATION              |                            |       |       |            |          |
|   2 |   LOAD AS SELECT                        |                            |       |       |            |          |
|*  3 |    TABLE ACCESS BY INDEX ROWID          | TAXGROUP                   |     1 |    14 |     1   (0)| 00:00:01 |
|*  4 |     INDEX UNIQUE SCAN                   | PK_TAXGROUP                |     1 |       |     0   (0)| 00:00:01 |
|   5 |   LOAD AS SELECT                        |                            |       |       |            |          |
|   6 |    SORT UNIQUE                          |                            |     4 |   224 |    12  (59)| 00:00:01 |
|   7 |     UNION-ALL                           |                            |       |       |            |          |
|   8 |      TABLE ACCESS BY INDEX ROWID        | ORGUNIT                    |     1 |    29 |     2   (0)| 00:00:01 |
|   9 |       NESTED LOOPS                      |                            |     1 |    56 |     5   (0)| 00:00:01 |
|  10 |        NESTED LOOPS                     |                            |     1 |    27 |     3   (0)| 00:00:01 |
|  11 |         VIEW                            |                            |     1 |    10 |     2   (0)| 00:00:01 |
|  12 |          TABLE ACCESS FULL              | SYS_TEMP_0FD9D9B51_2EBE182 |     1 |    10 |     2   (0)| 00:00:01 |
|* 13 |         TABLE ACCESS BY INDEX ROWID     | TAXGROUPITEM               |     1 |    17 |     1   (0)| 00:00:01 |
|* 14 |          INDEX RANGE SCAN               | XF1_TAXGROUPITEM_TAXGROUP  |     1 |       |     0   (0)| 00:00:01 |
|* 15 |        INDEX RANGE SCAN                 | XF1_ORGUNIT_ID             |     1 |       |     1   (0)| 00:00:01 |
|  16 |      TABLE ACCESS BY INDEX ROWID        | ORGUNIT                    |     3 |    87 |     2   (0)| 00:00:01 |
|  17 |       NESTED LOOPS                      |                            |     3 |   168 |     5   (0)| 00:00:01 |
|  18 |        NESTED LOOPS                     |                            |     1 |    27 |     3   (0)| 00:00:01 |
|  19 |         VIEW                            |                            |     1 |    10 |     2   (0)| 00:00:01 |
|  20 |          TABLE ACCESS FULL              | SYS_TEMP_0FD9D9B51_2EBE182 |     1 |    10 |     2   (0)| 00:00:01 |
|* 21 |         TABLE ACCESS BY INDEX ROWID     | TAXGROUPITEM               |     1 |    17 |     1   (0)| 00:00:01 |
|* 22 |          INDEX RANGE SCAN               | XF1_TAXGROUPITEM_TAXGROUP  |     1 |       |     0   (0)| 00:00:01 |
|* 23 |        INDEX RANGE SCAN                 | XF1_ORGUNIT_ID             |     3 |       |     1   (0)| 00:00:01 |
|  24 |   LOAD AS SELECT                        |                            |       |       |            |          |
|* 25 |    INDEX UNIQUE SCAN                    | PK_APPUSAGE                |     1 |    10 |     0   (0)| 00:00:01 |
|  26 |   LOAD AS SELECT                        |                            |       |       |            |          |
|* 27 |    TABLE ACCESS BY INDEX ROWID          | FIELDDATA                  |     7 |   147 |    28   (0)| 00:00:01 |
|  28 |     NESTED LOOPS                        |                            |    27 |  1269 |   117   (1)| 00:00:02 |
|  29 |      NESTED LOOPS                       |                            |     4 |   104 |     4   (0)| 00:00:01 |
|  30 |       FAST DUAL                         |                            |     1 |       |     2   (0)| 00:00:01 |
|  31 |       VIEW                              |                            |     4 |   104 |     2   (0)| 00:00:01 |
|  32 |        TABLE ACCESS FULL                | SYS_TEMP_0FD9D9B52_2EBE182 |     4 |   388 |     2   (0)| 00:00:01 |
|* 33 |      INDEX RANGE SCAN                   | XF11_DATA_LE_HB            |   117 |       |    12   (0)| 00:00:01 |
|  34 |   SORT ORDER BY                         |                            |     2 |  6227 |   248  (51)| 00:00:03 |
|  35 |    UNION-ALL                            |                            |       |       |            |          |
|  36 |     NESTED LOOPS                        |                            |     1 |  4110 |   125   (2)| 00:00:02 |
|  37 |      MERGE JOIN CARTESIAN               |                            |     1 |  4093 |   124   (2)| 00:00:02 |
|  38 |       NESTED LOOPS                      |                            |     1 |  4076 |   122   (2)| 00:00:02 |
|* 39 |        VIEW                             |                            |     1 |  4043 |   121   (2)| 00:00:02 |
|* 40 |         WINDOW SORT PUSHED RANK         |                            |     1 |  2099 |   121   (2)| 00:00:02 |
|  41 |          MERGE JOIN CARTESIAN           |                            |     1 |  2099 |   120   (1)| 00:00:02 |
|  42 |           NESTED LOOPS                  |                            |     1 |  2099 |   119   (1)| 00:00:02 |
|  43 |            NESTED LOOPS                 |                            |     1 |  2088 |   118   (1)| 00:00:02 |
|* 44 |             HASH JOIN                   |                            |     1 |  2077 |   117   (1)| 00:00:02 |
|* 45 |              TABLE ACCESS BY INDEX ROWID| FIELDDATA                  |   117 |  3744 |    28   (0)| 00:00:01 |
|  46 |               NESTED LOOPS              |                            |   466 | 28892 |   114   (0)| 00:00:02 |
|  47 |                NESTED LOOPS             |                            |     4 |   120 |     2   (0)| 00:00:01 |
|* 48 |                 INDEX UNIQUE SCAN       | PK_TABLEDEF                |     1 |     4 |     0   (0)| 00:00:01 |
|  49 |                 VIEW                    |                            |     4 |   104 |     2   (0)| 00:00:01 |
|  50 |                  TABLE ACCESS FULL      | SYS_TEMP_0FD9D9B52_2EBE182 |     4 |   388 |     2   (0)| 00:00:01 |
|* 51 |                INDEX RANGE SCAN         | XF11_DATA_LE_HB            |   117 |       |    12   (0)| 00:00:01 |
|  52 |              VIEW                       |                            |    27 | 54405 |     2   (0)| 00:00:01 |
|  53 |               TABLE ACCESS FULL         | SYS_TEMP_0FD9D9B54_2EBE182 |    27 |  1269 |     2   (0)| 00:00:01 |
|  54 |             TABLE ACCESS BY INDEX ROWID | TABLECELL                  |     1 |    11 |     1   (0)| 00:00:01 |
|* 55 |              INDEX UNIQUE SCAN          | XF1_TBLCEL_DATA            |     1 |       |     0   (0)| 00:00:01 |
|* 56 |            TABLE ACCESS BY INDEX ROWID  | CELLDEF                    |     1 |    11 |     1   (0)| 00:00:01 |
|* 57 |             INDEX UNIQUE SCAN           | PK_CELLDEF                 |     1 |       |     0   (0)| 00:00:01 |
|  58 |           BUFFER SORT                   |                            |     5 |       |   120   (2)| 00:00:02 |
|  59 |            INDEX FULL SCAN              | PK_APPUSAGE                |     5 |       |     1   (0)| 00:00:01 |
|  60 |        TABLE ACCESS BY INDEX ROWID      | CELLDEF                    |     1 |    33 |     1   (0)| 00:00:01 |
|* 61 |         INDEX UNIQUE SCAN               | PK_CELLDEF                 |     1 |       |     0   (0)| 00:00:01 |
|  62 |       BUFFER SORT                       |                            |     1 |    17 |   123   (2)| 00:00:02 |
|  63 |        VIEW                             |                            |     1 |    17 |     2   (0)| 00:00:01 |
|  64 |         TABLE ACCESS FULL               | SYS_TEMP_0FD9D9B53_2EBE182 |     1 |    10 |     2   (0)| 00:00:01 |
|  65 |      TABLE ACCESS BY INDEX ROWID        | APPUSAGEACCESS             |     1 |    17 |     1   (0)| 00:00:01 |
|* 66 |       INDEX UNIQUE SCAN                 | AK_APPUSAGEACCESS          |     1 |       |     0   (0)| 00:00:01 |
|  67 |     NESTED LOOPS                        |                            |     1 |  2117 |   124   (2)| 00:00:02 |
|  68 |      MERGE JOIN CARTESIAN               |                            |     1 |  2100 |   123   (2)| 00:00:02 |
|  69 |       NESTED LOOPS                      |                            |     1 |  2083 |   121   (2)| 00:00:02 |
|  70 |        VIEW                             |                            |     1 |  2050 |   120   (2)| 00:00:02 |
|  71 |         HASH GROUP BY                   |                            |     1 |  2091 |   120   (2)| 00:00:02 |
|  72 |          NESTED LOOPS                   |                            |     1 |  2091 |   119   (1)| 00:00:02 |
|  73 |           NESTED LOOPS                  |                            |     1 |  2080 |   118   (1)| 00:00:02 |
|* 74 |            HASH JOIN                    |                            |     1 |  2069 |   117   (1)| 00:00:02 |
|* 75 |             TABLE ACCESS BY INDEX ROWID | FIELDDATA                  |   117 |  3744 |    28   (0)| 00:00:01 |
|  76 |              NESTED LOOPS               |                            |   466 | 28892 |   114   (0)| 00:00:02 |
|  77 |               NESTED LOOPS              |                            |     4 |   120 |     2   (0)| 00:00:01 |
|* 78 |                INDEX UNIQUE SCAN        | PK_TABLEDEF                |     1 |     4 |     0   (0)| 00:00:01 |
|  79 |                VIEW                     |                            |     4 |   104 |     2   (0)| 00:00:01 |
|  80 |                 TABLE ACCESS FULL       | SYS_TEMP_0FD9D9B52_2EBE182 |     4 |   388 |     2   (0)| 00:00:01 |
|* 81 |               INDEX RANGE SCAN          | XF11_DATA_LE_HB            |   117 |       |    12   (0)| 00:00:01 |
|  82 |             VIEW                        |                            |    27 | 54189 |     2   (0)| 00:00:01 |
|  83 |              TABLE ACCESS FULL          | SYS_TEMP_0FD9D9B54_2EBE182 |    27 |  1269 |     2   (0)| 00:00:01 |
|  84 |            TABLE ACCESS BY INDEX ROWID  | TABLECELL                  |     1 |    11 |     1   (0)| 00:00:01 |
|* 85 |             INDEX UNIQUE SCAN           | XF1_TBLCEL_DATA            |     1 |       |     0   (0)| 00:00:01 |
|* 86 |           TABLE ACCESS BY INDEX ROWID   | CELLDEF                    |     1 |    11 |     1   (0)| 00:00:01 |
|* 87 |            INDEX UNIQUE SCAN            | PK_CELLDEF                 |     1 |       |     0   (0)| 00:00:01 |
|  88 |        TABLE ACCESS BY INDEX ROWID      | CELLDEF                    |     1 |    33 |     1   (0)| 00:00:01 |
|* 89 |         INDEX UNIQUE SCAN               | PK_CELLDEF                 |     1 |       |     0   (0)| 00:00:01 |
|  90 |       BUFFER SORT                       |                            |     1 |    17 |   122   (2)| 00:00:02 |
|  91 |        VIEW                             |                            |     1 |    17 |     2   (0)| 00:00:01 |
|  92 |         TABLE ACCESS FULL               | SYS_TEMP_0FD9D9B53_2EBE182 |     1 |    10 |     2   (0)| 00:00:01 |
|  93 |      TABLE ACCESS BY INDEX ROWID        | APPUSAGEACCESS             |     1 |    17 |     1   (0)| 00:00:01 |
|* 94 |       INDEX UNIQUE SCAN                 | AK_APPUSAGEACCESS          |     1 |       |     0   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id):
   3 - filter("TAXGROUP_DELETE_IND"='N' AND "TAXGROUP_ACTIVE_IND"='A')
   4 - access("TAXGROUP_CODE"='TAXGROUP2')
  13 - filter("TGI"."HYPERIONBASE_ID" IS NOT NULL)
  14 - access("TG"."TAXGROUP_CODE"="TGI"."TAXGROUP_CODE")
  15 - access("TGI"."LEGALENTITY_ID"="OU"."ORGUNIT_ID" AND "TGI"."HYPERIONBASE_ID"="OU"."HYPERIONBASE_ID")
  21 - filter("TGI"."HYPERIONBASE_ID" IS NULL)
  22 - access("TG"."TAXGROUP_CODE"="TGI"."TAXGROUP_CODE")
  23 - access("TGI"."LEGALENTITY_ID"="OU"."ORGUNIT_ID")
  25 - access("APPUSAGE_CODE"='CONSOLIDATION')
  27 - filter("FD"."FIELDDATA_VALUE"=CASE INSTR("FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(164415),':') WHEN 0
              THEN "FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(164415) ELSE
              SUBSTR("FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(164415),1,INSTR("FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"(16441
              5),':')-1) END )
  33 - access("LE_HB"."LEGALENTITY_ID"="FD"."LEGALENTITY_ID" AND
              "LE_HB"."HYPERIONBASE_ID"="FD"."HYPERIONBASE_ID")
  39 - filter("FDK"."RN"=1)
  40 - filter(ROW_NUMBER() OVER ( PARTITION BY "CD"."CELLDEF_ID","FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"("FD"
              ."FIELDDATA_GROUP_SEQUENCE") ORDER BY "FD"."FIELDDATA_GROUP_SEQUENCE")<=1)
  44 - access("GRS"."FD_GRPSEQ"="FD"."FIELDDATA_PARENT_ROW_SEQUENCE" AND
              "GRS"."PRS_KEY"="FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"("FD"."FIELDDATA_PARENT_ROW_SEQUENCE"))
  45 - filter("FD"."FIELDDATA_DELETE_IND"='N')
  48 - access("TD"."TABLEDEF_ID"=2265)
  51 - access("LE_HB"."LEGALENTITY_ID"="FD"."LEGALENTITY_ID" AND
              "LE_HB"."HYPERIONBASE_ID"="FD"."HYPERIONBASE_ID")
  55 - access("FD"."FIELDDATA_ID"="TC"."FIELDDATA_ID")
  56 - filter("CD"."TABLEDEF_ID"=2265 AND "CD"."CELLDEF_KEY_IND"='Y')
  57 - access("TC"."CELLDEF_ID"="CD"."CELLDEF_ID")
  61 - access("FDK"."CELLDEF_ID"="CD"."CELLDEF_ID")
  66 - access("AUA"."APPUSAGE_CODE"="AU"."APPUSAGE_CODE" AND "CD"."CELLDEF_ID"="AUA"."CELLDEF_ID")
  74 - access("GRS"."FD_GRPSEQ"="FD"."FIELDDATA_PARENT_ROW_SEQUENCE" AND
              "GRS"."PRS_KEY"="FEDTAXPK_PKG"."GETFIELDDATAGROUPSEQKEY"("FD"."FIELDDATA_PARENT_ROW_SEQUENCE"))
  75 - filter("FD"."FIELDDATA_DELETE_IND"='N')
  78 - access("TD"."TABLEDEF_ID"=2265)
  81 - access("LE_HB"."LEGALENTITY_ID"="FD"."LEGALENTITY_ID" AND
              "LE_HB"."HYPERIONBASE_ID"="FD"."HYPERIONBASE_ID")
  85 - access("FD"."FIELDDATA_ID"="TC"."FIELDDATA_ID")
  86 - filter("CD"."TABLEDEF_ID"=2265 AND "CD"."CELLDEF_ADJUSTABLE_IND"='Y')
  87 - access("TC"."CELLDEF_ID"="CD"."CELLDEF_ID")
  89 - access("FDA"."CELLDEF_ID"="CD"."CELLDEF_ID")
  94 - access("AUA"."APPUSAGE_CODE"="AU"."APPUSAGE_CODE" AND "CD"."CELLDEF_ID"="AUA"."CELLDEF_ID")

Similar Messages

  • Need help in optimizing the query with joins and group by clause

    I am having problem in executing the query below.. it is taking lot of time. To simplify, I have added the two tables FILE_STATUS = stores the file load details and COMM table that is actual business commission table showing records successfully processed and which records were transmitted to other system. Records with status = T is trasnmitted to other system and traansactions with P is pending.
    CREATE TABLE FILE_STATUS
    (FILE_ID VARCHAR2(14),
    FILE_NAME VARCHAR2(20),
    CARR_CD VARCHAR2(5),
    TOT_REC NUMBER,
    TOT_SUCC NUMBER);
    CREATE TABLE COMM
    (SRC_FILE_ID VARCHAR2(14),
    REC_ID NUMBER,
    STATUS CHAR(1));
    INSERT INTO FILE_STATUS VALUES ('12345678', 'CM_LIBM.TXT', 'LIBM', 5, 4);
    INSERT INTO FILE_STATUS VALUES ('12345679', 'CM_HIPNT.TXT', 'HIPNT', 4, 0);
    INSERT INTO COMM VALUES ('12345678', 1, 'T');
    INSERT INTO COMM VALUES ('12345678', 3, 'T');
    INSERT INTO COMM VALUES ('12345678', 4, 'P');
    INSERT INTO COMM VALUES ('12345678', 5, 'P');
    COMMIT;Here is the query that I wrote to give me the details of the file that has been loaded into the system. It reads the file status and commission table to show file name, total records loaded, total records successfully loaded to the commission table and number of records that has been finally transmitted (status=T) to other systems.
    SELECT
        FS.CARR_CD
        ,FS.FILE_NAME
        ,FS.FILE_ID
        ,FS.TOT_REC
        ,FS.TOT_SUCC
        ,NVL(C.TOT_TRANS, 0) TOT_TRANS
    FROM FILE_STATUS FS
    LEFT JOIN
        SELECT SRC_FILE_ID, COUNT(*) TOT_TRANS
        FROM COMM
        WHERE STATUS = 'T'
        GROUP BY SRC_FILE_ID
    ) C ON C.SRC_FILE_ID = FS.FILE_ID
    WHERE FILE_ID = '12345678';In production this query has more joins and is taking lot of time to process.. the main culprit for me is the join on COMM table to get the count of number of transactions transmitted. Please can you give me tips to optimize this query to get results faster? Do I need to remove group and use partition or something else. Please help!

    I get 2 rows if I use my query with your new criteria. Did you commit the record if you are using a second connection to query? Did you remove the criteria for file_id?
    select carr_cd, file_name, file_id, tot_rec, tot_succ, tot_trans
      from (select fs.carr_cd,
                   fs.file_name,
                   fs.file_id,
                   fs.tot_rec,
                   fs.tot_succ,
                   count(case
                            when c.status = 'T' then
                             1
                            else
                             null
                          end) over(partition by c.src_file_id) tot_trans,
                   row_number() over(partition by c.src_file_id order by null) rn
              from file_status fs
              left join comm c
                on c.src_file_id = fs.file_id
             where carr_cd = 'LIBM')
    where rn = 1;
    CARR_CD FILE_NAME            FILE_ID           TOT_REC   TOT_SUCC  TOT_TRANS
    LIBM    CM_LIBM.TXT          12345678                5          4          2
    LIBM    CM_LIBM.TXT          12345677               10          0          0Using RANK can potentially produce multiple rows to be returned though your data may prevent this. ROW_NUMBER will always prevent duplicates. The ordering of the analytical function is irrelevant in your query if you use ROW_NUMBER. You can remove the outermost query and inspect the data returned by the inner query;
    select fs.carr_cd,
           fs.file_name,
           fs.file_id,
           fs.tot_rec,
           fs.tot_succ,
           count(case
                    when c.status = 'T' then
                     1
                    else
                     null
                  end) over(partition by c.src_file_id) tot_trans,
           row_number() over(partition by c.src_file_id order by null) rn
    from file_status fs
    left join comm c
    on c.src_file_id = fs.file_id
    where carr_cd = 'LIBM';
    CARR_CD FILE_NAME            FILE_ID           TOT_REC   TOT_SUCC  TOT_TRANS         RN
    LIBM    CM_LIBM.TXT          12345678                5          4          2          1
    LIBM    CM_LIBM.TXT          12345678                5          4          2          2
    LIBM    CM_LIBM.TXT          12345678                5          4          2          3
    LIBM    CM_LIBM.TXT          12345678                5          4          2          4
    LIBM    CM_LIBM.TXT          12345677               10          0          0          1

  • Need complex query  with joins and AGGREGATE  functions.

    Hello Everyone ;
    Good Morning to all ;
    I have 3 tables with 2 lakhs record. I need to check query performance.. How CBO rewrites my query in materialized view ?
    I want to make complex join with AGGREGATE FUNCTION.
    my table details
    SQL> select from tab;*
    TNAME TABTYPE CLUSTERID
    DEPT TABLE
    PAYROLL TABLE
    EMP TABLE
    SQL> desc emp
    Name
    EID
    ENAME
    EDOB
    EGENDER
    EQUAL
    EGRADUATION
    EDESIGNATION
    ELEVEL
    EDOMAIN_ID
    EMOB_NO
    SQL> desc dept
    Name
    EID
    DNAME
    DMANAGER
    DCONTACT_NO
    DPROJ_NAME
    SQL> desc payroll
    Name
    EID
    PF_NO
    SAL_ACC_NO
    SALARY
    BONUS
    I want to make  complex query  with joins and AGGREGATE  functions.
    Dept names are : IT , ITES , Accounts , Mgmt , Hr
    GRADUATIONS are : Engineering , Arts , Accounts , business_applications
    I want to select records who are working in IT and ITES and graduation should be "Engineering"
    salary > 20000 and < = 22800 and bonus > 1000 and <= 1999 with count for males and females Separately ;
    Please help me to make a such complex query with joins ..
    Thanks in advance ..
    Edited by: 969352 on May 25, 2013 11:34 AM

    969352 wrote:
    why do you avoid providing requested & NEEDED details?I do NOT understand what do you expect ?
    My Goal is :
    1. When executing my own query i need to check expalin plan.please proceed to do so
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9010.htm#SQLRF01601
    2. IF i enable query rewrite option .. i want to check explain plan ( how optimizer rewrites my query ) ? please proceed to do so
    http://docs.oracle.com/cd/E11882_01/server.112/e16638/ex_plan.htm#PFGRF009
    3. My only aim is QUERY PERFORMANCE with QUERY REWRITE clause in materialized view.It is an admirable goal.
    Best Wishes on your quest for performance improvements.

  • Problem in Query with JOIN Function in OCRD CRD1 OCPR tables

    Hello Dear Forum Users,
    I want to make a query which shows me per business partner from OCRD - Addres; CRD1 - Delivery Address and from OCPR - Contactperson information
    Is it possible to show it in one row per Business Partner. Now I get (the classic problem) of several rows and a duplication of the contact persons per (delivery) address.
    My query is:
    SELECT T0.[CardCode], T0.[CardName], T1.[Address], T1.[Street], T1.[ZipCode], T1.[City], T1.[Country], T1.[U_TelNr], T1.[U_MobNr], T1.[U_OpenTijd], T1.[U_LosIns_1], T1.[U_LosIns_2],T2.[Title],  T2.[Name] as 'Voornaam', T2.[Address] as 'Achternaam', T2.[Position] as 'Functie', T2.[Tel1], T2.[Cellolar], T2.[E_MailL], T2.[BirthDate] FROM OCRD T0 LEFT OUTER JOIN CRD1 T1 ON T0.CardCode = T1.CardCode LEFT OUTER JOIN OCPR T2 ON T0.CardCode = T2.CardCode
    Can you help me ?
    Jos Dielemans - Maastricht
    Edited by: J. Dielemans on Apr 29, 2011 4:28 PM
    Changed the query with Left Outer Join

    I have found the solution myself:
    By using the Union All function I could combine two queries. Here is the result:
    SELECT
    T0.[CardCode], T0.[CardName], T1.[Address] , T1.[Street], T1.[ZipCode], T1.[City], T1.[Country], T1.[U_TelNr], T1.[U_OpenTijd] , T1.[U_LosIns_1] , T1.[U_LosIns_2]'
    FROM OCRD T0 LEFT OUTER JOIN CRD1 T1 ON T0.CardCode = T1.CardCode
    WHERE T0.[CardCode] >= 'D00000'
    Union all
    SELECT
    T0.[CardCode], T0.[CardName], T2.[Position], T2.[Tel1], T2.[Title],  T2.[Name], T2.[Address], T2.[Position], T2.[Tel1], T2.[Cellolar], T2.[E_MailL]
    FROM OCRD T0 LEFT OUTER JOIN OCPR T2 ON T0.CardCode = T2.CardCode
    WHERE T0.[CardCode] >= 'D00000'
    Order by 1
    Now i got the result I was looking for.

  • Copy function based on the query with variables

    Hello
    Let me share the scenario I need to implement. I have a planning query with layout like shop / material / sales volume. The variables are shop number and calendar month. User opens the planning query, selects shop number and month, then sees the list of materials and puts the planned sales volume, then saves as a temporary version. Saving as a temporary version is realized by standard u201Csaveu201D function. The matter is that the user needs to have a possibility to copy this version to official one. I created the button and linked it with the copy function. The problem is that when a user clicks this button, the function asks him/her to provide variables again. I would like to have the button which copies the data with the same selection criteria as the query already has.
    Any idea?
    Arelis.

    Hi,
    I think when you add the button you specify the planning sequence name and that takes the filter of the modeler .Now when you try to call the planning sequence the filter variables are also added to the button as VAR_NAME, VAR_VALUE which prompts you for the variable again.Delete VAR_NAME,VAR_VALUE at the back of the button  manually and then save your work book.Then it will not ask for variable entry and the values that you have specified in the query filter will pass on to modeler filters.As variables are global.
    Similarly if you are using planning function then at the back of the button remove the VAR_NAME,VAR_VALUE.
    Hope this may help.
    Regards,
    Indu

  • Query with sub functions

    Hi Experts,
    I have tried the below query with sub select function. could any one help me to fix this ?
    SELECT T0.[ItemCode], T0.[Dscription], T1.[OnHand],
    (Select distinct sum(T0.InQty) from OINM where T0.ItemCode = OINM.ItemCode and T0.DocDate = '2012/08/18' ) as 'OB Stock'
    FROM OINM T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE T1.[OnHand] > 0   GROUP BY T0.[ItemCode], T0.[Dscription],  T1.[OnHand]
    thanks in advance,
    Regards,
    Dwarak

    Hi,
    This is for your Query.
    SELECT T0.[ItemCode], T0.[Dscription], T1.[OnHand],
    (Select distinct sum(T0.InQty) from OINM t0 where T0.ItemCode = T0.ItemCode and T0.DocDate = '2012/08/18'  ) as 'OB Stock'
    FROM OINM T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE T1.[OnHand] > 0   GROUP BY T0.[ItemCode], T0.[Dscription],  T1.[OnHand]
    Regards,
    Kalaiyarasan.v

  • Need help with SQL Query with Inline View + Group by

    Hello Gurus,
    I would really appreciate your time and effort regarding this query. I have the following data set.
    Reference_No---Check_Number---Check_Date--------Description-------------------------------Invoice_Number----------Invoice_Type---Paid_Amount-----Vendor_Number
    1234567----------11223-------------- 7/5/2008----------paid for cleaning----------------------44345563------------------I-----------------*20.00*-------------19
    1234567----------11223--------------7/5/2008-----------Adjustment for bad quality---------44345563------------------A-----------------10.00------------19
    7654321----------11223--------------7/5/2008-----------Adjustment from last billing cycle-----23543556-------------------A--------------------50.00--------------19
    4653456----------11223--------------7/5/2008-----------paid for cleaning------------------------35654765--------------------I---------------------30.00-------------19
    Please Ignore '----', added it for clarity
    I am trying to write a query to aggregate paid_amount based on Reference_No, Check_Number, Payment_Date, Invoice_Number, Invoice_Type, Vendor_Number and display description with Invoice_type 'I' when there are multiple records with the same Reference_No, Check_Number, Payment_Date, Invoice_Number, Invoice_Type, Vendor_Number. When there are no multiple records I want to display the respective Description.
    The query should return the following data set
    Reference_No---Check_Number---Check_Date--------Description-------------------------------Invoice_Number----------Invoice_Type---Paid_Amount-----Vendor_Number
    1234567----------11223-------------- 7/5/2008----------paid for cleaning----------------------44345563------------------I-----------------*10.00*------------19
    7654321----------11223--------------7/5/2008-----------Adjustment from last billing cycle-----23543556-------------------A--------------------50.00--------------19
    4653456----------11223--------------7/5/2008-----------paid for cleaning------------------------35654765-------------------I---------------------30.00--------------19
    The following is my query. I am kind of lost.
    select B.Description, A.sequence_id,A.check_date, A.check_number, A.invoice_number, A.amount, A.vendor_number
    from (
    select sequence_id,check_date, check_number, invoice_number, sum(paid_amount) amount, vendor_number
    from INVOICE
    group by sequence_id,check_date, check_number, invoice_number, vendor_number
    ) A, INVOICE B
    where A.sequence_id = B.sequence_id
    Thanks,
    Nick

    It looks like it is a duplicate thread - correct me if i'm wrong in this case ->
    Need help with SQL Query with Inline View + Group by
    Regards.
    Satyaki De.

  • Slow Query time with Function in Group By

    I have a PL/SQL function that computes status based on several inputs. When the function is run in a standard query without a group by, it is very fast. When i try to count or sum other columns in the select (thus requiring the Group By), my query response time explodes exponentially.
    My query:
    SELECT
    ben.atm_class( 'DBT', 'CLA' , 6 , 1245 ),
    count (distinct ax.HOUSEHOLD_KEY)
    FROM
    ADM.PRODUCT p,
    ADM.ACCOUNT_CROSS_FUNCTIONAL ax
    WHERE
    ax.month_key = 1245
    AND ( ax.PRODUCT_KEY=ADM.P.PRODUCT_KEY )
    AND ( ax.HOUSEHOLD_KEY ) IN (6)
    group by
    p.ptype, p.stype,
    ben.atm_class( 'DBT', 'CLA' , 6 , 1245 )
    My explain plan for the query with the Group By:
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE          3           10                     
    SORT GROUP BY          3      60      10                     
    NESTED LOOPS          3      60      6                     
    TABLE ACCESS BY LOCAL INDEX ROWID     ACCOUNT_CROSS_FUNCTIONAL     3      33      3                23     23
    INDEX RANGE SCAN     NXIF312ACCOUNT_CROSS_FUNCTION     3           2                23     23
    TABLE ACCESS BY INDEX ROWID     PRODUCT     867      7 K     1                     
    INDEX UNIQUE SCAN     PK_PRODUCT_PRODUCTKEY     867                               
    This executes in over 9 minutes.
    My query w/o Group by
    SELECT
    ben.atm_class( 'DBT', 'CLA' , 6 , 1245 ),
    ax.HOUSEHOLD_KEY
    FROM
    ADM.PRODUCT p,
    ADM.ACCOUNT_CROSS_FUNCTIONAL ax
    WHERE
    ax.month_key = 1245
    AND ( ax.PRODUCT_KEY=ADM.P.PRODUCT_KEY )
    AND ( ax.HOUSEHOLD_KEY ) IN (6)
    My explain plan without the Group By:
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE          3           3                     
    NESTED LOOPS          3      42      3                     
    TABLE ACCESS BY LOCAL INDEX ROWID     ACCOUNT_CROSS_FUNCTIONAL     3      33      3                23     23
    INDEX RANGE SCAN     NXIF312ACCOUNT_CROSS_FUNCTION     3           2                23     23
    INDEX UNIQUE SCAN     PK_PRODUCT_PRODUCTKEY     867      2 K                         
    This executes in 6 seconds
    Any thoughts on why it takes 90 times longer to perform the Group By sort?

    The plan didn't paste:
    no group by:
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE          3           6                     
    NESTED LOOPS          3      60      6                     
    TABLE ACCESS BY LOCAL INDEX ROWID     ACCOUNT_CROSS_FUNCTIONAL     3      33      3                23     23
    INDEX RANGE SCAN     NXIF312ACCOUNT_CROSS_FUNCTION     3           2                23     23
    TABLE ACCESS BY INDEX ROWID     PRODUCT     867      7 K     1                     
    INDEX UNIQUE SCAN     PK_PRODUCT_PRODUCTKEY     867                               
    group by:
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE          3           10                     
    SORT GROUP BY          3      60      10                     
    NESTED LOOPS          3      60      6                     
    TABLE ACCESS BY LOCAL INDEX ROWID     ACCOUNT_CROSS_FUNCTIONAL     3      33      3                23     23
    INDEX RANGE SCAN     NXIF312ACCOUNT_CROSS_FUNCTION     3           2                23     23
    TABLE ACCESS BY INDEX ROWID     PRODUCT     867      7 K     1                     
    INDEX UNIQUE SCAN     PK_PRODUCT_PRODUCTKEY     867                               

  • Please help me out with the function code of print option in module pool

    please help me out with the function code of print option in module pool, along with CASE condition.
    regards,
    asif

    Hi
    you can use the Function module
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        destination            = 'LP01'                       "'Printer name
        list_name              = 'TEST'
        list_text              = 'SUBMIT ... TO SAP-SPOOL'
        immediately            = ' '
        line_size              = '2000'
        no_dialog              = 'X'             "pass space to Pop screen for Print option
      IMPORTING
        out_parameters         = wa_pri_params
        valid                  = w_valid.
    "next call below things
      NEW-PAGE PRINT ON NO DIALOG PARAMETERS wa_pri_params.
         "and try to Print the values inside the new-page
      NEW-PAGE PRINT OFF.
    Prabhudas

  • Help with functional global

    Thsi is my first time experementing with functional globals
    Having been recomended to read this thread http://forums.ni.com/ni/board/message?board.id=170&message.id=240328&query.id=5387854#M240328 
    I have decided to start with just a functional global
    (I like that term better as a FG should be just that, a global variable, and not perform any actions beyond holding data)
     What I have is "VI-A" writing to the FG and "VI-B" reading the FG
    The problem I am having is: 
    I can open the FG-VI in "VI-A" and see it updating.
    If I open the FG-VI in "VI-B" the FG-VI is running but the controls and indicators are always in their default state and not being updated by VI-A
    I have checked and checked and checked to make sure there is only one instance of the FG-VI on my machine.
    I have even gone as far as dragging the FG-VI directly from the block diagram of "VI-A" to the block diagram of "VI-B"
    Solved!
    Go to Solution.

    GerdW wrote:
    Hi RTSLVU,
    also throwing together two small test VIs to get rid of all your HW accesses, to show the FGV is working...
    So maybe it wasn't a good idea to "I threw together the chg-cycle VI rather quickly, it's messy...". Remove the unwired default values and check again what's happening in your VIs!
    Yeah well I am not using that VI anymre anyway, besides it was a quick and dirty test that worked fine the day I needed it... The origonal chg-cycle had the comunication VI's built in it. I was just using it to learn the FG concept. The idea I had was VI-A would run and continusly update so you could see what the UUT was doing and VI-B could pull in the data it needs from the FG... Like I do with my measurement instrument (The Measurments global in teh chg-cycle vi)
    Anyway I changed the FG back to how I first made it (no unwired defaults), but it still does not work as expected. The read in VI-B is always empty
    Attachments:
    FG-1.png ‏46 KB
    FG-2.png ‏43 KB

  • HT1338 I have a macbook Pro i7 mid november 2010. I am wondering if i can exchange my notebook with the latest one. Can anyone help me out with this query please.

    I have a macbook Pro i7 mid november 2010. I am wondering if i can exchange my notebook with the latest one. Can anyone help me out with this query please.

    You can sell your existing computer using eBay, Craigslist or the venue of your choice. You could then use the proceeds to purchase a new computer.

  • Is that important column order in a query with row_number function

    Hi folks,
    I am using Oracle 11g R2 on HP-UX machine.
    I have 2 types of query with row_number and I think they are same but output of each of them are different. I changed only column order in query2.
    Query 1 :
    (SELECT
    "LOOKUP_INPUT_SUBQUERY"."CONTRACT_SK" "CONTRACT_SK",
    "LOOKUP_INPUT_SUBQUERY"."SIMCARD_SK" "SIMCARD_SK"
    FROM (
    SELECT row_number ()
    OVER (
    PARTITION BY "R_CON_SUBS_SIMCARD_LK".
    "CONTRACT_SK"
    ORDER BY
    "R_CON_SUBS_SIMCARD_LK"."START_DATE" DESC,
    "R_CON_SUBS_SIMCARD_LK"."SEQ_NUM" DESC NULLS LAST) /* EXPRESSION_3.OUTGRP1.SIRA */
    "SIRA",
    "R_CON_SUBS_SIMCARD_LK"."CONTRACT_SK" "CONTRACT_SK",
    "R_CON_SUBS_SIMCARD_LK"."SIMCARD_SK" "SIMCARD_SK"
    FROM "SRC_OZRDS"."R_CON_SUBS_SIMCARD_LK" "R_CON_SUBS_SIMCARD_LK")
    "LOOKUP_INPUT_SUBQUERY"
    WHERE ("LOOKUP_INPUT_SUBQUERY"."SIRA" = 1))
    Output of this like that :
    CONTRACT_SK SIMCARD_SK
    1     1
    1     3
    1     4
    1     5
    1     6
    1     11
    1     12
    1     14
    1     15
    1     16
    Query 2 :
    (SELECT
    "LOOKUP_INPUT_SUBQUERY"."CONTRACT_SK" "CONTRACT_SK",
    "LOOKUP_INPUT_SUBQUERY"."SIMCARD_SK" "SIMCARD_SK"
    FROM (
    SELECT
    "R_CON_SUBS_SIMCARD_LK"."CONTRACT_SK" "CONTRACT_SK",
    "R_CON_SUBS_SIMCARD_LK"."SIMCARD_SK" "SIMCARD_SK",
    row_number ()
    OVER (
    PARTITION BY "R_CON_SUBS_SIMCARD_LK".
    "CONTRACT_SK"
    ORDER BY
    "R_CON_SUBS_SIMCARD_LK"."START_DATE" DESC,
    "R_CON_SUBS_SIMCARD_LK"."SEQ_NUM" DESC NULLS LAST) /* EXPRESSION_3.OUTGRP1.SIRA */
    "SIRA"
    FROM "SRC_OZRDS"."R_CON_SUBS_SIMCARD_LK" "R_CON_SUBS_SIMCARD_LK")
    "LOOKUP_INPUT_SUBQUERY"
    WHERE ("LOOKUP_INPUT_SUBQUERY"."SIRA" = 1))
    Output of this like that:
    2     874812
    7     70097256
    8     18734091
    9     158024
    10     815397739
    13     22657919
    19     83177779
    20     82579529
    22     5829949
    23     35348926
    25     3865978
    I expected the second output, because there are lots of contract sk but there is one contract_sk in first query result. i did not get the point. What is the problem ?

    user8649469 wrote:
    I changed only column order in query2.So what else do you expect? If you order, for example, by last name, fist name don't you think rows will be returned in a different order (and therefore same row will have different row number) than ordering by first name, last name?
    SY.

  • [Solved] Help me, please with D-Link DWA-125

    Hi everybody!
    Firstly, sorry for my english. I'm from Russia .
    Recently i bought D-Link DWA-125 and Prestigio MultiPad 9.7 Pro. I want to make D-Link DWA-125 work like access point.
    lsusb | grep -i wireless
    Bus 002 Device 002: ID 2001:3c19 D-Link Corp. DWA-125 Wireless N 150 Adapter(rev.A3) [Ralink RT5370]
    What i tried to do:
    1)
    netcfg up bridge
    :: bridge up [DONE]
    My /etc/network.d/bridge:
    cat /etc/network.d/bridge
    INTERFACE="br0"
    CONNECTION="bridge"
    DESCRIPTION="Bridge connection"
    BRIDGE_INTERFACES="eth0"
    #POST_UP="ifconfig br0 inet 192.168.0.1 netmask 255.255.255.0 up"
    IP="dhcp"
    #ADDR='192.168.0.1'
    #GATEWAY='192.168.0.0'
    #DNS=('192.168.0.1')
    ## sets forward delay time
    #FWD_DELAY=0
    ## sets max age of hello message
    #MAX_AGE=10
    2)
    /etc/rc.d/hostapd start
    :: Starting hostapd [DONE]
    My /etc/hostapd/hostapd.conf:
    cat /etc/hostapd/hostapd.conf
    #wireless interface to use as AP
    interface=wlan0
    #bridge device (needed for madwifi & nl80211 drivers)
    bridge=br0
    #driver interface type (hostapd/wired/madwifi/prism54/test/none/nl80211/bsd)
    # Use nl80211 for wifi drivers that implement MAC80211 interface
    #You should set this to your relevant driver interface type
    driver=nl80211
    #Enables logging to standard output (useful for debugging)
    logger_stdout=-1
    logger_stdout_level=2
    #Set SSID to use
    ssid=MS_WiFi_AP
    # Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g)
    # note your card may not support every mode.
    hw_mode=g
    #Channel to use (1-13)
    channel=1
    # IEEE 802.11 specifies two authentication algorithms. hostapd can be
    # configured to allow both of these or only one. Open system authentication
    # should be used with IEEE 802.1X.
    # Bit fields of allowed authentication algorithms:
    # bit 0 = Open System Authentication
    # bit 1 = Shared Key Authentication (requires WEP)
    auth_algs=3
    #maximum number of stations (clients connecting to AP) allowed
    # Maximum number of stations allowed in station table. New stations will be
    # rejected after the station table is full. IEEE 802.11 has a limit of 2007
    # different association IDs, so this number should not be larger than that.
    max_num_sta=5
    #Enable WPA2
    # This field is a bit field that can be used to enable WPA (IEEE 802.11i/D3.0)
    # and/or WPA2 (full IEEE 802.11i/RSN):
    # bit0 = WPA
    # bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled)
    wpa=1
    #Set passphrase for WPA
    wpa_passphrase=my_password
    wpa_key_mgmt=WPA-PSK
    # Set of accepted cipher suites (encryption algorithms) for pairwise keys
    # (unicast packets). This is a space separated list of algorithms:
    # CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
    # TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
    # Group cipher suite (encryption algorithm for broadcast and multicast frames)
    # is automatically selected based on this configuration. If only CCMP is
    # allowed as the pairwise cipher, group cipher will also be CCMP. Otherwise,
    # TKIP will be used as the group cipher.
    # (dot11RSNAConfigPairwiseCiphersTable)
    # Pairwise cipher for WPA (v1) (default: TKIP)
    wpa_pairwise=TKIP CCMP
    # Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value)
    rsn_pairwise=CCMP
    3)
    /etc/rc.d/dnsmasq start
    :: Starting DNS/DHCP daemon [DONE]
    My /etc/dnsmasq.conf:
    cat /etc/dnsmasq.conf
    # Configuration file for dnsmasq.
    # Format is one option per line, legal options are the same
    # as the long options legal on the command line. See
    # "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
    # Listen on this specific port instead of the standard DNS port
    # (53). Setting this to zero completely disables DNS function,
    # leaving only DHCP and/or TFTP.
    #port=5353
    # The following two options make you a better netizen, since they
    # tell dnsmasq to filter out queries which the public DNS cannot
    # answer, and which load the servers (especially the root servers)
    # unnecessarily. If you have a dial-on-demand link they also stop
    # these requests from bringing up the link unnecessarily.
    # Never forward plain names (without a dot or domain part)
    domain-needed
    # Never forward addresses in the non-routed address spaces.
    bogus-priv
    # Uncomment this to filter useless windows-originated DNS requests
    # which can trigger dial-on-demand links needlessly.
    # Note that (amongst other things) this blocks all SRV requests,
    # so don't use it if you use eg Kerberos, SIP, XMMP or Google-talk.
    # This option only affects forwarding, SRV records originating for
    # dnsmasq (via srv-host= lines) are not suppressed by it.
    #filterwin2k
    # Change this line if you want dns to get its upstream servers from
    # somewhere other that /etc/resolv.conf
    #resolv-file=
    # By default, dnsmasq will send queries to any of the upstream
    # servers it knows about and tries to favour servers to are known
    # to be up. Uncommenting this forces dnsmasq to try each query
    # with each server strictly in the order they appear in
    # /etc/resolv.conf
    #strict-order
    # If you don't want dnsmasq to read /etc/resolv.conf or any other
    # file, getting its servers from this file instead (see below), then
    # uncomment this.
    #no-resolv
    # If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
    # files for changes and re-read them then uncomment this.
    #no-poll
    # Add other name servers here, with domain specs if they are for
    # non-public domains.
    #server=/localnet/192.168.0.1
    # Example of routing PTR queries to nameservers: this will send all
    # address->name queries for 192.168.3/24 to nameserver 10.1.2.3
    #server=/3.168.192.in-addr.arpa/10.1.2.3
    # Add local-only domains here, queries in these domains are answered
    # from /etc/hosts or DHCP only.
    #local=/localnet/
    # Add domains which you want to force to an IP address here.
    # The example below send any host in double-click.net to a local
    # web-server.
    #address=/double-click.net/127.0.0.1
    # --address (and --server) work with IPv6 addresses too.
    #address=/www.thekelleys.org.uk/fe80::20d:60ff:fe36:f83
    # You can control how dnsmasq talks to a server: this forces
    # queries to 10.1.2.3 to be routed via eth1
    # server=10.1.2.3@eth1
    # and this sets the source (ie local) address used to talk to
    # 10.1.2.3 to 192.168.1.1 port 55 (there must be a interface with that
    # IP on the machine, obviously).
    # [email protected]#55
    # If you want dnsmasq to change uid and gid to something other
    # than the default, edit the following lines.
    user=arch
    #group=
    # If you want dnsmasq to listen for DHCP and DNS requests only on
    # specified interfaces (and the loopback) give the name of the
    # interface (eg eth0) here.
    # Repeat the line for more than one interface.
    interface=br0
    # Or you can specify which interface _not_ to listen on
    #except-interface=
    # Or which to listen on by address (remember to include 127.0.0.1 if
    # you use this.)
    #listen-address=
    # If you want dnsmasq to provide only DNS service on an interface,
    # configure it as shown above, and then use the following line to
    # disable DHCP and TFTP on it.
    #no-dhcp-interface=
    # On systems which support it, dnsmasq binds the wildcard address,
    # even when it is listening on only some interfaces. It then discards
    # requests that it shouldn't reply to. This has the advantage of
    # working even when interfaces come and go and change address. If you
    # want dnsmasq to really bind only the interfaces it is listening on,
    # uncomment this option. About the only time you may need this is when
    # running another nameserver on the same machine.
    bind-interfaces
    # If you don't want dnsmasq to read /etc/hosts, uncomment the
    # following line.
    #no-hosts
    # or if you want it to read another file, as well as /etc/hosts, use
    # this.
    #addn-hosts=/etc/banner_add_hosts
    # Set this (and domain: see below) if you want to have a domain
    # automatically added to simple names in a hosts-file.
    #expand-hosts
    # Set the domain for dnsmasq. this is optional, but if it is set, it
    # does the following things.
    # 1) Allows DHCP hosts to have fully qualified domain names, as long
    # as the domain part matches this setting.
    # 2) Sets the "domain" DHCP option thereby potentially setting the
    # domain of all systems configured by DHCP
    # 3) Provides the domain part for "expand-hosts"
    domain=local
    #domain=thekelleys.org.uk
    # Set a different domain for a particular subnet
    #domain=wireless.thekelleys.org.uk,192.168.2.0/24
    # Same idea, but range rather then subnet
    #domain=reserved.thekelleys.org.uk,192.68.3.100,192.168.3.200
    # Uncomment this to enable the integrated DHCP server, you need
    # to supply the range of addresses available for lease and optionally
    # a lease time. If you have more than one network, you will need to
    # repeat this for each network on which you want to supply DHCP
    # service.
    #dhcp-range=192.168.0.50,192.168.0.150,12h
    #dhcp-range=192.168.0.10,192.168.0.255,12h
    # This is an example of a DHCP range where the netmask is given. This
    # is needed for networks we reach the dnsmasq DHCP server via a relay
    # agent. If you don't know what a DHCP relay agent is, you probably
    # don't need to worry about this.
    #dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h
    dhcp-range=10.70.100.50,10.70.100.150,255.255.255.0,24h
    # This is an example of a DHCP range which sets a tag, so that
    # some DHCP options may be set only for this network.
    #dhcp-range=set:red,192.168.0.50,192.168.0.150
    # Use this DHCP range only when the tag "green" is set.
    #dhcp-range=tag:green,192.168.0.50,192.168.0.150,12h
    # Specify a subnet which can't be used for dynamic address allocation,
    # is available for hosts with matching --dhcp-host lines. Note that
    # dhcp-host declarations will be ignored unless there is a dhcp-range
    # of some type for the subnet in question.
    # In this case the netmask is implied (it comes from the network
    # configuration on the machine running dnsmasq) it is possible to give
    # an explicit netmask instead.
    #dhcp-range=192.168.0.5,static
    # Enable DHCPv6. Note that the prefix-length does not need to be specified
    # and defaults to 64 if missing/
    #dhcp-range=1234::2, 1234::500, 64, 12h
    # Do Router Advertisements, BUT NOT DHCP for this subnet.
    #dhcp-range=1234::, ra-only
    # Do Router Advertisements, BUT NOT DHCP for this subnet, also try and
    # add names to the DNS for the IPv6 address of SLAAC-configured dual-stack
    # hosts. Use the DHCPv4 lease to derive the name, network segment and
    # MAC address and assume that the host will also have an
    # IPv6 address calculated using the SLAAC alogrithm.
    #dhcp-range=1234::, ra-names
    # Do Router Advertisements, BUT NOT DHCP for this subnet.
    # Set the lifetime to 46 hours. (Note: minimum lifetime is 2 hours.)
    #dhcp-range=1234::, ra-only, 48h
    # Do DHCP and Router Advertisements for this subnet. Set the A bit in the RA
    # so that clients can use SLAAC addresses as well as DHCP ones.
    #dhcp-range=1234::2, 1234::500, slaac
    # Do Router Advertisements and stateless DHCP for this subnet. Clients will
    # not get addresses from DHCP, but they will get other configuration information.
    # They will use SLAAC for addresses.
    #dhcp-range=1234::, ra-stateless
    # Do stateless DHCP, SLAAC, and generate DNS names for SLAAC addresses
    # from DHCPv4 leases.
    #dhcp-range=1234::, ra-stateless, ra-names
    # Do router advertisements for all subnets where we're doing DHCPv6
    # Unless overriden by ra-stateless, ra-names, et al, the router
    # advertisements will have the M and O bits set, so that the clients
    # get addresses and configuration from DHCPv6, and the A bit reset, so the
    # clients don't use SLAAC addresses.
    #enable-ra
    # Supply parameters for specified hosts using DHCP. There are lots
    # of valid alternatives, so we will give examples of each. Note that
    # IP addresses DO NOT have to be in the range given above, they just
    # need to be on the same network. The order of the parameters in these
    # do not matter, it's permissible to give name, address and MAC in any
    # order.
    # Always allocate the host with Ethernet address 11:22:33:44:55:66
    # The IP address 192.168.0.60
    #dhcp-host=11:22:33:44:55:66,192.168.0.60
    # Always set the name of the host with hardware address
    # 11:22:33:44:55:66 to be "fred"
    #dhcp-host=11:22:33:44:55:66,fred
    # Always give the host with Ethernet address 11:22:33:44:55:66
    # the name fred and IP address 192.168.0.60 and lease time 45 minutes
    #dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m
    # Give a host with Ethernet address 11:22:33:44:55:66 or
    # 12:34:56:78:90:12 the IP address 192.168.0.60. Dnsmasq will assume
    # that these two Ethernet interfaces will never be in use at the same
    # time, and give the IP address to the second, even if it is already
    # in use by the first. Useful for laptops with wired and wireless
    # addresses.
    #dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.60
    # Give the machine which says its name is "bert" IP address
    # 192.168.0.70 and an infinite lease
    #dhcp-host=bert,192.168.0.70,infinite
    # Always give the host with client identifier 01:02:02:04
    # the IP address 192.168.0.60
    #dhcp-host=id:01:02:02:04,192.168.0.60
    # Always give the host with client identifier "marjorie"
    # the IP address 192.168.0.60
    #dhcp-host=id:marjorie,192.168.0.60
    # Enable the address given for "judge" in /etc/hosts
    # to be given to a machine presenting the name "judge" when
    # it asks for a DHCP lease.
    #dhcp-host=judge
    # Never offer DHCP service to a machine whose Ethernet
    # address is 11:22:33:44:55:66
    #dhcp-host=11:22:33:44:55:66,ignore
    # Ignore any client-id presented by the machine with Ethernet
    # address 11:22:33:44:55:66. This is useful to prevent a machine
    # being treated differently when running under different OS's or
    # between PXE boot and OS boot.
    #dhcp-host=11:22:33:44:55:66,id:*
    # Send extra options which are tagged as "red" to
    # the machine with Ethernet address 11:22:33:44:55:66
    #dhcp-host=11:22:33:44:55:66,set:red
    # Send extra options which are tagged as "red" to
    # any machine with Ethernet address starting 11:22:33:
    #dhcp-host=11:22:33:*:*:*,set:red
    # Give a fixed IPv6 address and name to client with
    # DUID 00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2
    # Note the MAC addresses CANNOT be used to identify DHCPv6 clients.
    # Note also the they [] around the IPv6 address are obilgatory.
    #dhcp-host=id:00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2, fred, [1234::5]
    # Ignore any clients which are not specified in dhcp-host lines
    # or /etc/ethers. Equivalent to ISC "deny unknown-clients".
    # This relies on the special "known" tag which is set when
    # a host is matched.
    #dhcp-ignore=tag:!known
    # Send extra options which are tagged as "red" to any machine whose
    # DHCP vendorclass string includes the substring "Linux"
    #dhcp-vendorclass=set:red,Linux
    # Send extra options which are tagged as "red" to any machine one
    # of whose DHCP userclass strings includes the substring "accounts"
    #dhcp-userclass=set:red,accounts
    # Send extra options which are tagged as "red" to any machine whose
    # MAC address matches the pattern.
    #dhcp-mac=set:red,00:60:8C:*:*:*
    # If this line is uncommented, dnsmasq will read /etc/ethers and act
    # on the ethernet-address/IP pairs found there just as if they had
    # been given as --dhcp-host options. Useful if you keep
    # MAC-address/host mappings there for other purposes.
    #read-ethers
    # Send options to hosts which ask for a DHCP lease.
    # See RFC 2132 for details of available options.
    # Common options can be given to dnsmasq by name:
    # run "dnsmasq --help dhcp" to get a list.
    # Note that all the common settings, such as netmask and
    # broadcast address, DNS server and default route, are given
    # sane defaults by dnsmasq. You very likely will not need
    # any dhcp-options. If you use Windows clients and Samba, there
    # are some options which are recommended, they are detailed at the
    # end of this section.
    # Override the default route supplied by dnsmasq, which assumes the
    # router is the same machine as the one running dnsmasq.
    #dhcp-option=3,1.2.3.4
    # Do the same thing, but using the option name
    #dhcp-option=option:router,1.2.3.4
    # Override the default route supplied by dnsmasq and send no default
    # route at all. Note that this only works for the options sent by
    # default (1, 3, 6, 12, 28) the same line will send a zero-length option
    # for all other option numbers.
    #dhcp-option=3
    # Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5
    #dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5
    # Send DHCPv6 option. Note [] around IPv6 addresses.
    #dhcp-option=option6:dns-server,[1234::77],[1234::88]
    # Send DHCPv6 option for namservers as the machine running
    # dnsmasq and another.
    #dhcp-option=option6:dns-server,[::],[1234::88]
    # Set the NTP time server address to be the same machine as
    # is running dnsmasq
    #dhcp-option=42,0.0.0.0
    # Set the NIS domain name to "welly"
    #dhcp-option=40,welly
    # Set the default time-to-live to 50
    #dhcp-option=23,50
    # Set the "all subnets are local" flag
    #dhcp-option=27,1
    # Send the etherboot magic flag and then etherboot options (a string).
    #dhcp-option=128,e4:45:74:68:00:00
    #dhcp-option=129,NIC=eepro100
    # Specify an option which will only be sent to the "red" network
    # (see dhcp-range for the declaration of the "red" network)
    # Note that the tag: part must precede the option: part.
    #dhcp-option = tag:red, option:ntp-server, 192.168.1.1
    # The following DHCP options set up dnsmasq in the same way as is specified
    # for the ISC dhcpcd in
    # http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt
    # adapted for a typical dnsmasq installation where the host running
    # dnsmasq is also the host running samba.
    # you may want to uncomment some or all of them if you use
    # Windows clients and Samba.
    #dhcp-option=19,0 # option ip-forwarding off
    #dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
    #dhcp-option=45,0.0.0.0 # netbios datagram distribution server
    #dhcp-option=46,8 # netbios node type
    # Send an empty WPAD option. This may be REQUIRED to get windows 7 to behave.
    #dhcp-option=252,"\n"
    # Send RFC-3397 DNS domain search DHCP option. WARNING: Your DHCP client
    # probably doesn't support this......
    #dhcp-option=option:domain-search,eng.apple.com,marketing.apple.com
    # Send RFC-3442 classless static routes (note the netmask encoding)
    #dhcp-option=121,192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8
    # Send vendor-class specific options encapsulated in DHCP option 43.
    # The meaning of the options is defined by the vendor-class so
    # options are sent only when the client supplied vendor class
    # matches the class given here. (A substring match is OK, so "MSFT"
    # matches "MSFT" and "MSFT 5.0"). This example sets the
    # mtftp address to 0.0.0.0 for PXEClients.
    #dhcp-option=vendor:PXEClient,1,0.0.0.0
    # Send microsoft-specific option to tell windows to release the DHCP lease
    # when it shuts down. Note the "i" flag, to tell dnsmasq to send the
    # value as a four-byte integer - that's what microsoft wants. See
    # http://technet2.microsoft.com/WindowsServer/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true
    #dhcp-option=vendor:MSFT,2,1i
    # Send the Encapsulated-vendor-class ID needed by some configurations of
    # Etherboot to allow is to recognise the DHCP server.
    #dhcp-option=vendor:Etherboot,60,"Etherboot"
    # Send options to PXELinux. Note that we need to send the options even
    # though they don't appear in the parameter request list, so we need
    # to use dhcp-option-force here.
    # See http://syslinux.zytor.com/pxe.php#special for details.
    # Magic number - needed before anything else is recognised
    #dhcp-option-force=208,f1:00:74:7e
    # Configuration file name
    #dhcp-option-force=209,configs/common
    # Path prefix
    #dhcp-option-force=210,/tftpboot/pxelinux/files/
    # Reboot time. (Note 'i' to send 32-bit value)
    #dhcp-option-force=211,30i
    # Set the boot filename for netboot/PXE. You will only need
    # this is you want to boot machines over the network and you will need
    # a TFTP server; either dnsmasq's built in TFTP server or an
    # external one. (See below for how to enable the TFTP server.)
    #dhcp-boot=pxelinux.0
    # The same as above, but use custom tftp-server instead machine running dnsmasq
    #dhcp-boot=pxelinux,server.name,192.168.1.100
    # Boot for Etherboot gPXE. The idea is to send two different
    # filenames, the first loads gPXE, and the second tells gPXE what to
    # load. The dhcp-match sets the gpxe tag for requests from gPXE.
    #dhcp-match=set:gpxe,175 # gPXE sends a 175 option.
    #dhcp-boot=tag:!gpxe,undionly.kpxe
    #dhcp-boot=mybootimage
    # Encapsulated options for Etherboot gPXE. All the options are
    # encapsulated within option 175
    #dhcp-option=encap:175, 1, 5b # priority code
    #dhcp-option=encap:175, 176, 1b # no-proxydhcp
    #dhcp-option=encap:175, 177, string # bus-id
    #dhcp-option=encap:175, 189, 1b # BIOS drive code
    #dhcp-option=encap:175, 190, user # iSCSI username
    #dhcp-option=encap:175, 191, pass # iSCSI password
    # Test for the architecture of a netboot client. PXE clients are
    # supposed to send their architecture as option 93. (See RFC 4578)
    #dhcp-match=peecees, option:client-arch, 0 #x86-32
    #dhcp-match=itanics, option:client-arch, 2 #IA64
    #dhcp-match=hammers, option:client-arch, 6 #x86-64
    #dhcp-match=mactels, option:client-arch, 7 #EFI x86-64
    # Do real PXE, rather than just booting a single file, this is an
    # alternative to dhcp-boot.
    #pxe-prompt="What system shall I netboot?"
    # or with timeout before first available action is taken:
    #pxe-prompt="Press F8 for menu.", 60
    # Available boot services. for PXE.
    #pxe-service=x86PC, "Boot from local disk"
    # Loads <tftp-root>/pxelinux.0 from dnsmasq TFTP server.
    #pxe-service=x86PC, "Install Linux", pxelinux
    # Loads <tftp-root>/pxelinux.0 from TFTP server at 1.2.3.4.
    # Beware this fails on old PXE ROMS.
    #pxe-service=x86PC, "Install Linux", pxelinux, 1.2.3.4
    # Use bootserver on network, found my multicast or broadcast.
    #pxe-service=x86PC, "Install windows from RIS server", 1
    # Use bootserver at a known IP address.
    #pxe-service=x86PC, "Install windows from RIS server", 1, 1.2.3.4
    # If you have multicast-FTP available,
    # information for that can be passed in a similar way using options 1
    # to 5. See page 19 of
    # http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf
    # Enable dnsmasq's built-in TFTP server
    #enable-tftp
    # Set the root directory for files available via FTP.
    #tftp-root=/var/ftpd
    # Make the TFTP server more secure: with this set, only files owned by
    # the user dnsmasq is running as will be send over the net.
    #tftp-secure
    # This option stops dnsmasq from negotiating a larger blocksize for TFTP
    # transfers. It will slow things down, but may rescue some broken TFTP
    # clients.
    #tftp-no-blocksize
    # Set the boot file name only when the "red" tag is set.
    #dhcp-boot=net:red,pxelinux.red-net
    # An example of dhcp-boot with an external TFTP server: the name and IP
    # address of the server are given after the filename.
    # Can fail with old PXE ROMS. Overridden by --pxe-service.
    #dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
    # If there are multiple external tftp servers having a same name
    # (using /etc/hosts) then that name can be specified as the
    # tftp_servername (the third option to dhcp-boot) and in that
    # case dnsmasq resolves this name and returns the resultant IP
    # addresses in round robin fasion. This facility can be used to
    # load balance the tftp load among a set of servers.
    #dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name
    # Set the limit on DHCP leases, the default is 150
    #dhcp-lease-max=150
    # The DHCP server needs somewhere on disk to keep its lease database.
    # This defaults to a sane location, but if you want to change it, use
    # the line below.
    #dhcp-leasefile=/var/lib/misc/dnsmasq.leases
    # Set the DHCP server to authoritative mode. In this mode it will barge in
    # and take over the lease for any client which broadcasts on the network,
    # whether it has a record of the lease or not. This avoids long timeouts
    # when a machine wakes up on a new network. DO NOT enable this if there's
    # the slightest chance that you might end up accidentally configuring a DHCP
    # server for your campus/company accidentally. The ISC server uses
    # the same option, and this URL provides more information:
    # http://www.isc.org/files/auth.html
    #dhcp-authoritative
    # Run an executable when a DHCP lease is created or destroyed.
    # The arguments sent to the script are "add" or "del",
    # then the MAC address, the IP address and finally the hostname
    # if there is one.
    #dhcp-script=/bin/echo
    # Set the cachesize here.
    #cache-size=150
    # If you want to disable negative caching, uncomment this.
    #no-negcache
    # Normally responses which come form /etc/hosts and the DHCP lease
    # file have Time-To-Live set as zero, which conventionally means
    # do not cache further. If you are happy to trade lower load on the
    # server for potentially stale date, you can set a time-to-live (in
    # seconds) here.
    #local-ttl=
    # If you want dnsmasq to detect attempts by Verisign to send queries
    # to unregistered .com and .net hosts to its sitefinder service and
    # have dnsmasq instead return the correct NXDOMAIN response, uncomment
    # this line. You can add similar lines to do the same for other
    # registries which have implemented wildcard A records.
    #bogus-nxdomain=64.94.110.11
    # If you want to fix up DNS results from upstream servers, use the
    # alias option. This only works for IPv4.
    # This alias makes a result of 1.2.3.4 appear as 5.6.7.8
    #alias=1.2.3.4,5.6.7.8
    # and this maps 1.2.3.x to 5.6.7.x
    #alias=1.2.3.0,5.6.7.0,255.255.255.0
    # and this maps 192.168.0.10->192.168.0.40 to 10.0.0.10->10.0.0.40
    #alias=192.168.0.10-192.168.0.40,10.0.0.0,255.255.255.0
    # Change these lines if you want dnsmasq to serve MX records.
    # Return an MX record named "maildomain.com" with target
    # servermachine.com and preference 50
    #mx-host=maildomain.com,servermachine.com,50
    # Set the default target for MX records created using the localmx option.
    #mx-target=servermachine.com
    # Return an MX record pointing to the mx-target for all local
    # machines.
    #localmx
    # Return an MX record pointing to itself for all local machines.
    #selfmx
    # Change the following lines if you want dnsmasq to serve SRV
    # records. These are useful if you want to serve ldap requests for
    # Active Directory and other windows-originated DNS requests.
    # See RFC 2782.
    # You may add multiple srv-host lines.
    # The fields are <name>,<target>,<port>,<priority>,<weight>
    # If the domain part if missing from the name (so that is just has the
    # service and protocol sections) then the domain given by the domain=
    # config option is used. (Note that expand-hosts does not need to be
    # set for this to work.)
    # A SRV record sending LDAP for the example.com domain to
    # ldapserver.example.com port 389
    #srv-host=_ldap._tcp.example.com,ldapserver.example.com,389
    # A SRV record sending LDAP for the example.com domain to
    # ldapserver.example.com port 389 (using domain=)
    #domain=example.com
    #srv-host=_ldap._tcp,ldapserver.example.com,389
    # Two SRV records for LDAP, each with different priorities
    #srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,1
    #srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,2
    # A SRV record indicating that there is no LDAP server for the domain
    # example.com
    #srv-host=_ldap._tcp.example.com
    # The following line shows how to make dnsmasq serve an arbitrary PTR
    # record. This is useful for DNS-SD. (Note that the
    # domain-name expansion done for SRV records _does_not
    # occur for PTR records.)
    #ptr-record=_http._tcp.dns-sd-services,"New Employee Page._http._tcp.dns-sd-services"
    # Change the following lines to enable dnsmasq to serve TXT records.
    # These are used for things like SPF and zeroconf. (Note that the
    # domain-name expansion done for SRV records _does_not
    # occur for TXT records.)
    #Example SPF.
    #txt-record=example.com,"v=spf1 a -all"
    #Example zeroconf
    #txt-record=_http._tcp.example.com,name=value,paper=A4
    # Provide an alias for a "local" DNS name. Note that this _only_ works
    # for targets which are names from DHCP or /etc/hosts. Give host
    # "bert" another name, bertrand
    #cname=bertand,bert
    # For debugging purposes, log each DNS query as it passes through
    # dnsmasq.
    #log-queries
    # Log lots of extra information about DHCP transactions.
    #log-dhcp
    # Include a another lot of configuration options.
    #conf-file=/etc/dnsmasq.more.conf
    #conf-dir=/etc/dnsmasq.d
    4)
    iptables -F
    iptables -t nat -F
    iptables -P INPUT DROP
    iptables -P OUTPUT ACCEPT
    iptables -P FORWARD ACCEPT
    iptables -A INPUT -i lo -j ACCEPT
    iptables -A INPUT -i br0 -j ACCEPT
    iptables -A INPUT -i wlan0 -j ACCEPT
    iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
    iptables -A INPUT -p 41 -j ACCEPT
    iptables -A INPUT -p icmp -j ACCEPT
    iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
    iptables -t nat -A POSTOUTING -o eth0 -j MASQUERADE
    rc.d save iptables
    /etc/rc.d/iptables start
    :: Starting IP Tables [DONE]
    In sum:
    ifconfig
    br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    inet 10.70.100.161 netmask 255.255.0.0 broadcast 10.70.255.255
    inet6 fe80::92e6:baff:fe83:1f33 prefixlen 64 scopeid 0x20<link>
    ether 90:e6:ba:83:1f:33 txqueuelen 0 (Ethernet)
    RX packets 29337 bytes 8111048 (7.7 MiB)
    RX errors 0 dropped 1784 overruns 0 frame 0
    TX packets 5568 bytes 756908 (739.1 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    eth0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 1500 metric 1
    ether 90:e6:ba:83:1f:33 txqueuelen 1000 (Ethernet)
    RX packets 285252 bytes 323627813 (308.6 MiB)
    RX errors 0 dropped 37 overruns 0 frame 0
    TX packets 133067 bytes 10924478 (10.4 MiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 metric 1
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 0 (Local Loopback)
    RX packets 174 bytes 5542 (5.4 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 174 bytes 5542 (5.4 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    mon.wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    unspec CC-B2-55-00-B0-F6-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
    RX packets 2 bytes 262 (262.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    inet6 fe80::ceb2:55ff:fe00:b0f6 prefixlen 64 scopeid 0x20<link>
    ether cc:b2:55:00:b0:f6 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 20653 bytes 2063361 (1.9 MiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    iwconfig
    br0 no wireless extensions.
    mon.wlan0 IEEE 802.11bgn Mode:Monitor Frequency:2.412 GHz Tx-Power=0 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Power Management:on
    eth0 no wireless extensions.
    lo no wireless extensions.
    wlan0 IEEE 802.11bgn Mode:Master Frequency:2.412 GHz Tx-Power=0 dBm
    Retry long limit:7 RTS thr:off Fragment thr:off
    Power Management:on
    In wifi settings MultiPad 9.7 Pro written "connected", but i can't open any web site (timed out).
    I don't know what's wrong.
    Thanks in advice.
    PS: my D-Link DWA-125 working in access point mode very well on Windows 7
    Last edited by 32reg (2012-08-12 10:07:47)

    1) I deleted bridge-utils, netcfg
    2) I edited /etc/hostapd/hostapd.conf:
    interface=wlan0
    #bridge=br0
    edited /etc/dnsmasq.conf:
    interface=wlan0
    dhcp-range=192.168.0.2,192.168.0.255,255.255.255.0,24h
    and edited /etc/rc.local:
    ifconfig wlan0 192.168.0.1 netmask 255.255.255.0
    ifconfig wlan0 up
    3) I added in autostart these daemons: hostapd, dnsmasq and iptables.
    Profit!

  • SQL query or function...

    Hi everyone,
      Please help me to clarify this question
    I have a "patient" table and a "address" table.And each patient has differnt types of addresses
    like PMI,Mailing and default address i need to pick patient address in the order of preference
    (PMI,Mailing ,Default)
    I have two options to get the address of a patient.Either write a SQL query to get the address of a
    patient(according to preference)
    or write a function which checks
    if there is PMI,Mailing and default
      take PMI
    or
    If there is mailing and Default
    take mailing
    or
    take default.
    which one is the best method to get the address of a patient?  SQL query or function..
    Definitely everyone will say that it should be direct SQL query instead of multiple function calls.
    But in my organization there are many developers which will get "patient address" in their application
    or SQL code or PL/SQL code or from some
    'X' Business intelligence tool.
    At this scenario is it best to have a function which every one will call and get a standardized output
    for every one.
    Question:
    In my scenario which one is the best to have "SQL query or function"?
    if i choose "function" i have to sacrifice the performance
    if i choose "SQL query" i am not sure whether each and every developer querying the same way as it would be
    Sorry if it is a dumb question to ask.
    Thanks in advance
    phani

    question for hoek: what if i have to choose between SQL query and function? (suppose they dont accept to create a view)If views are not accepted (which is very strange imo), but you do need some 'standard object' which everybody can use, then you'd choose to use a function instead of everybody having 'their own query'.
    It's a trade-off between maintaining standards and performance (calling PL/SQL from SQL is usually to be avoided due to context-switching, the other way around is OK).
    One advantage of a view: no hassle with parameters you have to enter but never will use, you just pick the columns you need and there you go.
    Other one: it's straightforward, simple and clear.
    It's easier to maintain.
    But it all depends on what your function will return.
    Perhaps a REF CURSOR?
    Your question reminds me of this interesting discussion:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:672724700346558185
    Edited by: hoek on Jul 1, 2009 4:39 PM tyop's

  • Oracle 10g Diff in execution plan query with binding var Vs without

    We recently did 10g upgrade. In 10g, execution plan differs for query with binding var(thru jdbc etc) Vs without it as given below. For query with binding var,
    it chooses poor execution plan(no index is used, full scan is done etc). everything worked fine in 9i. To rectify the problem, we have to hint query with right index,join etc. but i dont like this solution.
    I would rather prefer to correct database to choose right execution path instead of eacy query level. but not sure what causes the issue.
    Does anybody came across this issue? if so, Please share your experiences. Thanks for the help. Do let me know if you need more info.
    1. Query without binding bar:
    select * from test where col1 = :1 and col2 = :2
    1. Query without binding bar:
    select * from test where col1 = 'foo' and col2= 'bar'

    I am not an expert but in my humble opinion it is the developer's responsability to ensure the correct explain plan is used before deploying code to production, if the explain plan returned by the DB is bad, then the use of a hint is perfectly acceptable.
    Check this out: http://lcgapp.cern.ch/project/CondDB/snapshot/performance.html
    Excerpt:
    Bind variable peeking. If an SQL query contains bind variables, the optimal execution plan may depend on the values of those variables. When the Oracle query optimizer chooses the execution plan for such a query, it may indeed look at the values of all bind variables involved: this is known as "bind variable peeking".
    In summary, the execution plan used for a given SQL query cannot be predicted a priori because it depends on the presence and quality of statistics and on the values of bind variables used at the time the query was first executed (hard-parsed). As a consequence of this instability of execution plans, very different performances may be observed for the same SQL query. In COOL, this issue is addressed by adding Oracle hints to the queries, to make sure that the same (good) plan is used in all cases, even with unreliable statistics or unfavourable bind variables.
    Edited by: Rodolfo Ferrari on Jun 3, 2009 9:40 PM

Maybe you are looking for