FAST refreshable MVIEW moving to COMPLETE refresh only - materialized-views

I have created below FAST refresh MVIEW which does couple of FAST refreshes immediately after creation and all subsequent refreshes are happening as COMPLETE refresh ( DELETE + full INSERT)
CREATE MATERIALIZED VIEW tcl_rino.mv_override_info
(
.
.
.
.
) TABLESPACE tclrinodata
PCTUSED 0
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (INITIAL 64 K
NEXT 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT)
NOCACHE NOLOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
REFRESH FAST ON DEMAND WITH PRIMARY KEY
AS
SELECT ov.ROWID,
cu.ROWID,
brd.ROWID,
sl.ROWID,
ctry.ROWID,
ovrs.ROWID,
sgt.ROWID,
brc.ROWID,
bpd.ROWID,
ard.ROWID,
actry.ROWID,
aci.ROWID,
bci.ROWID,
codecs.ROWID,
ovrc.ROWID,
.
.
.
.
FROM override ov,
customer cu,
routing_destination brd,
service_level sl,
country ctry,
override_reason ovrs,
signaling_type sgt,
bearer_capability brc,
pricing_destination bpd,
routing_destination ard,
country actry,
mv_country_iso bci,
mv_country_iso aci,
mv_override_cl_codec codecs,
mv_override_recurrence ovrc
WHERE cu.cust_id(+) = ov.cust_id
AND brd.rtng_dest_id(+) = ov.b_rtng_dest_id
AND sl.sl_id(+) = ov.sl_id
AND ctry.ctry_abbr(+) = ov.b_ctry_abbr
AND ovrs.ovrs_id(+) = ov.ovrs_id
AND sgt.sig_type_id(+) = ov.signaling_type
AND brc.brc_id(+) = ov.bearer_capability
AND bpd.prcng_dest_id(+) = ov.b_prcng_dest
AND ard.rtng_dest_id(+) = ov.a_rtng_dest_id
AND actry.ctry_abbr(+) = ov.a_ctry_abbr
AND bci.ctry_abbr(+) = ov.b_ctry_abbr
AND aci.ctry_abbr(+) = ov.b_ctry_abbr
AND codecs.ov_id(+) = ov.ov_id
AND ovrc.ov_id(+) = ov.ov_id;
dbms_mview.explain_mview output immediately after MVIEW creation :
Capable of:
REFRESH_COMPLETE
REFRESH_FAST
SCN based refresh
REFRESH_FAST_AFTER_INSERT
REFRESH_FAST_AFTER_ONETAB_DML
REFRESH_FAST_AFTER_ANY_DML
Not Capable of:
REWRITE
REWRITE_FULL_TEXT_MATCH
must name this expression with a column alias
Oracle error: see RELATED_NUM and RELATED_TEXT for details
REWRITE_FULL_TEXT_MATCH
query rewrite is disabled on the materialized view
REWRITE_PARTIAL_TEXT_MATCH
materialized view cannot support any type of query rewrite
REWRITE_PARTIAL_TEXT_MATCH
query rewrite is disabled on the materialized view
REWRITE_GENERAL
materialized view cannot support any type of query rewrite
REWRITE_GENERAL
query rewrite is disabled on the materialized view
But it quickly turns into below after few DMLs happens in the base table
Capable of:
REFRESH_COMPLETE
Not Capable of:
REFRESH_FAST
REWRITE
REFRESH_FAST_AFTER_INSERT
TCL_RINO.MV_OVERRIDE_RECURRENCE
mv log is newer than last full refresh
REFRESH_FAST_AFTER_INSERT
TCL_RINO.MV_OVERRIDE_CL_CODEC
mv log is newer than last full refresh
REFRESH_FAST_AFTER_ONETAB_DML
see the reason why REFRESH_FAST_AFTER_INSERT is disabled
REFRESH_FAST_AFTER_ANY_DML
see the reason why REFRESH_FAST_AFTER_ONETAB_DML is disabled
REWRITE_FULL_TEXT_MATCH
must name this expression with a column alias
Oracle error: see RELATED_NUM and RELATED_TEXT for details
REWRITE_FULL_TEXT_MATCH
query rewrite is disabled on the materialized view
REWRITE_PARTIAL_TEXT_MATCH
materialized view cannot support any type of query rewrite
REWRITE_PARTIAL_TEXT_MATCH
query rewrite is disabled on the materialized view
REWRITE_GENERAL
materialized view cannot support any type of query rewrite
REWRITE_GENERAL
query rewrite is disabled on the materialized view
Can someone please throw light what wrong is done here ? Much appreciated

