Italian Library SqlSimple for novice users

androidappl

Active Member
Licensed User
Longtime User
This library is responsible for your life easier by using sql database, and then who knows nothing about it to have a minimal use ...
It does not do anything that might make an experienced user with using sql but allows you to do many things, the methods below:

  • 'Initialize the db , name your db
    Initialize(Db_name As String )
  • 'Create the table with the corresponding column names if you do not want to spend all of the data 'set if the string "",is added n with a number if that column is not present, field5 and filed6 are the 'INT number then.
    CreateTABLE (NameTable As String,field1 As String , field2 As String, field3 As String, field4 As String, field5 As String,field6 As String)
  • 'Delete Name_Table
    DeleteTABLE(NameTable As String)
  • 'Insert the fields in the db respecting the column names, provided also empty fields or zero will be 'called but will not be considered.
    insertFieldTABLE(field1 As String , field2 As String, field3 As String, field4 As String, field5 As Int,field6 As Int)
  • 'View all of the table
    viewAllTABLE
  • 'Displays the whole table ordered by the field (column name that you will pass the) in ascending 'order ASC
    viewAllTABLE_OrderASC(field1 As String)
  • 'Displays the whole table ordered by the field (column name that you will pass the) in descending order DESC
    viewAllTABLE_OrderDESC(field1 As String)
  • 'Upgrades some table fields (field1 is the field "column_name" to be modified if the condition '(major, minor, equal in symbols) compared field2 which can be another field, a string or a 'number, etc .. NewValue is the new value to assign true if the condition above.
    update_FieldTABLE(NameTable As String,field1 As String, Condition As String, field2 As String, NewValue As String)
  • 'Allows you to delete some data from the table than a condition see other uses of the 'conditions in the other methods.
    Delete_ConditionTABLE(NameTable As String,field1 As String, Condition As String, field2 As String )
The only variable that will contain the query results as if you are viewing is this:

  • 'you will see result query
    RESULT
Below the library and an example of use
 

Attachments

  • Lib_Sql_example.zip
    17.8 KB · Views: 199
  • Lib_Sql_.zip
    4.7 KB · Views: 187

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Wow fico! Stasera la provo!
 

LucaMs

Expert
Licensed User
Longtime User
Non ho scaricato (e non è detto che a me funzionerebbe, dato che ho una versione vecchiotta di b4a).

Potrei suggerire:

CreateTable accetta un numero fisso di parametri (nome tabella + 6 nomi di campi) ma ovviamente le tabelle create non avranno sempre 6 campi.
Poi non so quali tipi di campi il comando creerà.
Se vedi DBUtils, il comando analogo accetta un numero variabile di nomi di campi e relativi tipi.

Stessa cosa per Insert.

Beh, ci sarebbero altre cose. Dai un'occhiata a DBUtils.

Grazie per aver pubblicato il tuo lavoro.
 

androidappl

Active Member
Licensed User
Longtime User
Non ho scaricato (e non è detto che a me funzionerebbe, dato che ho una versione vecchiotta di b4a).

Potrei suggerire:

CreateTable accetta un numero fisso di parametri (nome tabella + 6 nomi di campi) ma ovviamente le tabelle create non avranno sempre 6 campi.
Poi non so quali tipi di campi il comando creerà.
Se vedi DBUtils, il comando analogo accetta un numero variabile di nomi di campi e relativi tipi.

Stessa cosa per Insert.

Beh, ci sarebbero altre cose. Dai un'occhiata a DBUtils.

Grazie per aver pubblicato il tuo lavoro.


Si si questo è un limite di questa libreria, ma per chi non conosce sql le query e quant'altro potrebbe essere utile. Cmq se tu metti soltanto 3 campi per esempio gli altri tre sono vuoti e non valorizzati..
 

giannimaione

Well-Known Member
Licensed User
Longtime User
permettete un pensiero:
imparate la sintassi SQL ; vi tornerà utile in tante altre occasione/linguaggi !
 
Top