GroupDataModel update of the data
Hello
I have a ListView that has a GroupDataModel that reads a JSON file. I load the file and all is well. Data is grouped into three sections. The data can have one to three of the sections (type = 1-3) filled in. I try to copy the data from the manditory section (type = 3) and copy it into one of the other sections. In the case of type 2 type 1. I have check that type 2 does not already exist in the type 1. It works (for the most part), but sometimes when I copy a type 2 to type 1, data gets changed correctly, but it grows upward from the ListView and makes a fourth group, but data are good and the group header is also correct. Is this a bug? Can someone please take a look at my code and see if it's an encoding issue or a bug?
ActionItem { id: favoriteActionItem title: coursesListItem.ListItem.view.getActionItemTitle("favorite", ListItemData) imageSource: coursesListItem.ListItem.view.getActionItemImageSource("favorite", ListItemData) enabled: coursesListItem.ListItem.view.getActionItemEnabled("favorite", ListItemData) onTriggered: { if (ListItemData.type == 1) { // If course is a favorite, then remove. coursesListItem.ListItem.view.favoriteAction(QueryOp.FavoriteRemove, ListItemData.courseid) // Handle ListView updating coursesListItem.ListItem.view.dataModel.remove(ListItemData); } else { // Add course as a favorite. coursesListItem.ListItem.view.favoriteAction(QueryOp.FavoriteAdd, ListItemData.courseid) // Handle ListView updating // * Check that selected list item is not already a favorite by setting the sort keys var searchKeys = [ "1", "0000", ListItemData.name ]; // * Try and find the data in the favorites and get the QVariantList results var searchResults = coursesListItem.ListItem.view.dataModel.find(searchKeys); coursesListItem.ListItem.view.setindexPathResults("searchResults", searchResults); // Display // * If the QVariantList has no records, then add the modified data if (searchResults.length < 1) { var favoriteListItem = ListItemData; favoriteListItem.type = 1; favoriteListItem.distsort = '0000'; favoriteListItem.distance = ''; coursesListItem.ListItem.view.dataModel.insert(favoriteListItem); } } } }
Thanks in advance.
Guessed it. I had to have my key research and changes as strings.
ActionItem { id: favoriteActionItem title: coursesListItem.ListItem.view.getActionItemTitle("favorite", ListItemData) imageSource: coursesListItem.ListItem.view.getActionItemImageSource("favorite", ListItemData) enabled: coursesListItem.ListItem.view.getActionItemEnabled("favorite", ListItemData) onTriggered: { if (ListItemData.type == 1) { // If course is a favorite, then remove. coursesListItem.ListItem.view.favoriteAction(QueryOp.FavoriteRemove, ListItemData.courseid) // Handle ListView updating coursesListItem.ListItem.view.dataModel.remove(ListItemData); } else { // Add course as a favorite. coursesListItem.ListItem.view.favoriteAction(QueryOp.FavoriteAdd, ListItemData.courseid) // Handle ListView updating // * Check that selected list item is not already a favorite by setting the sort keys var searchKeys = [ '1', '0000', ListItemData.name ]; // * Try and find the data in the favorites and get the QVariantList results var searchResults = coursesListItem.ListItem.view.dataModel.find(searchKeys); // * If the QVariantList has no records, then add the modified data if (searchResults.length < 1) { var favoriteListItem = ListItemData; favoriteListItem.type = '1'; favoriteListItem.distsort = '0000'; favoriteListItem.distance = ''; coursesListItem.ListItem.view.dataModel.insert(favoriteListItem); } } } }
Tags: BlackBerry Developers
Similar Questions
-
Need help on the essential "UPDATE" of the data in the table...
Published by: W Nicloei on May 27, 2011 01:10Dear experts, Need Advice... I have one table in which i have 200,000 records, now in this table for each record i have to update quantity figures... To perform such bulk update i am using the following method... *1. At first i create TYPE* CREATE OR REPLACE TYPE T_OBJ_GET_QTY (--); *2. Create TYPE as table of object created in step 1* CREATE OR REPLACE TYPE T_GET_TEST_QTY AS TABLE OF T_OBJ_GET_QTY; *3. assign object type to the variable* p_get_test_qty T_GET_TEST_QTY; (Created in step 2). *4. now i write the cursor using type created in step 1...* cursor c_upd_qty as select T_OBJ_GET_QTY( col1, col2) from v_view; *5. open cursor and fetch into variable created in step 3...* open c_upd_qty; loop fetch bulk collect into p_get_test_qty limit 1000; --perfom update now.. forall rec_upd_qty in 1..p_get_test_qty.count update table t1 set c1 = treat(p_get_test_qty(rec_upd_qty) as T_OBJ_GET_QTY).c1 exit when notfound; end loop; close c1; Kindly let me if this correct way to perform bulk update of the data, or is there any better way to do so... Please share your inputs... I hope i am clear in asking my question Regards nic
Published by: W Nicloei on May 27, 2011 01:36
Published by: W Nicloei on May 27, 2011 01:45Ahh, ok.
And a row of the view corresponds to a line in the table that you want to update?
I guess that your update statement would have a WHERE clause identifies the row to be updated, right?If so, why not "merge" the view in the table, using the MERGE Oracle statement?
Something like:
MERGE INTO target_table tgt USING source_view vw ON ( vw.key-column(s) = tgt.key-column(s) ) WHEN MATCHED THEN UPDATE SET tgt.c1 = vw.c1 /
I still don't see why you would need a pl/sql program that retrieves all rows from the database in memory program and then writes all back in the database.
-
El Capitan, updated in version 10.11.5 May 25, 2016, now the calendar in the dock is not updated to the current date, everyone had it?, how he was healed?
See you soon
Bill Edge
What happens when you inspect system preferences > Date & time?
- The correct time and Date displayed here?
- Your time zone is correctly indicated?
-
Difficulty with the update of the date of the child from birth.
I followed the verification link provided in the email, but I keep getting this message when updating my son DOB without actually being able to enter the necessary information. "A credit card is necessary for anniversary update of the Ark of Noah". I have my card already registered information, to aError whny suggestions?
Hi, I had this problem on my ipad new girls. even after you contact apple and spend an hour with them on the phone they couldn't understand it. but then I found the solution. Get a credit card on file, not a debit card, Apple servers know the difference. Once I changed my info card for a real credit card, I was able to change the date of birth in a few seconds. later, I put my debit card on file and everything works as it should.
Good luck
-
Manual update of the data on the device?
I want to create an application that performs a manual update to data that is already stored on the BlackBerry smartphone using our initial request. We already have the option to auto update on the initial application, but now we need to provide the option of manual update also.
So far, I created the application to perform the manual update and's done it with success also, but when the user tries to access these data updated using the initial request, then he throws a class cast exception.
I am a beginner and have no idea where I'm stuck with this problem. I don't know if the description of my problem will be lucid, to everyone. Let me know if I need to provide some details about it.
Thank you
Ronny
I think it is best that you create another project of type library. This project contains your store. then just set it as a dependency for your original and your manual update application. So no need for source code for each project.
-
Update of the data in the Table using XMLTYPE DATA
I did insertions using XMLTYPE data but have never done it and update. Can someone give me some advice?
PROCEDURE ADD_LABORDER_CODES)
IN_ORDERCODESXML IN CLOB DEFAULT NULL,
Number of OUT OUT_AFFECTEDROWS
)
AS
X SYS. XMLTYPE;
BEGIN
X: = SYS. XMLTYPE. CREATEXML (IN_ORDERCODESXML);
INSERT INTO MAINT_LABORD_CODES)
INSERT INTO MAINT_LABORD_CODES)
LABORD_CODE_ID,
COMPENDIUM_ID,
ORDER_CODE,
ORDER_DESC,
ACTIVE,
TIMESTAMP,
MODIFIED_BY)
SELECT MLOCDS_SEQ. NEXTVAL,
EXTRACTVALUE (VALUE (MLOC), '/ ORDERCODE/COMPENDIUM_ID') AS COMPENDIUM_ID,
EXTRACTVALUE (VALUE (MLOC), '/ ORDERCODE/ORDER_CODE') AS ORDER_CODE,
EXTRACTVALUE (VALUE (MLOC), '/ ORDERCODE/ORDER_DESC') AS ORDER_DESC,.
EXTRACTVALUE (VALUE (MLOC), '/ ORDERCODE/LOINC_CODE') AS LOINC_CODE,
EXTRACTVALUE (VALUE (MLOC), '/ ORDERCODE/ACTIVE') AS ACTIVE.
EXTRACTVALUE (VALUE (MLOC), '/ ORDERCODE/TIMESTAMP') AS TIMESTAMP.
EXTRACTVALUE (VALUE (MLOC), '/ ORDERCODE/MODIFIED_BY') AS MODIFIED_BY
TABLE (XMLSEQUENCE (EXTRACT(X,'/ORDERCODES/ORDERCODE'))) NMCO;
OUT_AFFECTEDROWS: = NUMBER OF ROWS SQL %;
EXCEPTION
WHILE OTHERS THEN
dbms_output.put_line (SQLERRM);
RAISE_APPLICATION_ERROR (-20001, SQLERRM);
END;
Example of use of the FUSION-
If the line exists in the target table (based on the COMPENDIUM_ID and ORDER_CODE values), the UPDATE is, if not to INSERT:
declare in_ordercodesxml clob := '
500 696231 ABO Group & Rh Type NULL 12345 Y 2014-08-13 1 Also note that I used XMLTABLE instead of TABLE/XMLSEQUENCE, which is much easier to use (and not deprecated in the latest versions).
You have not precisely the date format in the TIMESTAMP element so I assumed a conform to W3C.
If you have a problem with this part, return to a projection of VARCHAR2 and use TO_DATE with actual size.
-
Update of the data block on the table
Hello
I have a table that already exists with the data. I got another set of spreadsheet data to update the date on the table. The table name is EMPLOYEE.
The table structure is like this
> > EMP_ID, FIRST_NAME, LAST_NAME, ADDRESS, PHONE_NUMBER
Most of the files is not in the data table ADDRESS or PHONE_NUMBER, worksheet contains the updated information that needs to be updated on the EMPLOYEE table.
Please suggest me a method to update the data.
I intend to create a temporary table upload the data in the table. and then update the data using tables. Is this right approach please suggest
Thank you
SudhirThis means that your UNIQUE_ID is truly UNIQUE...
-
Restrict the update of the data in the report as a table...
Hello
I have a tabular report in Oracle APEX 4.0 based on a db table in which some columns (Textarea element and text element) after inserted must be restricted (view only). Could someone help me how this can be achieved. While trying to create a tabular report if I give as view only; the user is unable to grasp the data itself. All entries will be very appreciated.
Thank you
AhmedI suggest that you do with APEX_ITEMS: http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_item.htm
You will have to work with collections to pull this off. Load all your data into a collection of apex: http://docs.oracle.com/cd/E17556_01/doc/apirefs.40/e15519/apex_collection.htm
Now, you can create a simple select statement
select decode(c001, null, apex_item.text(1, c002), c002) from apex_collections where collection_name = your_collection;
C001 corresponding to the primary key that is inside your table and c002 the value you want to insert.
You must update c001 with the primary key from the moment that the row will be exist. Then just decode function will display it so it is no longer editable.
Add lines to the collection will add new lines to your tabular form. Clear lines of the collection deletes the lines in the tabular presentation.
If you are a beginner with this I suggest that you submit to the page whenever you click an insert/update/delete button.
Concerning
Nico
-
Create id, id of the update with the date for each record
Hello
Please give me brief idea or document for this concept:
I need to create id, date, update id, updated for each record inserted or updated in the database (multiple tables).
(1) how the user id can be obtained?
(2) is it better if I use views instead of tables for this?
(3) is it possible for each record?
Please show me the full scenario. a piece of code can also be useful.
Thanks in advance.http://psoug.org/reference/table_trigger.html
Concerning
Biju -
Cannot find record during the update on the date of
TABLE CRAM_STG:
Update:ID VARCHAR2(25 BYTE) ITEM_NO VARCHAR2(6 BYTE) NOMEN VARCHAR2(28 BYTE) CHGNBR VARCHAR2(3 BYTE) UI VARCHAR2(5 BYTE) SUPPLYACTIONCODE VARCHAR2(2 BYTE) QTY VARCHAR2(5 BYTE) ACCT VARCHAR2(5 BYTE) SUBACCT VARCHAR2(1 BYTE) REQUISITIONTYPE VARCHAR2(1 BYTE) REQUISITIONDATE DATE RECEIPTDATE DATE PROCESSDATE DATE ESTIMATEDSHIPDATE VARCHAR2(10 BYTE) ZIPCODE VARCHAR2(5 BYTE) CENTERCODE VARCHAR2(1 BYTE) ORDRNBR VARCHAR2(14 BYTE)
v_order_date: = to_date (CRAM_UPD_REC. ORDER_DATE, "MM/DD/YY").
During a select statement without the dateUPDATE CRAM_STG SET CRAM_STG.ORDRNBR = CRAM_UPD_REC.ORDER_NBR, CRAM_STG.ESTIMATEDSHIPDATE = CRAM_UPD_REC.SHIP_DATE WHERE CRAM_STG.acct = CRAM_UPD_REC.ACCT and CRAM_STG.subacct = CRAM_UPD_REC.SUBACCOUNT and CRAM_STG.item_no = CRAM_UPD_REC.ITEM_NO and CRAM_STG.qty = CRAM_UPD_REC.ORDER_QTY and CRAM_STG.requisitiondate = v_order_date ;
But my problem is when you use the date which is varchar type convert to date, it does not find the file.select REQUISITIONDATE from cram_stg where acct = '39249' and ((subacct = ' ' ) OR subacct is null) and item_no = '131249' and qty = to_number('00001','99999'); OUTPUT: REQUISITIONDATE ------------------------- 04-OCT-11
select REQUISITIONDATE from cram_stg where acct = '39249' and ((subacct = ' ' ) OR subacct is null) and item_no = '131249' and qty = to_number('00001','99999') and requisitiondate = to_date('10/04/11', 'MM/DD/YY'); REQUISITIONDATE -------------------------
mlojan wrote:
ALTER session set nls_date_format = 'dd-mon-yyyy hh24:mi:ss ";
change the session succeeded.REQUISITIONDATE
-------------------------
October 4, 2011 01:30:21Then he can easily explain why it cannot be equal to your function to_date (...) that does not include a default time (h: min: sec = 00:00:00).
So, you can try trunc (requisitiondate) = to_date (...) instead.
TRUNC is suppose to give up the time portion of the date up to 00:00:00.Nicolas.
-
How to force you to update to the date entry before you validate a text field?
I have this code:
Custom blur for txtWeekEndingDate script
(function () {}
var weekEnding = new Date (event.value);
day of week var = new Array (7);
day of week [0] = 'Sunday ';
day of week [1] = "Monday";
day of week [2] = "Tuesday";
day of week [3] = "Wednesday";
day of week [4] = "Thursday";
day of week [5] = "Friday";
day of week [6] = "Saturday";
var dayOfWeek = weekday [weekEnding.getDay ()];
var strWeekEnding = weekEnding.toLocaleDateString ();
Do nothing if the field is empty
If (! event.target.value) return;
If the value is not a valid email address...
If (dayOfWeek! = 'Sunday') {}
.. .that the user knows that the value is not a valid end date of week...
App.Alert ({CMSG: "you entered, '" + strWeekEnding + "". ""}) Please enter a date on Sunday. ', nIcon:3, nType:0, cTitle:this.documentFileName});
.. .and set the focus on this field
event.target.setFocus ();
} / / endif dayOfWeek! = "Sunday".
})();
The problem is that if the user enters something like "1/1" in the input box (which has a date format defined in the properties of the text box in the "mm/dd/yyyy') it sets the variable weekEnding to"undefined ". Without the validation script, it properly changes the date "01/01/2013", but it seems that this change occurs after the execution of script OnBlur. How can I force the update occur before the script is run?
When an entry of "1/1" gets converted to "01/01/2013", it is only for what is displayed in the field. " The value of the underlying field remains on "1/1". The point is the value of the field does not change, just what is displayed in the field. This means that there is no direct method to get the text that is displayed.
You can add a custom script to Validate that changes a value entry of "1/1" to "01/01/2013".» Then, you would get just the value of the field to recover. If you want more help with this approach, after once again.
-
Refresh/update of the data in a materialized view
Hello
I have question about data in a materialized view, and how it is updated. I think Matt has all my dimension-ID and my (for my specialize needs) aggregated measures of my fact table. I used mat View Wizard to create my opinion - which works perfectly. But now I wonder if I should create some sort of mapping (?) or some kind of trigger to refresh the data in the view of mast. Or are updated automatically when I start my fact table mappings. I use OWB 11 GR 2
THXMVs have properties for update - you a discount based on schedules or when dependent data are committed or manually.
See you soon
David -
With regard to the UPDATING of the data in the warehouse of data using various incremental DAC
My client is planning to spend some discoverer to OLIVIER but before need us answers.
(1) my client requires data to be updated hourly (load using the CAD) because they use a lot of data in real-time.
We do not have many data update (for example 10 bills in one hour + others). How long it usually takes to refresh these tables in data using the CAD wareshouse?
(2) while the table is can getting updated we use this table to generate a report? If so, what is the State of the data? Stale or incorrect (undefined)?
(3) how does updating of analytical work? It is a module at a time or it treats all 3 modules (GL, AR and AP) as a single unit of refreshment?
I would appreciate if I can get an answer to all questions.
Thank youSo much for the answers:
(1) should not be too much trouble for a such small amt of data. Depends on your implementation plan to the DAC that can always be created as new and can be customized to load the data for these tables... (Star Schema) - about 15-20 minutes, because it does so many things outside the loading table.(2) report to OBIEE will give the previous data because I believe that Cache will be (Shud be) turned on. You will get the new data in the reports after the update is complete and cache is erased using different methods (the favorite voting event)
(3) once again to end analytics or any other module, you'll OOTB plans. But you can create your new plans and run. GL, AR, AP are also provided separately...
Hope that answers your question... You will learn more about running through Oracle docs... especially for DAC
-
Update of the data in the table using LAG/LEAD
Hello!
I have a table that looks like:
CREATE TABLE CUSTOMER_INFO_TEST
(
ACCOUNT_NUM VARCHAR2 (40 BYTE),
PHONE VARCHAR2 (100 BYTE),
E-MAIL VARCHAR2 (300 BYTE),
DATE OF START_DT,
DATE OF CHANGE_DT,
END_DT DATE
);
The example data:
INSERT INTO CUSTOMER_INFO_TEST VALUES ('BOB', 555-1234', ", TO_DATE ('2011-01-01', 'YYYY-MM-DD'), TO_DATE ('2011-01-06', 'YYYY-MM-DD'), TO_DATE ('2011-01-10', 'YYYY-MM-DD'));
INSERT INTO CUSTOMER_INFO_TEST VALUES ('BOB', 555-1234', ' BOB@GMAIL.) COM', TO_DATE ('2011-01-01', 'YYYY-MM-DD'), TO_DATE ('2011-01-11', 'YYYY-MM-DD'), NULL);
INSERT INTO CUSTOMER_INFO_TEST VALUES ('BOB', 555-1234', ' BOB@GMAIL.) COM', TO_DATE ('2011-01-01', 'YYYY-MM-DD'), TO_DATE ('2011-01-15', 'YYYY-MM-DD'), NULL);
INSERT INTO CUSTOMER_INFO_TEST VALUES ('JACK', 555-4321', ", TO_DATE ('01-03-2011', 'YYYY-MM-DD'), TO_DATE ('2011-03-06', 'DD-MM-YYYY'), NULL);
INSERT INTO CUSTOMER_INFO_TEST VALUES ('JACK', 555-4321', ' JACK@GMAIL.) COM', TO_DATE ('01-03-2011', 'YYYY-MM-DD'), TO_DATE ('2011-03-11', 'YYYY-MM-DD'), NULL);
My question:
How can I configure end_dt (if null), to the next change_dt minus one
It shows what I want to do:
Select the rowid, account_num, phone, e-mail, start_dt, change_dt, end_dt, nvl (end_dt, lead (change_dt-1, 1) over (partition by account_num of start_dt order)) enddt CUSTOMER_INFO_TEST where end_dt is null;
So, I want to update the table itself with the date in enddt. But how do I do this?
This must be done in a single statement...
Thanks in advance
Richard
Published by: user6702107 on 05-Jan-2011 09:11
Edited by: Rydman on April 17, 2012 15:01Please post sample data!
If your query returns the desired results, you can use the MERGE:SQL> select * 2 from customer_info_test; ACCOUNT_NU PHONE EMAIL START_DT CHANGE_D END_DT ---------- ---------- ------------------------- -------- -------- -------- BOB 555-1234 01-01-11 06-01-11 10-01-11 BOB 555-1234 [email protected] 01-01-11 11-01-11 BOB 555-1234 [email protected] 01-01-11 15-01-11 JACK 555-4321 01-03-11 06-03-11 JACK 555-4321 [email protected] 01-03-11 11-03-11 5 rows selected. SQL> -- SQL> merge into customer_info_test a 2 using ( select rowid rid 3 , nvl(end_dt, lead(change_dt-1, 1) over (partition by account_num order by start_dt)) new_end_dt 4 from customer_info_test 5 where end_dt is null 6 ) b 7 on (a.rowid = b.rid ) 8 when matched then update set a.end_dt = b.new_end_dt; 4 rows merged. SQL> -- SQL> select * 2 from customer_info_test; ACCOUNT_NU PHONE EMAIL START_DT CHANGE_D END_DT ---------- ---------- ------------------------- -------- -------- -------- BOB 555-1234 01-01-11 06-01-11 10-01-11 BOB 555-1234 [email protected] 01-01-11 11-01-11 14-01-11 BOB 555-1234 [email protected] 01-01-11 15-01-11 JACK 555-4321 01-03-11 06-03-11 10-03-11 JACK 555-4321 [email protected] 01-03-11 11-03-11 5 rows selected.
-
I WANT THE RESULT OF MY FORM PAGE TO INSERT A FORM OF UPDATE OF THE DATA INSERTED JUST
I WANT THE RESULT OF MY FORM PAGE TO INSERT A FORM OF UPDATE OF THE MEASURE WITH THE HELP OF JUST INSERTED DATA. PLS HELP FOR EXAMPLE. Thank you
It doesn´t works because the to-be-set record´s to update primary key cannot be determined by using a static value:
$upd_capital-> setPrimaryKey ("cap_id", "NUMERIC_TYPE", "VALUE", "new_id"); current code in page 2
Basic now needs to ensure that the primary key matches the Session Variable "new_id' thus:
See you soon,.
Günter
Maybe you are looking for
-
localStorage and webappsstore.sqlite
My understanding is localstorage is kept in the webappsstore.sqlite file and which is persistent even after the closure of firefox. Not the case with me. I use "FireStorage more!" of FireBug (FSP)! and also Javascript to create random values in local
-
Update OS 9.2.1 to 10.8 +?
First of all, I'm a Windows person... I'm sorry. The only thing I know about eyePads is how to spell eyePad! I tried to read some of the other threads, but there are too many unknowns to get a clear picture of what I need to do. In any case... A
-
How to install kaspersky pure on W100?
Hello can someone explain to me how can I install kaspersky pure in toshiba w100 because I have problem withvirtual keyboard not compare and so I can not insert a code of activity within the specialty.I can only if I install an external keyboard conn
-
Control reference 1055 error when you use a loop for
Hello I'm having a problem using control references to accomplish the following: I a VI that reads data from a text file, and then uses that automatically update the value of a control on front panel on two live different, then set the default values
-
I bought a super audio CD, in effect of Deep Purple's Machine head. The disc has two parts. First part is stereo PCM DSD &, including seven originals of 1972. Second part is called multi-channel DSD, which contains ten tracks. The problem is that onl