Related

Can I use a ForAll and UpdateIf within a local offline Powerapps collection?

Can anyone help?I need assistance to collect multiple records in a gallery and save it to a local collection when offline.
When my app is connected, my script uses a ForAll to go through all the gallery items then if the Question ID matches the ID in the gallery, it patches the records to the SQL database. This part works fine.
However, when offline, I collect the items and save them to a local collection called LocalAnswers. It only saves 1 record (instead of 20) and does not pull in the Question ID. I have tried inserting a ForAll and UpdateIf within my Collect function but can't seem to get it right. Any ideas?
If(
Connection.Connected,
ForAll(
Gallery2.AllItems,
UpdateIf(
AuditAnswers,
ID = Value(IDGal.Text),
{
AuditID: IDAuditVar,
Answer: Radio1.Selected.Value,
Action: ActionGal.Text,
AddToActionPlan: tglAction.Value
}
)
),
Collect(
LocalAnswers,
{
AuditID: IDAuditVar,
Answer: Radio1.Selected.Value,
Action: ActionGal.Text,
AddToActionPlan: tglAction.Value
}
)
);
Collect only pulls a single record because you only have a single record defined (everything between the {}).
I don't typically create collections from Gallery.AllItems but rather from a Data Source (Sharepoint, SQL, another Collection, etc.), so not sure if this will work without testing.
Try something like:
ForAll(Gallery2.AllItems,
Collect(colLocalAnswers,
{
AuditID: ThisRecord.AuditID, //or whatever the control's name is
Answer: ThisRecord.Radio1.Selected.Value,
Action: ThisRecord.ActionGal.Text,
AddToActionPlan: ThisRecord.tglAction.Value
}
)
);
SaveDate(colLocalAnswers, "localfile")

SAPUI5 - Input error on growing list, logic issue

I am having an issue with a growing list. Previously I had a normal list, but as it is limited to displaying 100 items, I need to now change this to a growing list, which works fine now and I can get over 100 items loaded when I've put the growing="true" growingThreshold="50" growingScrollToLoad="false" properties on the list.
But now I have an issue with one of the number inputs in the custom list, when entering a number it is not staying set (it has a liveChange event that updates a text component).
I've set a breakpoint in the controller to test and it seems to bug out when I am trying to set the data changes (red arrow on attached image).
Can anyone see the issue with the logic? If any additional code snippets are required I could provide them.
onReceivedQuantityChange: function (oEvent) {
// get model and data
var oModel = this.getOrderModel();
var oData = oModel.getData();
// get item from path
var oItem = this._getOrderItemByPath(oEvent.getSource().getBindingContext(this.MODEL_ORDERS).getPath());
// set received value
oItem._ReceivedValue = oEvent.getParameters().newValue * (oItem.ValuationPrice / oItem.Quantity);
// apply data changes
oModel.setData(oData);
},
Controller code image
onReceivedQuantityChange: function (oEvent) {
var oModel = this.getOrderModel()
var sItemPath = oEvent.getSource().getBindingContext(this.MODEL_ORDERS).getPath()
var iValuationPrice = oModel.getProperty(sItemPath + '/ValuationPrice')
var iQuantity = oModel.getProperty(sItemPath + '/Quantity')
var iNewValue = oEvent.getParameters().newValue
var iReceivedValue = iNewValue * (iValuationPrice / iQuantity)
oModel.setProperty(sItemPath + '/_ReceivedValue', iReceivedValue)
}
If you use setProperty() on the Model you're only chaning the specific Property in DataModel and Sapui5 is able to proceed bindingchanges on this Property only (and not the whole model).
If you get the data out of the model by getData() you are only getting a reference to this Object. If you change something on this Object, you don't have to set it back by setData() (it is already there because you used the reference of this Object).
But Sapui5 need to know that there was a specific change in datamodel and this is done by using setProperty()

