EasyDB::Query::Insert - EasyDB INSERT query routines
This file is used by EasyDB.
Provides INSERT functionality for the EasyDB package.
Takes as it's parameters a DBI database handle. Will return an INSERT query object.
Sets the debugging level of this object. The standard debug level would normally be 1, and that would tell you what the program is up to. If you want you can go as high as 5, which spurts out reams and reams of useless debugging information.
$easyDB->debug('1');
would be sufficient.
When called with a table name this function will set the table that the query will execute on. Without a table name it will return the current table it is looking at.
$easyDB->add->table('table1');
If you have changed the table then the new table is returned.
This function will either return the current SQL string, if one has been generated, or nothing if there is no SQL statment stored.
my $string = $easyDB->add->sql();
string now holds the SQL statement.
This function is used to insert data into the database. You pass it a hash of data, in the same format as that used for criteria(). If then converta that into the correct SQL and runs it against the database.
$easyDB->add->table('table1'); $easyDB->add->data( Name => 'Iris', Age => '23', Height => '150' );
It will return 1 or 0 depending on the success of the INSERT query.
Function to execute an INSERT statement. This function is only ever called by the INSERT query object.
Internal function used to report error messages. When you specify the level of this message it is checked against the current debug level. If the debug level is equal or greater than the level of this message, it is displayed.
Unsure as to how stable the SQL parsing engine is. I don't know its tolerance for bad syntax.
I'll have to get back to you on that one
EasyDB
This is part of Gaby Vanhegan's third year project for the University Of Leeds.
Gaby Vanhegan <gaby@vanhegan.com>
To install EasyDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm EasyDB
CPAN shell
perl -MCPAN -e shell install EasyDB
For more information on module installation, please visit the detailed CPAN module installation guide.