view mayachemtools/docs/modules/txt/DBUtil.txt @ 9:ab29fa5c8c1f draft default tip

Uploaded
author deepakjadmin
date Thu, 15 Dec 2016 14:18:03 -0500
parents 73ae111cf86f
children
line wrap: on
line source

NAME
    DBUtil

SYNOPSIS
    use DBUtil;

    use DBUtil qw(:all);

DESCRIPTION
    DBUtil module provides the following functions:

    DBConnect, DBDisconnect, DBFetchSchemaTableNames, DBSQLToTextFile,
    DBSetupDescribeSQL, DBSetupSelectSQL

    DBUtil package uses Perl DBI for interacting with MySQL Oracle, and
    PostgreSQL databases.

FUNCTIONS
    DBConnect
            $DBHandle = DBConnect($DBDriver, $DBName, $DBHost, $DBUser, $DBPassword);

        Connects to a database using specified parameters and returns a
        DBHandle.

    DBDisconnect
            DBDisconnect($DBHandle);

        Disconnects from a database specified by *DBHandle*.

    DBFetchSchemaTableNames
            @SchemaTableNames = DBFetchSchemaTableNames($DBDriver, $DBHandle,
                               $SchemaName);

        Returns an array of all the table names in a database *SchemaName*.

    DBSetupDescribeSQL
            $DescribeSQL = DBSetupDescribeSQL($DBDriver, $TableName, [$SchemaName]);

        Sets up and returns a SQL statement to describe a table for MySQ,
        Oracle or PostgreSQL.

    DBSetupSelectSQL
            $SelectSQL = DBSetupSelectSQL($DBDriver, $TableName, $SchemaName);

        Sets up and returns a SQL statement to retrieve all columns from a
        table for MySQL, Oracle, or PostgreSQL.

    DBSQLToTextFile
            $Status = DBSQLToTextFile($DBHandle, $SQL, \*TEXTFILE, $OutDelim,
                      $OutQuote, [$ExportDataLabels, $ExportLOBs,
                      $ReplaceNullStr]);

        Executes a *SQL* statement and export all data into a text file.

AUTHOR
    Manish Sud <msud@san.rr.com>

COPYRIGHT
    Copyright (C) 2015 Manish Sud. All rights reserved.

    This file is part of MayaChemTools.

    MayaChemTools 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; either version 3 of the License, or (at
    your option) any later version.