Create NewRecord through Siebel Business Service eScript

I am trying to create a new record using BS server script.
Since the process is taking place inside the BS, the context of Parent is not present, hence I am unable to get Parent Row_Id which I need to explicitly stamp against the child record being created for visibility.
Initially I tried to pass the Parent Row_Id from applet as a profile, but this fails when there are no records in the child applet, ie this.BusComp().ParentBusComp().GetFieldValue returns "This operation is invalid when there are no records present" as the "this" context is unavailable.
Any suggestions?
I was able to achieve the desired with the below code
sId = TheApplication().ActiveBusObject().GetBusComp("Q").ParentBusComp().GetFieldValue("Id");
if(this.BusComp().CountRecords() > 0)
{
sA = TheApplication().ActiveBusObject().GetBusComp("Q").GetFieldValue("A");
sB = TheApplication().ActiveBusObject().GetBusComp("Q").GetFieldValue("B");
}
sEntity = TheApplication().ActiveBusObject().GetBusComp("Q").Name();
It is for these reasons that Siebel provides Pre-Default settings at the Business Component Field level. If you wish to do this entirely through scripting, you will have to find the Active context, you have to know which BC is the parent.
Lets say you know that the Parent BC has to be Account. So
ActiveBusObject().GetBusComp("Account").GetFieldValue("Id") will give you the row id of the currently selected Account BC record. But do make sure that this script fires only in this context. So check the ActiveViewName to check this.
if(TheApplication().GetProfileAttr("ActiveViewName")=="Custom View")
{
//put the scripting here.
}

APEX 3.2 (Oracle): on change of an item dynamically populates the values of other items on the page

