2 posts in this topic
view result sql into array
You can run a sql query in a script of autoit ? I would like to see the result in an array table ..
SQL query with bulk insert conversion
select top 0 * into #tmpdatabase from ABTABLE; select * from #tmpdatabase; BULK INSERT #tmpdatabase FROM $fileupload WITH (FIELDTERMINATOR =';',ROWTERMINATOR ='\n' ,FIRSTROW = 2); MERGE ABTABLE AS T USING #tmpdatabase AS S ON (T.A = S.A) WHEN NOT MATCHED BY TARGET THEN INSERT( [A] ,[K] ) VALUES( S.[A] ,S.[K] ) WHEN MATCHED THEN UPDATE SET T.[A] = S.[A] ,T.[K] = S.[K]; drop table #tmpdatabase; Hi, I'm trying to convert this query that I make from Toad that loads a file into a tempdatabase from .csv file based on an existing table on the sql server into autoit friendly code but don't know how to do it, been rubbing my head on this one :P, maybe need a different approach?
I'm using AutoIt Version: 22.214.171.124
This doesn't seem to do anything:
Local $obj_SQL_DB = _SQLConnect("db.u\SQl1", "data", 1, "At", "Pass") If @error Then Return SetError(50, @error, -1) Local $strSQL = "select top 0 * into #tmpdatabase from ABTABLE;" $obj_SQL_DB.Execute($strSQL) Any suggestions would be fantastic
Nevermind i managed to do this like this instead :), mark as solved!
Local $file = FileOpen("\TEST\SQL_UPD.txt",0) Local $strSQL = FileRead($file) $obj_SQL_DB.Execute($strSQL)
Is it possible to post into the usenet with autoit ?
is there a way to post into the "Usenet" with autoit ?
I didn't found any resources about it online.
Autoit and remote SQL quarry
I am trying to get remote autoit to work with SQL. I know that I can use SQLLite however I have a server that I have SQL setup on already that I have used. I am using a SQL include “see attached”. However I can’t get it to work. Here is a simple snippet of code that I am using. I have looked in both google and here but can’t get anything working. Was wondering if it is a problem with being on windows 10.
#include <Array.au3> #include <SQL.au3> $IP = "192.168.1.100" $User = "user" $Pass = "pass" $DB = "Login" $out = _SQLConnect($IP,$DB,1,$User,$Pass) _ArrayDisplay($out) MsgBox(0,"",$out) Here is the error I am getting when it runs.
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Program Files (x86)\AutoIt3\Include\SQL.au3" (29) : ==> The requested action with this object has failed.: If $fAuthMode Then $oConn.Open ("DRIVER=" & $sDriver & ";SERVER=" & $sServer & ";DATABASE=" & $sDatabase & ";UID=" & $sUsername & ";PWD=" & $sPassword & ";") If $fAuthMode Then $oConn^ ERROR ->22:36:28 AutoIt3.exe ended.rc:1 +>22:36:28 AutoIt3Wrapper Finished. >Exit code: 1 Time: 16.16
SQL Query Help
Hopefully someone a little more solid in SQL can give me a hand.
I have a many-to-many-to-many setup.
a.field1 a.field2 a.field3 x.afield1 x.bfield1 b.field1 b.field2 b.field3 y.bfield1 y.cfield1 c.field1 c.field2 c.field3 In essence, I need all a.field1 where c.field3="stringvalue".
I could do it with multiple queries, and looping, but I am hoping there is a simpler, single query I can make.
Thanks in advance for any help.