Jump to content

Recommended Posts

Posted

hi there

I have a question...

how do I get the content of a single column in sqlite ?

thanks in advance

torels_

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Posted

hi there

I have a question...

how do I get the content of a single column in sqlite ?

thanks in advance

torels_

Specify the name of the column in the query. For example, to get all columns of all rows, you would query "Select * From TableName". To get just the column PhoneNum you would replace "*" with the column name and query "Select PhoneNum From TableName".

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

Specify the name of the column in the query. For example, to get all columns of all rows, you would query "Select * From TableName". To get just the column PhoneNum you would replace "*" with the column name and query "Select PhoneNum From TableName".

:P

I got it! :P

I wrote this for the moment...

#include <sqlite.au3>
#include <sqlite.dll.au3>
Local $hQuery,$aRow
_SQLite_Startup()
_SQLite_Open(@ScriptDir & "\artists.db")
_SQLite_Exec(-1,"Create table Songs (Title not null, mp3Path not null, LyricPath not null);" & _
                "Insert into Songs values ('abb','C:\Foo.mp3','C:\foo.txt');" & _
                "Insert into Songs values ('slipknot - before I forget','C:\bif.mp3','C:\bif.txt');")
$d = _SQLite_Exec(-1, "Select Songs.Title From Songs;", "_result")
Func _result($aRow)
    For $s In $aRow
        ConsoleWrite($s & @TAB)
    Next
    ConsoleWrite(@LF)
EndFunc
_SQLite_Close()
_SQLite_Shutdown()

It's the beginning of a lyrics/karaoke program XD

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Posted

I got it! :P

I wrote this for the moment...

#include <sqlite.au3>
#include <sqlite.dll.au3>
Local $hQuery,$aRow
_SQLite_Startup()
_SQLite_Open(@ScriptDir & "\artists.db")
_SQLite_Exec(-1,"Create table Songs (Title not null, mp3Path not null, LyricPath not null);" & _
                "Insert into Songs values ('abb','C:\Foo.mp3','C:\foo.txt');" & _
                "Insert into Songs values ('slipknot - before I forget','C:\bif.mp3','C:\bif.txt');")
$d = _SQLite_Exec(-1, "Select Songs.Title From Songs;", "_result")
Func _result($aRow)
    For $s In $aRow
        ConsoleWrite($s & @TAB)
    Next
    ConsoleWrite(@LF)
EndFunc
_SQLite_Close()
_SQLite_Shutdown()

It's the beginning of a lyrics/karaoke program XD

You got it. :P

You don't have to specify the table with "Songs.Title"; that query will work the same as "Select Title From Songs". But it works either way.

:o

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

Ok thanks! :P

:P

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...