I am on APEX 3.2 and in a form used to insert fields f1 and f2 in table f, I would like to have a couple of text items that will automatically populate and display based on the data typed in f1 and from a query on table t. In other word, typing empno in f1, moving to the f2 box the user should automaticcaly see emp last_name and first_name displayed. This way she can verify the empno typed was correct, type other data in f2 and submit the form.
Any suggestion on how to reach this scope?
I guess I should use some javascript.
Many thanks.
Gabriele
I can see that you may already be going down the javascript road... I have worked with APEX 3.2 in the past on a similar problem and didn't know enough javascript to get this kind of dynamic functionality out of the platform. If you want to try an alternate method, you can tweak your user interface to provide the functionality you seek, but you'll have to check with the users if they can adapt to this style of approach, which you should be able to do using existing 3.2 functionality and no additional scripting:
Requirements:
Based on field inputs of field1 and field2, auto-populate an apex page with data from an existing table so that the user can confirm if the data inputted in field1 and field2 are correct. Use the data from the search results as parameters for input to a new process or form.
Suggested Design:
Page 1: start with blank page, then add three items: field1, field2 and a "submit" button.
add page process (after submit, conditional on submit button item) that redirects to Page 2 setting items P2_field1 and P2_field2 from the values on the Page 1 form.
Page 2: report page. set a query that will search your table of existing employees searching by partial or full string searches against the employee table. APEX 3.2 used to use the following convention to get around partial and case sensitive matching issues:
SELECT field1, field2, field3, field4, ...
FROM table1
WHERE instr(upper(field1), upper(:P2_field1), 1, 1) > 0
AND instr(upper(field2), upper(:P2_field2), 1, 1) > 0
Creating a report output "table" for a search effort helps when there may be multiple answers to the same search query... such as with common names like "Smith" or "John"...
Add an additional column to the report output or make the name column (field1 or field2) a linked column that goes to page 3 feeding the queried data from the employee table.
add the property to the column value on the report editor: redirect to "page 3", set P3_key = #KEY# where page 3 is your final target form or process and "key" is the index or primary key of the table you are searching from... or you can feed the n number of values needed already queried from the lookup table to populate the page 2 report.
I guess the important take-home is an appreciation for the limitations of older versions of Apex along with possible limitations with knowledge of advanced web scripting languages. Your requirements are still achievable even if all you are familiar with is the basics of your Apex version and a little SQL.
note: if your lookup table is HUGE (hundreds of thousands of records), you may need to consult your DBA for help with optimizing the table to handle the SQL search query. Adding UPPER and INSTR functions to the WHERE criteria isn't really the most efficient way to query large datasets without additional help in optimization.
I'm not a 3.2 wiz, i haven't worked with it. I do know there are no dynamic actions and no page on-demand process points, so i've worked with that in mind.
Application process: 'get_emp_details'
(I don't know the processing point you can/need to choose in 3.2. If you can pick on-demand, go for it.)
Code:
DECLARE
lEmp emp%rowtype;
BEGIN
SELECT *
INTO lEmp
FROM emp
WHERE empno = :P7_EMPNO;
htp.p('{"result":"ok", "emp":{"ename":"'||lEmp.ename||'","job":"'||lEmp.job||'"}}');
EXCEPTION
WHEN no_data_found THEN
htp.p('{"result":"nok", "emp":{}}');
END;
On your page (in my case i have used page 7, change the page numbers to your page number!) put this in the html headers section (or if you have the javascript section there, put the javascript code there without the script tags):
Edit: added in console.log lines. Mind that these will produce javascript errors in IE when the developer tools (F12) are not opened!
<script type="text/javascript">
$(document).ready(function(){
console.log('document is ready');
$("#P7_EMPNO").change(function(){
var oDBGet = new htmldb_Get(null, $('pFlowId').val(), "APPLICATION_PROCESS=get_emp_details", '0');
oDBGet.add('P7_EMPNO', $("#P7_EMPNO").val());
var oResult = oDBGet.get();
var lReturn = $.parseJSON(oResult);
if(lReturn.result=='ok'){
var lEmp = lReturn.emp;
$("#P7_ENAME").val(lEmp.ename);
} else {
alert('ename could not be found for this empno!');
};
});
});
</script>
This will do an ajax callback when the EMPNO changes, and change the ename of the employee. Since there are no temporary application items that can be used (apex_application.g_x##) i'm submitting the required page item to session state. In this case P7_EMPNO is added to the p_arg_names array and its value in the corresponding position in the p_arg_values array. This is necessary because the session state of P7_EMPNO is used in the application process.
When inspecting the console tab in Firebug:
Post values of ajax call:
Response values of ajax call:
Tom,
here is your code modified to work in my system:
-- On Demand Application Process get_emp_details:
DECLARE
lEmp emp%rowtype;
BEGIN
SELECT *
INTO lEmp
FROM emp
WHERE badge = :P2_BADGE;
htp.p('{"result":"ok", "emp":{"lastname":"'||lEmp.last_name||'","firstname":"'||lEmp.first_name||'"}}');
EXCEPTION
WHEN no_data_found THEN
htp.p('{"result":"nok", "emp":{}}');
END;
-- Javascript in page header:
<script type="text/javascript">
$(document).ready(function(){
$("#P2_BADGE").change(function(){
$.post('wwv_flow.show',
{"p_request" : "APPLICATION_PROCESS=get_emp_details",
"p_flow_id" : $v('pFlowId'),
"p_flow_step_id" : '0',
"p_instance" : $v('pInstance'),
"p_arg_names" : ['P2_BADGE'],
"p_arg_values" : [$('#P2_BADGE').val()]},
function(data){
if(data){
var lReturn = $.parseJSON(data);
if(lReturn.result=='ok'){
var lEmp = lReturn.emp;
$("#P2_LAST_NAME").val(lEmp.last_name);
} else {
alert('ename could not be found for this empno!');
};
};
}
);
});
});
</script>
I am probably missing something and it doesn't display last_name in P2_LAST_NAME when I type the badge number in P2_BADGE.
Thanks,
Gabriele
Tom, here is what I have in the watch right window of firebug for the function(data) step:
this
function()
arguments
[
"wwv_flow.show"
, Object { p_request=
"APPLICATION_PROCESS=get_emp_details"
, p_flow_id=
"120"
, p_flow_step_id=
"0"
, more...}, function()]
0
"wwv_flow.show"
1
Object { p_request=
"APPLICATION_PROCESS=get_emp_details"
, p_flow_id=
"120"
, p_flow_step_id=
"0"
, more...}
p_arg_names
[
"P2_BADGE"
]
p_arg_values
[
"155752"
]
p_flow_id
"120"
p_flow_step_id
"0"
p_instance
"2189517750670012"
p_request
"APPLICATION_PROCESS=get_emp_details"
2
function()
e
"wwv_flow.show"
r
Object { p_request=
"APPLICATION_PROCESS=get_emp_details"
, p_flow_id=
"120"
, p_flow_step_id=
"0"
, more...}
p_arg_names
[
"P2_BADGE"
]
p_arg_values
[
"155752"
]
p_flow_id
"120"
p_flow_step_id
"0"
p_instance
"2189517750670012"
p_request
"APPLICATION_PROCESS=get_emp_details"
s
undefined
i
function()
toString
function()
Closure Scope
Closure Scope { toString=function()}
Closure Scope
Closure Scope { toString=function()}
Window
Window f?p=120:2:2189517750670012::NO:::
From my firebug 1.10.6 console:
document is ready
f?p=12...::NO::: (line 29)
empno has changed
f?p=12...::NO::: (line 31)
performing a post with empno value: undefined
f?p=12...::NO::: (line 32)
POST
400 Bad Request
48ms
wwv_fl....min.js (line 2)
HeadersPostResponseHTMLCookies
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY><H1>Bad Request</H1>
The HTTP client sent a request that this server could not understand.</BODY></HTML>
-- And the post tab:
Parametersapplication/x-www-form-urlencoded
p_arg_names[] P2_BADGE
p_arg_values[] 155751
p_flow_id 120
p_flow_step_id 0
p_instance 4466366911674565
p_request APPLICATION_PROCESS=get_emp_details
Source
p_request=APPLICATION_PROCESS%3Dget_emp_details&p_flow_id=120&p_flow_step_id=0&p_instance=4466366911674565&p_arg_names%5B%5D=P2_BADGE&p_arg_values%5B%5D=155751

ColdFusion HTTP POST large strings

Has anyone noticed that if you try to post a string that exceeds 1,000,000 characters, it simply does not include the field with the request?
...and doesn't throw()!
eg.
<cfscript>
var h = new http( url = "http://...", method = "post" );
h.addParam( type = "formField", name = "a", value = repeatString("a",5000) );
h.addParam( type = "formField", name = "b", value = repeatString("b",1000000) );
h.addParam( type = "formField", name = "c", value = repeatString("c",1000001) );
var p = h.send().getPrefix();
writeDump( var = p, abort = true );
</cfscript>
The "a" and "b" fields are present in the form scope of the recipient page.
The "c" field is missing!
ColdFusion 9,0,1,274733 + chf9010002.jar, Mac OS X 10.6.8, Java 1.6.0_31
Edit: It now works as expected!
Not sure what has changed? My cf admin configuration remains the same. The only possible candidate I can come up with is a recent Apple Java update. Could that be it?
You may need to specify
enctype="multipart/form-data"
This is a setting within CF administrator.
In Coldfusion 9 (this setting has existed for a while, but may exist elsewhere in other versions):
Click on "server settings" group to expand, click on "settings" link (top link). On the settings page:
Maximum size of post data 100 MB (default)
Limits the amount of data that can be posted to the server in a single request. ColdFusion rejects requests larger than the specified limit.
It's interesting that you're hitting a limit right at 100,000 ; sounds like someone got a little lazy with the "bytes" computation. :) At any rate, I'd try tinkering with this setting.
Just an FYI: You'll encounter a similar issue with data truncation on data inserts/updates unless you set your datasource to allow "Long Text Buffer (chr)" greater than the 64,000 default limit.