Class::DBI::Loader. knowing table names and columns
am 29.11.2005 12:35:29 von javiermm-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I just start to use Class::DBI::Loader (and Class::DBI)
I'm test their using an example from manual:
use Class::DBI::Loader;
01 my $loader = Class::DBI::Loader->new(
02 dsn => "dbi:SQLite:./cookbook.db",
03 namespace => "Data",
04 );
05 my $class = $loader->find_class('recipes'); # $class => Data::Film
06
07 my $obj = $class->retrieve_all;
08
09 while (my $recipe = $obj->next) {
10 print $recipe->title, "\n";
11 }
12
13 print join (" ",$class->columns),"\n"
In line 05, i get an object about table 'recipes', but i need to know
the name of table before to use it. How can i know what tables have mi
database (without look the table's definition ;-)?
In line 13, i get the name of columns of that table. But the order isn't
the order of definition in the table. How can i know the columns name in
same order of definition table (without look the table's definition)?
thanks
- --
Javier Maria Mora Merchan
(GPGP) Key ID: 0x794F3D83
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDjD11pRHCj3lPPYMRAjhYAKCOHc9hNISGBLImsaoGmfaGCnY75gCg qEnB
VZEUJhZlrqdHr5nyaIMbBt8=
=nJyJ
-----END PGP SIGNATURE-----