[
https://issues.apache.org/jira/browse/CB-12822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16015797#comment-16015797
]
David Saillard commented on CB-12822:
-------------------------------------
Find here an simple source code
I use Jquerymobile 1.4.5 et jquery for develop mobile Webapp
var db;
var deviceReadyDeferred = $.Deferred();
var useConsoleLog = true;
$(document).ready(function() {
document.addEventListener("deviceready", function() {
deviceReadyDeferred.resolve();
}, false);
});
$.when(deviceReadyDeferred ).then(function () {
var dbshortName = 'NegosApp';
var dbversion = '1.0';
var dbdisplayName = 'Base Negos App';
var dbmaxSize = 50000000; // in bytes
try {
if (!window.openDatabase) {
alert('windows open Database non supported');
} else {
db = window.openDatabase(dbshortName, dbversion,
dbdisplayName, dbmaxSize);
}
} catch(e) {
// Error handling code goes here.
if (e == 2) {
alert("Invalid database version.");
}
else
if (e == 4) {
alert("Limite de Stockage dépassée "+e+".");
}
else {
alert("Erreur inconnue "+e+".");
}
}
createLocalTables();
});
//Création des tables locales
function createLocalTables() {
db.transaction(function(tx) {
//parametre
tx.executeSql("CREATE TABLE IF NOT EXISTS parametre(
CODE_SOCIETE VARCHAR(4), ETABLISSEMENT VARCHAR(4), SITE VARCHAR(4), NOM_SOCIETE
VARCHAR(30), CODE_VRP VARCHAR(4), NUMERO_TEL_TRANSMISSION VARCHAR(30),
POSSIBLE_PRIX_SAISIE VARCHAR(1), POSSIBLE_CHANGE_CODE_TARIF VARCHAR(1),
POSSIBLE_PRIX_GRATUIT VARCHAR(1), POSSIBLE_SAISIE_UNITE VARCHAR(1), TARIF_UNITE
VARCHAR(1), QTE_UNITE VARCHAR(1), NUMERO_VEHICULE VARCHAR(20),
NIVEAU_STAT_EQUIPE VARCHAR(3), NIVEAU_STAT_REGION VARCHAR(3),
NIVEAU_STAT_NATIONALE VARCHAR(3), CALCUL_MARGE VARCHAR(1), PALLIER_MARGE
VARCHAR(5), COEFF_MODIF_MARGE VARCHAR(5), POSSIBLE_REMISE_ENTETE VARCHAR(1),
POSSIBLE_REMISE_LIGNE VARCHAR(1), TYPE_CODE_CLIENT VARCHAR(1),
TYPE_CODE_ARTICLE VARCHAR(1), LONG_CODE_CLIENT VARCHAR(2), LONG_CODE_ARTICLE
VARCHAR(2), MAXI_QTE_ALERTE VARCHAR(5), MINI_COMMANDE VARCHAR(5), LIBRE1
VARCHAR(10), LIBRE2 VARCHAR(10), LIBRE3 VARCHAR(10))", [], function(tx,
result) {if ( useConsoleLog ) console.log(result);}, function(tx, error) {if (
useConsoleLog ) console.log(error);});
//Référencement
tx.executeSql("CREATE VIRTUAL TABLE IF NOT EXISTS referencement
USING fts3 ( soc_code, Class_Subclass, Enseigne, Typo, Code_interne,
Designation , Code_en_magasin, INDEX_PAGINATION)", [], function(tx, result) {if
( useConsoleLog ) console.log(result);}, function(tx, error) {if (
useConsoleLog ) console.log(error.message);});
});
}
> Bug when create an virtual table with fts3 option in the Websql database on
> UiWebview
> --------------------------------------------------------------------------------------
>
> Key: CB-12822
> URL: https://issues.apache.org/jira/browse/CB-12822
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-ios, cordova-js
> Affects Versions: [email protected]
> Environment: UIWebview Websql database
> Reporter: David Saillard
> Priority: Blocker
> Labels: performance
>
> Hello,
> I develop software with cordova, since 6 years, and actually use the
> UiWebview with the Websql database because he WkWebview don't use this.
> When I execute an transaction for create a virtual table with the option
> fts3. The query return an error and the table is not create.
> When I dont' use the option fts3 for create an normal table, it's OK. I have
> success operation.
> This Problem doesn't exist on iOS 10.3.1 and before.
> Steps to Reproduce:
> CREATE VIRTUAL TABLE IF NOT EXISTS param USING fts3 ( soc_code VARCHAR(5),
> prm_table VARCHAR(50), prm_coderec VARCHAR(50), prm_lbl VARCHAR(70),
> prm_comment VARCHAR(200), prm_actif VARCHAR(1), prm_value VARCHAR(50),
> prm_order INTEGER, INDEX_PAGINATION INTEGER ) ";
> Version:
> iOS 10.3.2 beta5
> Notes:
> I can use in my application Virtual table previously create before upgrade on
> iOS 10.3.2 beta5. That mean that it's supported, only the creat doesn't run.
> Configuration:
> ipad air2 64go
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]