AutoHotkey Community

It is currently May 26th, 2012, 10:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: January 6th, 2008, 9:36 pm 
Offline

Joined: November 28th, 2007, 10:00 pm
Posts: 25
Location: USA
do you think this could be used to edit the calendar on an iphone because it stores the calendar file with a .sqlite extension?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2008, 1:31 pm 
hi nick
i have a problem with the show of a result of a search
i have find thios code

Code:
$sSQL := "SELECT * FROM Test;"
$i := A_TickCount
$iRC := _SQLite_GetTable($SQLITE_h_DB, $sSQL, $sResult, $iRows, $iCols)
If ($iRC <> 0)
{
   MsgBox Fehler bei GETTABLE: %$iRC%
}

But no way to show it on a msgbox %$iRC% i can´t used becouse it must be 0

i hope you can understand me and find a way to help me

soory for the bad english
swa


Report this post
Top
  
Reply with quote  
PostPosted: June 18th, 2008, 12:02 am 
A little question...

Is it possible to use the SQLite + AHK environment to write a client-server application?

Server running SQLite +
4 client computers using the same db.

I am attempting to use a simple and light interface to write an application to simulate an EMR (eletronic medical record) system.

I had written some code in PHP + MySQL, but I found it to be hard and time-consuming writing the code.

Thanks in advance.


Report this post
Top
  
Reply with quote  
 Post subject: a bit confused
PostPosted: August 13th, 2008, 1:56 am 
Offline

Joined: May 23rd, 2007, 3:31 pm
Posts: 17
so what else is new.

Will this query an Access Db?

tia

Jet


Report this post
Top
 Profile  
Reply with quote  
 Post subject: SQLite major limitations
PostPosted: October 30th, 2008, 12:42 am 
Hi,

I've been using this script and SQLite, and it's great, but SQLite doesn't seem to support nested queries..

eg:
Code:
SELECT Model FROM Product
WHERE ManufacturerID IN (SELECT ManufacturerID FROM Manufacturer
WHERE Manufacturer = 'Dell')


I managed to find an alternative DLL:
http://sqlite.phxsoftware.com/

this one claims to be a full "drop and replace" for sqlite3.dll and it works for me, but it too doesn't seem to return on nested queries...

The site says it supports "nested transactions" but i'm not sure if this is the same thing as "nested queries". (is it?)

So anyway, to my question :)
Is there:
a) an alternative syntax I can use to get a nested query? (a left join maybe? I don't know)
b) an alternative SQL dll/method i can use? (MYSQL? or is that just for PHP?)
c) any other workarounds, advice, recommendations?

Thanks in advance :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2008, 8:04 am 
Offline
User avatar

Joined: May 10th, 2007, 10:54 am
Posts: 649
Location: .switzerland
can you post you db layout (tables, fields)? then I try to create your SQL statement :)

_________________
http://securityvision.ch
AHK 2D GAME ENGINE


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2008, 1:39 pm 
Cheers,

my table layout is:
Quote:
input, output, connection


an example of content would be:
Quote:
john, email, associative
document, send, associative
email, send, associative

send, email, forward
send, document, forward
document, website, forward
email, john, forward


Specifically what i'm trying to achieve is to pull out every "output" where input = 'send' and connection = 'forward', but only if that output is displayed in either "input" or "output" within a query that pulls input and output when the connection is "associative". This is all from a single table

So the single result for the above verbal query would be:
Quote:
send, email, forward
send, document, forward

If you remove the "email, send, associative" entry, it should return only:
Quote:
send, document, forward

(because "email" has a "forward" connection to "send", but not an "associative" one)

Does this make sense?

So I guess the SQL query I WANT to write might look a little like this:
(excuse my poor SQL)
Code:
SELECT * from table WHERE input = 'send' AND connection = 'forward'
AND input IN (SELECT output from table where input = 'send' AND connection = 'associative')
OR output IN (SELECT input from table where output = 'send' AND connection = 'associative')


I'm running in circles with this without being able to nest these queries, but I've heard that joins can do the same job with a bit of trickery, so any help you could give would be really appreciated :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2008, 10:48 am 
Offline
User avatar

Joined: May 10th, 2007, 10:54 am
Posts: 649
Location: .switzerland
Hi Bitcloud,

Well, that looks strange! :lol:

I think your SQL doesn't make sense.


1. So, at first, you should use other names for your fields in the table. input, output etc. are keywords.

