[Class] SQLiteDB - Update on 2022-10-04
Re: [Class] SQLiteDB - Update on 2016-03-28
Do you mean the .mode command of SQLite3.exe? AFAIK it's not available within the C\C++ API.
-
- Posts: 313
- Joined: 23 Jan 2015, 01:49
Re: [Class] SQLiteDB - Update on 2016-03-28
Do you know the other way to achieve this ?just me wrote:Do you mean the .mode command of SQLite3.exe? AFAIK it's not available within the C\C++ API.
Re: [Class] SQLiteDB - Update on 2016-03-28
If you don't want to use SQLite3.exe, you have to add the HTML by yourself.
-
- Posts: 313
- Joined: 23 Jan 2015, 01:49
Re: [Class] SQLiteDB - Update on 2016-03-28
Thanks for your time.just me wrote:If you don't want to use SQLite3.exe, you have to add the HTML by yourself.
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: [Class] SQLiteDB - Update on 2016-03-28
How would I go about storing a date in the database so later I can do queries from date A to date B
What data type do I use? How do I do this (obviously I can generate the current date using ahk formattime)
What data type do I use? How do I do this (obviously I can generate the current date using ahk formattime)
Re: [Class] SQLiteDB - Update on 2016-03-28
Hello, thank your for your class.
I'm still kind of new to SQLite. I have made a script that is compiling a bunch of non-sql data into a single database. My question is, how do I queue a bunch of INSERTS so that it will operate on MANY rows at once? After some extreme performance issues (talking 3hours or so for a fraction of the inserts required) I opted to create a bulkload text that sqlite3.exe reads into the db - but I know this is suboptimal, even if it performs all of the inserts in a few seconds.
I'm still kind of new to SQLite. I have made a script that is compiling a bunch of non-sql data into a single database. My question is, how do I queue a bunch of INSERTS so that it will operate on MANY rows at once? After some extreme performance issues (talking 3hours or so for a fraction of the inserts required) I opted to create a bulkload text that sqlite3.exe reads into the db - but I know this is suboptimal, even if it performs all of the inserts in a few seconds.
Re: [Class] SQLiteDB - Update on 2016-03-28
Hi,
you might want to use a transactionand to concatenate several SQL statements as shown in SQLiteDB_sample.ahk
you might want to use a transaction
Code: Select all
DB.Exec("BEGIN TRANSACTION;")
... insert statements
... insert statements
... insert statements
DB.Exec("COMMIT TRANSACTION;")
- Joe Glines
- Posts: 770
- Joined: 30 Sep 2013, 20:49
- Location: Dallas
- Contact:
Re: [Class] SQLiteDB - Update on 2016-03-28
We had a great webinar yesterday covering this topic. Jean Lalonde, author of Quick Access Popup, led us on an intro to using this class. Check out the videos & resources shared here.
Sign-up for the HK Newsletter
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Re: [Class] SQLiteDB
Thanks. I could never understand the other examples.Jeramy wrote: ↑27 Sep 2015, 06:46As an added bonus, here's another snippet that enables you to look up all the tables on a database, so you could apply needed changes across any/all tables across the DB in one shot
Code: Select all
#NoEnv #SingleInstance force SetWorkingDir, %A_ScriptDir% SetBatchLines, -1 #Include Class_SQLiteDB.ahk db := new SQLiteDB DBLoc = %A_Scriptdir%\SQLiteDB.sqlite ; Change to match the name of your database as needed db.OpenDB(DBLoc) TableLookup := "select name from sqlite_master where type='table';" ; This will produce a list of all tables in the Database db.GetTable(TableLookup, results) loop % Results.RowCount { I := a_index ; Set the row value for each row loop loop % Results.ColumnCount { msgbox % Results.Rows[I, a_index] ; show the name of each table in the database } } db.CloseDB()
Re: [Class] SQLiteDB
Have you transfer it to v2? I'm looking for it, thank you!!arcticir wrote: ↑20 Dec 2013, 04:00Thanks. I will transfer to V2.
I used to add two functions make it more easy to use:
Code: Select all
Class_SQLiteDB(){ Return New SQLiteDB } SQLite_(v){ Return InStr(v, "`'") ? StrReplace(v,"`'","`'`'") : v }
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: [Class] SQLiteDB - Update on 2016-03-28
How do I delete a specific row?
MyRow := "15"
I tried MyDB.Exec("Delete from Listings WHERE rowid = '" . MyRow . "';")
MyRow := "15"
I tried MyDB.Exec("Delete from Listings WHERE rowid = '" . MyRow . "';")
Re: [Class] SQLiteDB - Update on 2016-03-28
Looks good.
I'll try.
Long time ago, I have tested with "IsNull"'s code.
It was good, I remember.
regards
I'll try.
Long time ago, I have tested with "IsNull"'s code.
It was good, I remember.
regards
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: [Class] SQLiteDB - Update on 2016-03-28
@AHKStudent
I am a beginner too
I just got something.
Can you tell me what you did so far ?
I am a beginner too
I just got something.
Can you tell me what you did so far ?
Re: [Class] SQLiteDB - Update on 2016-03-28
Dear, expert(s)
Can you tell me how can I use column name ?
I can iterate table with two indexes, but I know columns name exactly.
I do not want to use numbers.
Can you tell me how can I use column name ?
I can iterate table with two indexes, but I know columns name exactly.
I do not want to use numbers.
Re: [Class] SQLiteDB - Update on 2016-03-28
Code: Select all
For Each, x In myTable.ColumnNames
myResults .= x "`n"
so, I'd like to know the value of the 5th and 7th cell. (source_segment column and target_segment column)id
guid
translation_memory_id
source_hash
source_segment
target_hash
target_segment
creation_date
creation_user
,,,
,,
,
I do not know how to do it.
I have limited my Rows just "1" (LIMIT command)
Last edited by IMEime on 07 Jan 2019, 10:22, edited 1 time in total.
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: [Class] SQLiteDB - Update on 2016-03-28
Code: Select all
Loop % myTable.RowCount ; This works fine but I want to make same result with "Name"
{
i := A_Index
Loop % myTable.ColumnCount
{
If (A_Index = 5 || A_Index = 7)
myResults1 .= myTable.Rows[i, A_Index] "`n`n"
}
}
For Each, x In myTable.ColumnNames
{
myResults2 .= x "`n"
; I want to do something proper
; myResults3 .=......
}
Re: [Class] SQLiteDB - Update on 2016-03-28
@AHKStudent
Do you want to delete 15th row ?
Do you want to delete 15th row ?
Last edited by IMEime on 07 Jan 2019, 10:23, edited 1 time in total.
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: Google [Bot] and 116 guests