NAME

DBI::Library - DBI subclass providing a dynamic SQL Libary.

SYNOPSIS

FO Syntax

use DBI::Library qw(:all);

my $m_dbh = initDB({name => 'LZE',host => 'localhost',user => 'root',password =>'',style=> 'Crystal'});

OO Syntax

use DBI::Library;

        my ($m_oDatabase,$m_dbh) = new DBI::Library(

                {

                name =>'LZE',

                host => 'localhost',

                user => 'root',

                password =>'',

                style=> 'Crystal'

                }

        );

        my %execute  = (

                title => 'showTables',

                description => 'description',

                sql => "show tables",

                return => "fetch_array",

        );

        $m_oDatabase->addexecute(\%execute);

        $m_oDatabase->showTables();

Export Tags

:all execute useexecute quote void fetch_hashref fetch_AoH fetch_array updateModules deleteexecute editexecute addexecute tableLength tableExists initDB

:dynamic execute useexecute void fetch_hashref fetch_AoH fetch_array updateModules deleteexecute editexecute addexecute

independent: tableLength tableExists initDB :dynamic

DESCRIPTION

DBI::Library is a DBI subclass providing a dynamic SQL Libary.

new()

        my $m_oDatabase = new DBI::Library();


        my ($m_oDatabase,$m_dbh) = new DBI::Library(

                                        {

                                        name => $db,

                                        host => $host,

                                        user => $m_sUser,

                                        password => $password,

                                        }

        );

initDB()

        my $m_dbh = initDB(

                {

                name => 'LZE',

                host => 'localhost',

                user => 'root',

                password =>'',

                }
        );

Driver()

set or get the driver

       Driver()

default: Mysql

CurrentDb()

gibt die aktuelle datenbank zurück

CurrentHost()

gibt den aktuellen host zurück

CurrentUser()

gibt den aktuellen user zurück

CurrentPass()

gibt das aktuelle passwort zurück

independent functions

tableExists()

$bool = $m_oDatabase->tableExists($table);

tableLength

$length = $m_oDatabase->tableLength($table);

dynamic statements

addexecute()

add sql statments to yourdatabase for later use witdh useexecute();

        my %execute  = (

                title => 'showTables',

                description => 'description',

                sql => "show tables",

                return => "fetch_array",

        );

        $m_oDatabase->addexecute(\%execute);

        print join '<br/>' ,$m_oDatabase->showTables();

Fo Syntax:

        print join '<br/>' , useexecute('showTables');

editexecute

        my %hash = (

                title => 'Titel',

                newTitle => 'New Titel',

                description => 'querys Abfragen',

                sql => "sql statement",

                return => 'fetch_hashref', #subname

        );

        editexecute(\%hash);

useexecute()

        useexecute($m_sTitle,optional hashref {identifier => {1 => 'news', 2 => 'querys'}  , @parameter);

example:

        my %execute = (

                title => 'joins',

                description => 'description',

                sql => 'select * from table_1 JOIN  table_2 ',

                return => "fetch_hashref"

        );

        $m_oDatabase->addexecute(\%execute5);

        my $ref = $m_oDatabase->joins({identifier => {1 => 'news', 2 => 'querys'}});

deleteexecute()

        deleteexecute($m_sTitle);

fetch_array()

        @A = $m_oDatabase->fetch_array($sql);

fetch_AoH()

@aoh = $m_oDatabase->fetch_AoH($sql)

fetch_hashref()

$hashref = $m_oDatabase->fetch_hashref($sql)

void()

void(sql)

quote()

        $quotedString = $m_oDatabase->quote($sql);

selectTable

set a placeholder wihich is usesd by dynmaic statements.

<TABLE> will be replaced width this value.

default : querys;

Privat

updateModules()

getSelf()

AUTOLOAD()

statements add by addexecute can called like

$m_oDatabase->showTables()

prepare()

execute()

fetch()

AUTHOR

Dirk Lindner <lze@cpan.org>

LICENSE

Copyright (C) 2006-2008 by Hr. Dirk Lindner

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 195:

Non-ASCII character seen before =encoding in 'zurück'. Assuming UTF-8