2. Is this table createt by yourself? (Maby ots possible to design better table layout, multiple tables ...)

3.


Quote:
Specifically what i'm trying to achieve is to pull out every "output" where input = 'send' and connection = 'forward', but only if that output is displayed in either "input" or "output" within a query that pulls input and output when the connection is "associative". This is all from a single table

Its not quite easy to understand what you want. (your fields have names wich have multiple meanings. Hard to follow you.) Try to explain what you want from the table. So I can create the SQL Statement on my own. :)

_________________
http://securityvision.ch
AHK 2D GAME ENGINE


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2009, 1:55 pm 
Any chance of replacing the dependency on sqlite3.exe?

Replacing this:

Code:
; Function Name:    _SQLite_SQLiteExe()
; Description:      Executes Commands in SQLite.exe


With this:

int sqlite3_exec(
sqlite3*, /* An open database */
const char *sql, /* SQL to be evaluated */
int (*callback)(void*,int,char**,char**), /* Callback function */
void *, /* 1st argument to callback */
char **errmsg /* Error msg written here */
);

The sqlite3_exec() interface is a convenient way of running one or more SQL statements without having to write a lot of C code.


8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2009, 5:15 pm 
My bad :oops: , it's already there...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2009, 7:28 pm 
Offline

Joined: August 13th, 2006, 6:45 am
Posts: 354
Location: Germany
@Bitcloud: Try this sql statement:
Quote:
SELECT * FROM Test a, test b WHERE a.input = 'send' AND a.connection = 'forward'
and ((a.output = b.input and a.input = b.output)
or (a.output = b.output and a.input = b.input))
and b.connection = 'associative';


Hubert


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 29th, 2009, 8:17 pm 
Offline

Joined: March 30th, 2008, 5:50 pm
Posts: 23
Location: France 14
Hello,

I developped a tool to manage & explore SQLite databases
Program is based on the SQLite.ahk program from nick (denick)

See : http://www.autohotkey.com/forum/viewtopic.php?p=278214#278214


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2009, 9:35 am 
very nice work Maxmax14!
maybe u can help me out: i cant figure out how to solve this character problem:

table:groups
parent_id|name|id|deleted

$sSQL:= "INSERT INTO groups VALUES (1,'Büfé',2,0);"
$iRC := _SQLite_Exec(-1, $sSQL)

$sSQL = SELECT name, id FROM groups WHERE deleted!=0
_SQLite_Query(-1,$sSQL)
_SQLite_FetchData(-1 , result)
_SQLite_QueryFinalize(-1)

MsgBox % result

result= B􏻼f􏻩

is it possible to use eastern european characters with this library?


Report this post
Top
  
Reply with quote  
 Post subject: SQLite character problem
PostPosted: September 3rd, 2009, 8:35 pm 
Guest,

1) I tried your commands :
MsgBox % result
result = Büfé
2) With SQLite_Xplorer it is the same : result = Büfé

3) in DOS command using SQLite.exe databasename (see below) it returns "B³fÚ"

SQLite version 3.6.17
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT name, parent_id FROM groups;
B³fÚ|1
sqlite>

In fact I have no many experience with SQLite but if you don't have "Büfé" like me for §1 and §2 I think it should be problem we known ASCII tables in the PC (I have Win XP French). If you go to :
Control Panel, Regional and linguitic options, TAB Advanced options then there is a list of conversion code with main checkbox line :
I have this ones selected :
. 10000 MAC romain
. 10006, 10007, 10010, 10017, 10029, 10079, 10081, 10082, 1026
. 1250,1251,1252,1253,1254,1255,1256,1257,1258,1361,20261
. 20866,21866,28592,28594,28595,28597,28599,28605,37,437,500,50220
. and etc..

Please let me know how you solve your problem
MaxMax14


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2009, 11:01 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
nick (denick),

This is beautiful, thanks a lot for sharing and for the very organized and well documented script.

EDIT:
Small suggestion maybe.
Now the constants are defined globally, as part of the auto execution part.
If this file is included after the initial "Return", it will not work if it is used above the Return.

I changed it as follows:
Instead of all the globals defined as they are, contain them in a function:
Code:
_SQLite_DefineConstants() {
   Global
   $SQLITE_OK := 0            ; Successful result
   ...


And the Startup function, calls this function if needed:
Code:
_SQLite_Startup()
{
   Global
   If( !$SQLITE_s_DLL )
       _SQLite_DefineConstants()
   ...

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Stigg, toddintr and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group