SQLite and OS7

Hi @ll,

I have a big problem with Performance of SQLite:

the following SQL code

SELECT KKL_KundenNr, KKL_ArtNrIntern, Artikelstamm.Artikelstamm_ArtNrExtern AS KKL_ArtNrExtern, Artikelstamm.Artikelstamm_AGX AS KKL_AGX, KKL_ID, KKL_BA, CASE WHEN KKL_ArtBez is set to NULL OR LENGTH (KKL_ArtBez) = 0 THEN (SELECT Artikelstamm_ArtBez FROM Artikelstamm WHERE Artikelstamm_ArtNrIntern = KKL_ArtNrIntern) KKL_ArtBez of OTHER END as KKL_ArtBez, KKL_PS, KKL_Verkaufspreis, KKL_RabattProz, KKL_TeuerungszuschlagProz, KKL_LetzteMenge, KKL_PAK , KKL_DLV, KKL_MengeGesamt, KKL_PosGesamt, KKL_WertGesamt, KKL_unterLimitPreis, Artikelstamm.Artikelstamm_ID AS KKL_ARTIKELSTAMM_ID, KKL_LastModified OF THE JNF JOIN Artikelstamm ON KKL_ArtNrIntern = Artikelstamm_ArtNrIntern WHERE KKL_KundenNr = 999999

Returns a dynaset from 1100 records. Moving through the dynaset with a cursor runs in OS6 0-2 msec. by type of record. In OS7 the same operation runs round about 600 ms! (I used the Simultors). If I run the application on a real device, I have to pull the battery after ~ 5 hours!

Any idea or experiences with this?

THX.

Ok... I solved it by changing the tables FROM / JOIN:

OLD:

... JNF JOIN Artikelstamm ON KKL_ArtNrIntern = Artikelstamm_ArtNrIntern...

New:

... JNF JOIN Artikelstamm ON Artikelstamm_ArtNrIntern = KKL_ArtNrIntern...

Table Artikelstamm has fewer records then table KKL. I wonder, why this is not necessary in the OS6!

Tags: BlackBerry Developers

