me,myself,english and programming..

Archive for February, 2009

AutoIT – Connecting to Oracle.

Wednesday, February 18th, 2009

Previously I wrote about how to connect to SQL Server using AutoIt. Since that I’m using Oracle as my main database in my new workplace, I will show how to do the same thing for Oracle.

$conn = ObjCreate( "ADODB.Connection" )
$DSN = "Driver={Microsoft ODBC for Oracle};Server=ORCL;Uid=myID;Pwd=myPwd;"
$conn.Open($DSN)
$rs = ObjCreate( "ADODB.RecordSet" )
$rs.Open( "select BANNER from v$version where banner like 'Oracle%'", $conn )
MsgBox(0, "AutoIT-SQL Result", "Value = " & $rs.Fields( "BANNER" ).Value )
$conn.close

The codes will produce something like below.

autoit-oracle

 

Till then..

Happy coding..!

Generate DROP TABLE Statement in ORACLE.

Monday, February 16th, 2009

I’ve come to this site while gooling around for generating drop tables statement in Oracle. Thanks.

As for my future reference, I will write those SQL statement in my post.

select 'drop table '||table_name||' CASCADE CONSTRAINTS;' from USER_TABLES where table_name like '%_XXX%'

Happy SQL-ing !

p/s: Is there anyone know about replication in oracle ?? it gives me headache !! grrrrrr