untitled
viviti

PDBTools  

What is PDBTools?

PDBTools,new version of DBTools, is a command line DataBase interface program.  PDBTools was coded by PHP base on ADOdb(a cross Database library). PDBTools provides you a cross O.S. and DataBases platform solution.


How to use PDBTools?

Call out the program with parameters as follows.

Use:PDBTools [-n|N] [-D|d] [-i|I] ini_file [output_file] [log_file]

  • ini_file: Data base script file name.
  • output_file: Data output file name.
  • log_file: Execution log will save on log file. Default log file name is DBToolLog.txt.
  • *** The default output file format is CSV. Base on the sub-name of output_file, The output format may be:
    Sub-Name Format
    CSV CSV
    HTM HTML
    HTML HTML
    SQL SQL commands

    * Default for SQL format, Data informations will dump by update commands. In case of  -D|d option was provided, A drop, create command was insert before insert commands for all data duplicate. and In case of -I|i option was provided, Data will dump as insert commands.
  • -N|n sql_dump_flag means dump D.B. structure only.
  • -D|d Drop and create the table before D.B. data copy.
  • -I|i Use Insert SQL command for D.B. data copy.
    default will use update command.
  • *** The first command line in ini_file must be the discription of source Data Base informations. It means the source must be a Data Base. And the destination may be a file in CSV,HTML,SQL format or another DataBase. In case of DBTYPE=ODBC, the Data Base can be a commercial/open source Data Base or a Excel/CSV/Txt file.

    All the SQL command will access with source DataBase. In case of Select SQL command, the data will copy to the output file or destination DataBase.

    ini_file directive:

    1:First character less than 'A' will treat as a comment line.
    2:The first command line must discribe the Data Base source.
  • DataBase Infomations Format:
    Key-Word1=Value1;Key-Word2=Value2;...or:
    Value1;Key-Word2=Value2;...
    *In case of first key-word was absent, value1 will be treated as DBTYPE value.
    Following are Data Base Infomations Key-Words:
    Key-Word description
    DBTYPE=type Define D.B. type.(Type define by ADOdb) (must be first parameter for D.B. Info.)
    Ex.ODBC,MySQL,MSSQL...
    link this for more detail
    SERVER=address Define Srrver location(IP address).
    URL=address Define Srrver location(IP address).
    PW=Pass_Word
    PWD=Pass_Word
    PASS=Pass_Word
    PASSWORD=Pass_Word
    Define Pass Word.
    DATABASE=D.B._name Define Data Base Name
    SID=sid Define SID for Oracle Data Base.

    More Key-Word for DBTYPE=ODBC:
    Key-Word description
    UID=User_ID/UserName Define User ID or Name.
    DBA=W Define D.B. Access in write mode
    DBQ=D.B.File_Name Define Data Base file name.
    DEFAULTDIR=Dir. Define default Dir.
    DRIVER=Driver Define ODBC Driver Name.
    Extensions=txt,csv,tab,asc Define file extension for text file type
    FIL=text | excel 8.0 Define file type
    FILEDSN=DSN_Name
    DSN=DSN_Name
    Define DSN file Name.
    PORT=Port_Number Define port number.

  • *** Next directive may use EXCEL DBOut HTML or standard SQL commands....
    3:HTML [;ztab][;specialchars]
    4:EXCEL xls_file_Name Table(sheet)_name 5:DBOut;D.B.Informations;Insert/Update/Drop DataBase_name KeyName
    6:ListDBTables
    7:DataBase DataBase-Name

    *SQL Select command causes data dump, so HTML/EXCEL/DBOut commands must present previous and effect on next Select commands.

    ini_file examples:(ODBC)

    EX. for CSV/Text file
    ODBC;DBQ=E:\Delelop\SERVICE\PDBTools\WEATHER;DefaultDir=E:\Delelop\SERVICE\PDBTools\WEATHER;Driver={Driver da Microsoft para arquivos texto (*.txt; *.csv)};DriverId=27;Extensions=txt,csv,tab,asc;FIL=text;FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\Weather.dsn;MaxBufferSize=2048;MaxScanRows=25;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;

    Select * from wout.csv
    EX. for Access file
    ODBC;DBQ=F:\TEMP\PDBTools\Debug\Test.mdb;DefaultDir=F:\TEMP\PDBTools\Debug;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\Access.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;

    Select * from STUDENT
    EX. for Excel file
    ODBC;DBQ=F:\TEMP\PDBTools\Debug\Test.xls;DefaultDir=F:\TEMP\PDBTools\Debug;Driver={Driver do Microsoft Excel(*.xls)};DriverId=790;FIL=excel 8.0;MaxBufferSize=2048;MaxScanRows=65535;PageTimeout=5;ReadOnly=0;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;

    Select * from STUDENT
    EX. for MySQL
    DRIVER={MySQL ODBC 3.51 Driver};DESC=;FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\MySQL.dsn;

    Select * from dynabind_section
    EX. for Oracle
    ODBC;DRIVER={Oracle ODBC Driver};FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\DSN-name.dsn;SERVER=server-name;UID=myUID;PWD=MyPassword;DBQ=DBQ-name;DBA=W;APA=T;PFC=1;TLO=O;

    Select * from STUDENT




    Web Hosting · Blog · Guestbooks · Message Forums · Mailing Lists
    Easiest Website Builder ever! · Build your own toolbar · Free Talking Character · Email Marketing
    powered by a free webtools company bravenet.com