$ORACLE_HOME/demo/rdbms/cdemo1.c does exactly what you want.
If it's not present you can install it from the Companion disk (10g) or Examples disk (11g).