Run an SQL INSERT statement against an Oracle database
-
- Posts: 24
- Joined: 04 Dec 2014, 07:47
Run an SQL INSERT statement against an Oracle database
I've seen a couple of libs supporting SQL but they only mention explicitly Access, SQLLite, that I can see. It seem I should be able to connect to any DB but could anyone give a slightly more concrete example how that might be done for Oracle? Can I just put a connection string in my script for instance?
Re: Run an SQL INSERT statement against an Oracle database
Hello johnny256ahk.
Welcome to the AutoHotkey community forums
I currently use ADOSQL() by VxE to manage a SQL Server DataBase from an AHK Script. It allows me to pass in all kinds of statements.
Usage is pretty simple, and all you need is a valid connection string, and the SQL query to be processed. A 2D table object is returned by the function, and you can access the values of the cells with:
Example:
Best wishes
Welcome to the AutoHotkey community forums
I currently use ADOSQL() by VxE to manage a SQL Server DataBase from an AHK Script. It allows me to pass in all kinds of statements.
Usage is pretty simple, and all you need is a valid connection string, and the SQL query to be processed. A 2D table object is returned by the function, and you can access the values of the cells with:
Code: Select all
object[row, column]
Example:
Code: Select all
ConnectString := "" ; Adjust your connection string here.
Query := "SELECT * FROM Table" ; Adjust table name here.
RESULT := ADOSQL(ConnectString, query)
msgbox % RESULT[2, 1] ; First row contains the column names, so use the second.
"What is suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
Archmage Gray - A fantasy shooter game fully coded in AutoHotkey
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
Archmage Gray - A fantasy shooter game fully coded in AutoHotkey
Re: Run an SQL INSERT statement against an Oracle database
never bothered with a library
i always just use adodb.connection and adodb.recordset against a configured ODBC connection.
i always just use adodb.connection and adodb.recordset against a configured ODBC connection.
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
-
- Posts: 24
- Joined: 04 Dec 2014, 07:47
Re: Run an SQL INSERT statement against an Oracle database
Do you mean an externally configured ODBC connection, or done through AHK? I have vague memories of setting up DSNs but am not sure if this is what you're referring to.tank wrote:never bothered with a library
i always just use adodb.connection and adodb.recordset against a configured ODBC connection.
-
- Posts: 24
- Joined: 04 Dec 2014, 07:47
Re: Run an SQL INSERT statement against an Oracle database
The issue I see here is I have to pass the connection-string every time, and keep opening/closing a connection. I don't know if the performance of keeping a connection open would be better, but being able to open it and have a handle would be neat so my logging functions don't have to know the connection string!Gio wrote:Hello johnny256ahk.
Welcome to the AutoHotkey community forums
I currently use ADOSQL() by VxE to manage a SQL Server DataBase from an AHK Script. It allows me to pass in all kinds of statements.
Usage is pretty simple, and all you need is a valid connection string, and the SQL query to be processed. A 2D table object is returned by the function, and you can access the values of the cells with:
Code: Select all
object[row, column]
Example:Best wishesCode: Select all
ConnectString := "" ; Adjust your connection string here. Query := "SELECT * FROM Table" ; Adjust table name here. RESULT := ADOSQL(ConnectString, query) msgbox % RESULT[2, 1] ; First row contains the column names, so use the second.
Any thoughts on that?
Re: Run an SQL INSERT statement against an Oracle database
Interesting question. I have used this function for a very long time and even succesfully implemented a multi-user application without having any major connection/performance issues, even on relatively old computers.The issue I see here is I have to pass the connection-string every time, and keep opening/closing a connection. I don't know if the performance of keeping a connection open would be better, but being able to open it and have a handle would be neat so my logging functions don't have to know the connection string!
Any thoughts on that?
However, you may be right, and i just haven't investigated the function deeply enougth to answer your question. I will ask VxE about this in the functions topic
"What is suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
Archmage Gray - A fantasy shooter game fully coded in AutoHotkey
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
Archmage Gray - A fantasy shooter game fully coded in AutoHotkey
Re: Run an SQL INSERT statement against an Oracle database
yesjohnny256ahk wrote: Do you mean an externally configured ODBC connection, or done through AHK? I have vague memories of setting up DSNs but am not sure if this is what you're referring to.
you can configure with ahk using regwrite
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: Run an SQL INSERT statement against an Oracle database
Can i connect to database mySQL on my Hosting with this?
Who is online
Users browsing this forum: haomingchen1998, ShatterCoder and 145 guests