Not too big a accomplishment for the experienced .NET-programmer, but since I’m still learning .NET, and ODP.NET and IronPython, I think I did something great. This is the script (don’t be scared):
1 2 3 4 5 6 7 8 9 10 11 12 13 | import sys sys.LoadAssemblyByName( 'Oracle.DataAccess' ) from Oracle.DataAccess import * from Oracle.DataAccess.Client import * OraCon = OracleConnection() OraCon.ConnectionString = 'User Id=scott; Password=tiger; Data Source=ORCL' OraCon. Open () OraCmd = OraCon.CreateCommand() OraCmd.CommandText = 'select ename from emp where deptno = 20' OraDR = OraCmd.ExecuteReader() while OraDR.Read(): print ( "Employee Name: " + OraDR.GetString( 0 )) OraCon.Close() |
And this is the output: