Rishav Posted October 8, 2009 Posted October 8, 2009 Considering that adodb is my latest crush, here's my new roadblock. Dim $OraOBJConn, $OraOBJRecSet ; Different queries depending on DB types If $Settings_Main_DBType_inp = "ORACLE" Then ; Create a COM ADODB Object with the Beta version $OraOBJConn = ObjCreate("ADODB.Connection") With $OraOBJConn .ConnectionString = ("Provider='OraOLEDB.Oracle';Data Source=" & $Settings_Main_TNS_inp & ";User Id='" & $Settings_Main_SysUserID_inp & "';Password='" & $Settings_Main_SysUserPass_inp & "';") .Open EndWith ; Create a Record Set to handles SQL Records $OraOBJRecSet = ObjCreate("ADODB.RecordSet") With $OraOBJRecSet .ActiveConnection = $OraOBJConn .Source = "Select something from something" .Open EndWith $OraOBJConn.Close EndIf Now instead of running a simple select query, i want to invoke a sql file (i normally use it via a batch file containing the sqlcmd command. Any ideas folks? thanks and regards Rishav
Zedna Posted October 8, 2009 Posted October 8, 2009 Search forum for ADODB.Connection there are many examples. Instead of "SELECT ... FROM ..." use FileRead() for reading SELECT from your file. Resources UDF ResourcesEx UDF AutoIt Forum Search
Rishav Posted October 8, 2009 Author Posted October 8, 2009 fileread. hmmm. neat idea. will check it out. thanks.
ChrisL Posted October 8, 2009 Posted October 8, 2009 http://www.autoitscript.com/forum/index.php?showtopic=51952 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
mastmaal Posted April 27, 2010 Posted April 27, 2010 Hi Everyone, I'm a newbie with AutoIt and oracle, the code above is similar to what I am trying to achieve, so that is why I am replying to this. I wanted to know how to send anonymous blocks to oracle? For example, from the code above, With $OraOBJRecSet .ActiveConnection = $OraOBJConn .Source = "select Destination from Destinations where dest_id = 0" .Open EndWith This sections sends one query to the db and returns the result. How do I attach more queries to it? I have tried concatenating queries, which doesn't work, I have tried using " ; " after my query ends, but I always get an ORA invalid character error, and I'm not really sure how to do this. Any help would be greatly appreciated.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now