Anyone knows how to make oracle statements (select, update, insert, delete) from ahk?
I found an old code that I tryied to run once, but cound't make work.
Code: Select all
Query(Query)
{
ConnectionString := "Provider=OraOLEDB.Oracle.1;Data Source=MYDB;User Id=id_user;Password=password;"
oCon := ComObjCreate( "ADODB.Connection")
oCon.ConnectionTimeout := 3 ; Allow 3 seconds to connect to the server.
oCon.CursorLocation := 3 ; Use a client-side cursor server.
oCon.CommandTimeout := 900 ; A generous 15 minute timeout on the actual SQL statement.
oCon.Open( ConnectionString ) ; open the connection.
oRec := oCon.execute( Query )
try
value := oRec.Fields(0).value
oCon.Close()
return value
}
res := Query("select NUMERODF from teste")
MsgBox % res
return
I have a tsn configured this way, on a oracle 11g:
MYDB=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MY_IP)(PORT=MY_PORT)))(CONNECT_DATA=(SERVICE_NAME=MY_SN)));
Anyone can help me how to configure this so i can run sql statements from my ahk?
Thanks in advance.