[TIMOB-2394] Problems with SQLite and Textfield
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-01-03T11:48:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | luciano |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:18:34.000+0000 |
Updated | 2017-03-09T23:14:45.000+0000 |
Description
I'm having trouble saving data in the database created using a
textfield as follows:
cadvend.addEventListener('click', function(e)
{
var base = Titanium.Database.install('cardsdb.db','cards');
var db = Titanium.Database.open('cards');
db.execute('CREATE TABLE IF NOT EXISTS vendedor (idvendedor INTEGER PRIMARY KEY AUTOINCREMENT, nome VARCHAR(30) NOT NULL, cpf VARCHAR(30) NOT NULL UNIQUE, telefone VARCHAR(30) NOT NULL)');
db.execute('INSERT INTO vendedor (nome,cpf,telefone) VALUES ("'tf1.value'","'tf2.value'","'tf3.value'")');
// main
var q = db.execute( 'SELECT * FROM vendedor' );
if( q.rowCount == 0 ){
loadData();
}
else{
var dataTable = [];
var i = 0;
while( q.isValidRow() ){
dataTable[i] = Ti.UI.createTableViewRow({
title : q.fieldByName( 'nome' ) + ':' + q.fieldByName( 'cpf' ) + ':' + q.fieldByName( 'telefone' )
});
i++;
q.next();
}
q.close();
VendWindow.add( table );
table.setData( dataTable );
}
});
Please if anyone knows how to save using textfield help me
Propose this be closed for the following reasons: * test case not complete * user not using recommended query syntax (ie with string substitution): * it's an issue more suited to the Q&A
Closing ticket so that it can be rerouted to Q&A. Ticket can be reopened if there is a valid test case demonstrating a legitimate bug in platform.
Closing ticket as invalid.