Similar Questions

  • SQLite and Images

    Hello world

    I have a problem with Sqlite and the BLOB data type, and Google was not helpful, because I guess that there is no just enough examples yet...

    What I do is the following: I use sqlite to store Images as blobs, as seen here. The table has only two columns, url TEXT and BLOB value

                 connection.begin();
    
                  sql = "INSERT INTO blobs (url, value) VALUES (@a, @b)";               sqlStatement.text = sql;
    
                  for (var i:int = 0, n:int = images.length; i < n; i++)             {                 sqlStatement.parameters["@a"] = images[i].url;                    sqlStatement.parameters["@b"] = images[i].data;                   sqlStatement.execute();                   sqlStatement.clearParameters();               }
    
                  connection.commit();
    

    whereas the images [i] .url are strings, data BitmapData.

    Now the question is: How can I get the image of the BitmapData again? What I'm trying to do is the following

    public function getBlob(url:String = null):Object
            {
                var dp:DataProvider = new DataProvider;
                try {
                    connection.begin(); 
    
                    var sql:String;
    
                    if (url)
                    {
                    sql = "SELECT value FROM blobs WHERE url = @a";
                    sqlStatement.text = sql;
                    sqlStatement.parameters["@a"] = url;
                    }
                    else
                    {
                        sql = "SELECT * FROM blobs";
                        sqlStatement.text = sql;
                    }
                    sqlStatement.execute();
                    sqlStatement.clearParameters();
    
                    var result:SQLResult = sqlStatement.getResult();
                    for each (var obj:Object in result.data){
                        if (obj != null)
                            dp.addItem(obj);
                    }
    
                    connection.commit();
    
                } catch (e:SQLError) {
                    alert.title = "Database Error (" + e.errorID + ")";
                    alert.message = "Error: " + e.message + "\n" + e.details;
                    alert.modalAlpha = 0.1;
                    alert.dialogSize = DialogSize.SIZE_SMALL;
                    alert.addButton("OK");
                    alert.show(IowWindow.getAirWindow().group);
                    connection.rollback();
                    return null;
                }   
    
                return dp;
            }
    

    and

    var dp:DataProvider = getBlob(_newUrl) as DataProvider;
    trace(dp.data[0].value is BitmapData);
    

    but which always returns false: All that it is said that dp.data [0] .value is an object which I can't access

    Any tips?

    This seems to work, using built bitmapData as byteArray, getPixels, setPixels.

    Thank you

    MIke

    package
    {
        import flash.data.SQLConnection;
        import flash.data.SQLResult;
        import flash.data.SQLStatement;
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.Sprite;
        import flash.errors.SQLError;
        import flash.filesystem.File;
        import flash.geom.Rectangle;
        import flash.utils.ByteArray;
    
        [SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]
    
        public class SQLBitmapBlob extends Sprite
        {
            private var sqlDatabase:File;
            private var sqlConnection:SQLConnection;
            private var sqlStatement:SQLStatement;
            private var sqlResult:SQLResult;
    
            private static const BITMAP_WIDTH:int = 96;
            private static const BITMAP_HEIGHT:int = 96;
    
            public function SQLBitmapBlob()
            {
                super();
    
                // Init Database
                sqlDatabase = File.applicationStorageDirectory.resolvePath("dbBlob2.db");
                sqlConnection = new SQLConnection();
                sqlConnection.open(sqlDatabase);
                sqlStatement = new SQLStatement();
                sqlStatement.sqlConnection = sqlConnection;
    
                // Create the table if it doesn't exist
                sqlStatement.text = "CREATE TABLE IF NOT EXISTS blob (id INTEGER PRIMARY KEY AUTOINCREMENT, picture BLOB)";
                try{sqlStatement.execute();}
                catch (error:SQLError){trace("SQL STATEMENT: " + sqlStatement.text + "\n Error: " + error.details);}
    
                // Create a random bitmapData
                var bmpData:BitmapData = new BitmapData(BITMAP_WIDTH, BITMAP_HEIGHT, true, 0x000000);
                var bytArray:ByteArray = new ByteArray;
                bmpData.noise(25);
                bytArray.writeBytes(bmpData.getPixels(new Rectangle(0,0, BITMAP_WIDTH, BITMAP_HEIGHT)));
    
                // Save BitmapData to Database
                sqlStatement.text = "INSERT INTO blob (picture) VALUES (@picture)";
                sqlStatement.clearParameters();
                sqlStatement.parameters["@picture"] = bytArray;
                try {sqlStatement.execute();}
                catch (error:SQLError){trace("SQL STATEMENT: " + sqlStatement.text + "\n Error: " + error.details);}
    
                // Preform Select on Database to return row
                var loadedBitmapData:BitmapData = new BitmapData(BITMAP_WIDTH, BITMAP_HEIGHT, true, 0x000000);
                sqlStatement.text = "SELECT * FROM blob WHERE id = last_insert_rowid()";
                sqlStatement.clearParameters();
                try{sqlStatement.execute();}
                catch (error:SQLError){trace("SQL STATEMENT: " + sqlStatement.text + "\n Error: " + error.details);}
    
                // Convert returned data back to bitmapData
                var r:Object = new Object();
                sqlResult = sqlStatement.getResult();
                if (sqlResult.data != null){
                    r = sqlResult.data[0].picture;
                    loadedBitmapData.setPixels(new Rectangle(0,0, BITMAP_WIDTH, BITMAP_HEIGHT), r as ByteArray);
                    trace("Retrievied record id: " + sqlResult.data[0].id + " from db.");
                }
    
                var bmpDisplay:Bitmap = new Bitmap(loadedBitmapData);
                addChild(bmpDisplay);
            }
        }
    }
    
  • Extension of WebWorks for BB10 and OS7

    Hello

    I am interested to write an extension for some software that will be deployed to the device a BB10 and OS7. I was wondering if it was possible to package the native code for each platform in an extension, so I can then use it in a project without having to include two extensions. Ideally, I would like to include the extension in the project and leave the code intact webworks for each platform and let the compiler decide to use the BB10 or OS7 code from the file extension.

    Is it possible to do this?

    See you soon,.

    Rich

    BB10 is a wrapper called JNext JavaScript and C/C++

    PlayBook OS is a wrapper for an Adobe AIR for a DONKEY who can talk to the bit of C/C++ and C/C++

    OS7 and lower are fully Java

    either you write completely different extensions for each

    OS6/7 and BB10, was lost with PB

  • SQLite and Malwarebytes files

    Whenever I run Malwarebytes on my laptop Win 7 I get at least 69 elements referring to the sqlite files.

    I don't know whether to remove them or not. I don't have this problem on my Vista desktop.

    If I have, or I should NOT delete these files when Mo found after a scan. They claim it ADWARE.

    I just checked, and they are all cookies. I then checked the details I've ever done and it shows a bunch of advertisements like Double click, etc.

    I'll do as suggest you and close the browser before I remove them.

    I wonder why this only happens on the Windows 7 operating system and never on my desk.

    Thank you. I guess it's safe to delete.

  • Firefox 4. What is the difference between addons.sqlite and extensions.sqlite in the profile folder?

    I have separate facilities 3.6.15 Firefox and Firefox 4RC2, using their own separate and distinct profile folders.

    I already know that, in the profile folder:

    • Firefox 3.6.x has extensions.log, extensions.ini and extensions.rdf files
    • Firefox 4 has replaced extensions.rdf with extensions.sqlite
    • Firefox 4 has apparently no extensions.log
    • Firefox 3.6.x does not have addons.sqlite
    • Firefox 4 is has addons.sqlite

    For a better understanding of the present, can someone please clearly, answer the following 3 questions?

    What is

    1. the purpose of addons.sqlite in Firefox 4?
    2. How it / its function differ from the extensions.sqlite in Firefox 4
    3. both are really necessary?

    addons.SQLite stores the information that appears in the tab Addons > Extensions - under the button more , as well as the AMO URL for extensions that are not configuration to use this new feature.

    Extensions.SQLite stores the data on the installed extensions, by replacing the extensions.cache and extensions.rdf files.

    You really not need the addons.sqlite file, but I do not know the ramifications to delete the content of this file and 'locking' so that it is used. Not that it stores a large amount of data; only 320kb with 30 installed extensions.

  • Size limits for the parameter SQLITE and file saving for the playbook

    It is partly linked to another of my posts, but isn't quite a duplcate. Thanks for bearing with me.

    Is there a size limit when passing a string as a parameter to an INSERT of SQLITE order? I get the transaction do not return not whatever it is, the error / success / otherwise, when I pass a string as a massive paremeters (> 50 KB).

    The docs for SQLITE suggest that this should not be a problem.

    As an alternative, we can save files of text in memory of the playbook, and reference them in the database. This would allow us to work around the problem?

    As always, thanks for the help.

    The answer to the question was the .substring (0,1000000) to add at the end of my chain. This gave me the output of 1000000 of characters which is ample. I'm guessing that this better prepare the string and removed something improper.

    Has had a few tries but that's it.

  • SQLite and HTML

    Anyone has any sample code to show how to use a set of HTML construction using the manipulation of the DOM, as in, SQL result using innerHTML?

    Thank you

    Here is the example, I used it on my recent project

    kemasD.getCustomerById = function(id) {    var db = kemasD.webdb.db;
    
        db.transaction(function(tx){        tx.executeSql("SELECT * FROM CUSTOMER WHERE ID = ? ORDER BY ID",              [id],             function(tx, results) {                var buffer = "";
    
                    // results = SQLite result set                if (results.rows && results.rows.length) {                    for ( var i = 0; i < results.rows.length; i++) {                        var current = results.rows.item(i);
    
                            // This part where you want to process the result and wrap it with HTML tag                        buffer += '
    '; buffer += '

    Customer name: ' + current.NAME + '

    '; buffer += '

    Customer address: ' + current.ADDRESS + '

    '; buffer += '

    Customer phone: ' + current.PHONE + '

    '; buffer += '
    '; // Modify the DOM using jQuery (this is the easiest way, AFAIK) // This syntax will insert the 'buffer' inside the
    block // in your page $("div.customer-detail-box").prepend(buffer); buffer = ""; } } }, onErrorHandler); });};

    Hope that this example will help you :))

  • Location of the CRG App Sqlite and explore

    Hi all

    I use Jdeveloper 12.1.3 with PSM 2.1 to build an application that uses Oracle A-team persistence accelerator to implement offline functionality.

    I'm exploring the database of lite sql that is generated once the data is stored inside.

    I used the Android DDMS tool to explore the file system. Under/data/data / < app_package > / / files, I found a .db file < AppName >. I guess it comes to the sqlite database that is used.

    However, I can not open a browser of SQLite.

    I assumed it is because it is encrypted by the MAF.

    There are two issues here:

    1 - is the actual location where the sqlite database is stored? If this isn't the case, could you please provide me with the location?

    2. is it possible to explore the contents of the database in development mode? So, lets say, turn off encryption for her, while developing?

    Kind regards

    Bogdan Zegheanu

    Hello Bogdan,

    1. Yes, it's the actual location.

    2. Yes, this is caused by encryption, and you can disable the encryption by adding the following line to mobile-persistence - config.properties:

    DB. Encryption = false

    Steven Davelaar,

    Oracle Mobile A-team.

  • WebWorks, NFC and OS7.1 Java plug-in compatibility

    Hello

    I worked on building a WebWorks app that uses an extension of java to access certain NFC of OS7.0 functions.       OS 7.1 added functions that I would use it as well related to a number of NFC, but adding one of these new features gives me a CAP error when I try to package & sign in undulation.  I guess it's because the current SDK WebWorks support adding these new features of 7.1 as extensions again... what what happens?  Any idea on a time when WebWorks will be updated to support the new functions of 7.1 if this is the case?

    Thank you

    Drew

    I don't know when the final version of WebWorks support 7.1, but it's an easy thing to fix. You must change the net.rim.api.jar that refers to WebWorks which can be done in two ways.

    1. Replace the file real net.rim.api.jar found in the lib folder of your installation with the edition 7.1
    2. Edit the bbwp.properties file in your bin folder to point to the version 7.1 instead of the lib folder.

    Just for that you realize, that it is already an extension NFC community that supports MS tags here - https://github.com/blackberry/WebWorks-Community-APIs/tree/master/Smartphone/NFC . If you have knowledge, it would be great if you helped to complete since this way the API would support to 7.0 instead of 7.1 just.

  • How can I create a user account: username and password?

    I'm trying to transfer bookmarks Firefox from one machine to the other. I need an account to identify bookmarks I want, but as far as I know, I do not have an account of Firefox. So I try to create one on the old machine that I use to transfer bookmarks to the new machine.

    You can copy files in the profile folder of Firefox on a computer in the folder of the profile on another computer by copying the files on a removable USB (USB key).

    You can copy files like these in the Firefox profile folder to retrieve specific data.

    • bookmarks and history: places.sqlite
    • favorite backup: backups JSON in the bookmarkbackups folder
    • SQLite files cookies.sqlite (cookies) and formhistory.sqlite (saved form data)
    • logins. JSON and signons3.txt (decryption key) of the saved passwords in password manager
    • cert8. DB for stored intermediate certificates (Certificate Manager)
    • Persdict.dat for the words that you added to the spelling dictionary
    • Permissions.SQLite and, possibly, content - prefs.sqlite permissions and Site preferences
    • sessionstore.js to open and pinned tabs and tab groups

    You can retrieve more personal data.

    See also:

    For synchronization, see:

  • All IT gurus out there who know Firefox... have lost the passwords saved when FF created a new profile and delete old files key3.dbf and logins.json profile.

    All IT gurus out there who know Firefox... have lost the passwords saved when FF created a new profile and delete old files key3.dbf and logins.json profile. Any ideas, anyone?

    So it's not a logins.json file?

    I see a signons3.txt file and a file signons.sqlite older, if you can try to see if you can import passwords stored in this file.

    You can force Firefox to re-import the passwords in the file signons.sqlite and regenerate the file logins.json with the following steps:

    • reset the signon.importedFromSqlite pref on the topic: config page by default via the context menu
    • Delete the logins.json file in the closed Firefox with Firefox profile folder

    When you restart Firefox, then you should have the pref signon.importedFromSqlite with the value set to true.
    You have passwords that are imported in the password manager, unless there were errors or signons.sqlite signons3.txt.

    You can open the topic: config page via the address bar.
    You can accept the warning and click on "I'll be careful" to continue.

    You can use this button to go to the current Firefox profile folder:

  • I used my old firefox data and now he has bugged.

    My problem started after I deleted my profile. Not knowing what I was doing, I deleted my profile and restarted Firefox. I have had no Favorites, my theme had disappeared, etc.. After awhile, I realized how to use my old data from Firefox to retrieve my old profile. When I did this, I think I could go back to an older version of Firefox, but it says that everything is up-to-date. The problem is that when I go to some sites, it is said there is a buggy script (or loads very slow) and I have to stop the script while it is running. Another thing is that when I go to some Web sites (it varies on how many times it happens), it says that I have to update my Media Player. So I got the link and it automatically stops a .exe. I have a mac and that you can not use an exe file (don't tell me to use bootcamp, I don't have a big enough flash drive). When I just go on the web, it's the same thing. If it must operate only with Microsoft, so how do I stop the banner to appear?

    Thanks for the help and if you could not, thanks for trying.

    Maybe create a new profile and be more careful to recover data from an old profile.

    You can use a JSON backup in the bookmarkbackups folder to restore the bookmarks.

    You can transfer these files into the old data of Firefox on the desktop folder to retrieve specific data from your previous profile.

    • bookmarks/history: backups in the bookmarkbackups folder and perhaps places.sqlite, if you really need the history
    • other SQLite files cookies.sqlite (cookies) and formhistory.sqlite (saved form data)
    • logins. JSON and key3db for passwords in password manager
    • Permissions.SQLite and, possibly, content - prefs.sqlite for permissions and preferences of Site
    • cert8.DB stored intermediate certificates
    • sessionstore.js to open and pinned tabs and tab groups
  • How can I fix my toolbar? I type a website, but it does not when I hit enter or the arrow. I checked my Add ons and extensions already

    the toolbar at the top will not work. I checked Add ons extensions and I restarted. It still does not work. I tried safe mode and it didn't work either

    Maybe it's this: due to a change in the way that Firefox 39 associate keywords with bookmarks and/or history, the address bar is newly sensitive to corruption in the database that stores your history and bookmarks (the places.sqlite file).

    The developers are working on a solution, but that could take weeks to reach you.

    At this point, the best solution is to delete/rename the places.sqlite file, but then you lose all your history, if this really isn't very attractive to people who rely on history to revisit the sites.

    In case you want to try this - in case you do not receive the best suggestions - here's how:

    Open the settings folder (AKA Firefox profile) current Firefox help

    • button "3-bar" menu > "?" button > troubleshooting information
    • (menu bar) Help > troubleshooting information

    In the first table of the page, click on the view file"" button. This should launch a new window that lists the various files and folders in Windows Explorer.

    Leave this window open, switch back to Firefox and output, either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Pause while Firefox finishing its cleanup, then rename places.sqlite to something like oldplaces.sqlite. (I'm not suggesting delete this file, just in case you find yourself in need again).

    Firefox creates temporary files related to places.sqlite and those should be renamed / remove as well. Check places.sqlite - shm and places.sqlite - wal and if you find them, rename them as well.

    When you start Firefox back up again, he should start a new database places.sqlite and import your last backup automatic bookmark. Can you confirm that all your bookmarks are present? The address bar works normally again?

  • where the fav icons are stored in the Firefox profile? You can drag and drop on the bookmarks?

    Two related issues to fav icons:

    1 where are the fav icon stored in my Firefox profile?

    2 is it not warned to drag an icon on an element of bookmark on my bookmarks (no icon) bar and it updated the icon? (I have a right-click on the bookmark and I couldn't see any field of fav icon.)

    Thank you

    Favicons are stored in the file places.sqlite and bookmarks.

    No, you cannot drag a Favicon in your bookmarks. If you drag a tab favorite icon, all that would happen is that you would be again to add the bookmark and the favicon may not be kept if it was not the first time that you have saved the first time. Try it and see what happens...

    There is no field for Favicon in the context menu of bookmark. There used to be a couple of extensions available at different times which allowed users to add a favicon to a bookmark, but it's been a while that we have seen this type of extension that was compatible.
    https://addons.Mozilla.org/en-us/Firefox/addon/Favicon-Picker-3/
    https://addons.Mozilla.org/en-us/Firefox/addon/Favicon-Picker-2/
    Neither have been updated after a Firefox update beat each at different times, and nobody has updated '3' a final which broke.

  • After changing a Firefox latest, my favorites have disappeared, and just "restore from backup" gives "not able to process the backup file".

    I tried the tool maintenance for places.sqlite and even delete the file so firefox it rebuilt. But no joy. New version is 36.0.1. Don't you remember an old man, but he was old enough. Five available json files, but none works

    I found my own answer.

    I copied the file favorite .json on a USB key. Led to another PC that still had an old Firefox and successfully it read. The exported as HTML and postponed retrospectively & imported.

    If someone else this problem is not lucky enough to have another PC with old Firefox, I'm willing to bet that you could just install Chrome rather & he'd willingly read.

Maybe you are looking for