Skip to content

Monthly Archives: March 2007

Using COLUMN in SQL*Plus

Here’s something I learned about SQL*Plus today. If you want to create a variable in a script, you can use the COLUMN command. In the following script, 2 variables called HOST_NAME and DATABASE_NAME are created. Their values are filled in when the SELECT statement executes. col host_name new_value HOST_NAME col instance_name new_value DATABASE_NAME SELECT host_name, […]

Using Oracle with Ruby on Rails

If you want to use the Ruby Oracle OCI driver with Ruby on Rails, you might run into problems with the configuration. In the database.yml file, the following should be used to specify the host : host: localhost/mydatabase The mydatabase part is the the name of your database. For the adapter ‘oci’ should be specified. […]

Paginating the results from a query in Oracle

MySql has some interesting additions to standard SQL to show paginated results : the LIMIT n OFFSET skip clause. The website http://troels.arvin.dk/db/rdbms/#select-limit-offset shows a way of doing this in Oracle.

Little Ruby script for generating passwords

Ruby is a scripting language, in the same league as Perl and Python. It is fully object-oriented, and comes batteries includes like Python, which means it comes with a full library installed by default. It is receiving a lot of attention these days due to the Ruby on Rails web application framework, which is indeed […]