Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

by Marcos Sanchez Provencio (see this note).

Code Block
import System.Data.OracleClient

connectionString ="Data Source=rioja;User ID=system;Password=xxxx;"
dbcon = OracleConnection(connectionString)
dbcon.Open()
dbcmd = dbcon.CreateCommand();
sql = "SELECT nombre, descripcion from norna.dic_tablas"
dbcmd.CommandText = sql
reader = dbcmd.ExecuteReader()
while reader.Read():
    nombre = reader["nombre"]
    descripcion = reader["descripcion"]
    print "Tabla: $nombre Descripción: $descripcion"

To compile (from boo/bin):

No Format
 ./booc.exe -r:System.Data.OracleClient ../examples/pruebaOracle.boo

To run:

No Format
./pruebaOracle.exe

See also Database Recipes and ADO.NET resources.