
Chyfo version 1.7.1

Copyright (C) 1999-2000 Ispire Software
All Rights Reserved.

SAMPLES OF USING CHYFO
----------------------

  Samples datasource name - dsn
  Samples user login ID - usr
  Samples user password - pwd
  Samples user table - tab1
  Samples table columns - col1,col2,col3

1. Convert all rows of table tab1. Output files are saved in current
directory.

   a) CSV format (it is default):

   chyfo /d=dsn /u=usr /p=pwd /t=tab1

   or

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /of=csv

   b) TAB delimited format:

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /of=tab

   c) FIXED length format:

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /of=fix

These samples create files tab1.txt (data file) and tab1.log (log file).

2. Provide a SQL SELECT statement specifying the data to be exported.
Output files are saved in current directory.

   chyfo /d=dsn /u=usr /p=pwd /s=select col1,col2 from tab1 where col3='abc'

   You can optionally enclose parameter values in double quotation marks

   chyfo /d=dsn /u=usr /p=pwd /s="select col1,col2 from tab1 where col3='abc'"

3. Exclude some columns from converting:

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /exc=col1,col3

   Data of columns col1 and col3 isn't converted.
   Also for the same effect you can use:

   chyfo /d=dsn /u=usr /p=pwd /s=select col2 from tab1

   Which method is the best depend on count of columns you want convert
   or exclude.

4. Define start row and number of rows to be exported.

   a) skip first 9 rows:

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /srow=10

   b) convert only first 100 rows:

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /cnrow=100


5. Set output directory, file names and row prefetch count.

   Row prefetch count defines size of the internal buffer that can
significantly decrease converting time. 

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /dir=d:\data /n=data1 /r=1000

   This sample creates files data1.txt (data file) and data1.log (log file) in
the directory d:\data.

6. Create loading script and table creation script for an IBM DB2 database.

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /cmd=db2 /r=10000

   This sample creates files tab1.txt (data file), tab1.log (log file),
tab1.tab file that contains table creation script like this:

   create table tab1(
	col1 integer,
	col2 char(3),
	col3 varchar(20));

and tab1.cmd file (IBM DB2 script) that contains:

   a) CSV format

   Using DB2 IMPORT command
   db2 import from tab1.txt of del commitcount 10000 insert into tab1

   Using DB2 LOAD command
   db2 load from tab1.txt of del savecount 10000 insert into tab1

   b) TAB format

   Using DB2 IMPORT command
   db2 import from tab1.txt of del modified by coldel0x09 chardel0x01
   commitcount 10000 insert into tab1

   Using DB2 LOAD command
   db2 load from tab1.txt of del modified by coldel0x09 chardel0x01
   savecount 10000 insert into tab1

   c) Fixed length format

   Using DB2 IMPORT command
   db2 import from tab1.txt of asc method L (1 11,13 15,17 36)
   commitcount 10000 insert into tab1

   Using DB2 LOAD command
   db2 load from tab1.txt of asc method L (1 11,13 15,17 36)
   savecount 10000 insert into tab1

7. Create loading script and table creation script for an Oracle database.

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /cmd=ora /r=10000

   This sample creates files tab1.txt (data file), tab1.log (log file),
tab1.tab file that contains table creation script like this:

   create table tab1(
	col1 integer,
	col2 char(3),
	col3 varchar2(20));

and tab1.cmd file (SQL Loader script) with tab1.ctl (SQL Loader control file)
that contains:

   a) CSV format

   load data
   infile 'tab1.txt'
   into table tab1
   fields terminated by ',' optionally enclosed by '"'
   (col1,col2,col3)

   b) TAB format

   load data
   infile 'tab1.txt'
   into table tab1
   fields terminated by X'09'
   (col1,col2,col3)

   c) Fixed length format

   load data
   infile 'tab1.txt'
   into table tab1
   (col1 position (1:11),
    col2 position (13:15),
    col3 position (17:36))

8. Create loading script and table creation script for a MS SQL Server 
   database.
   You should use TAB format as BCP doesn't carefully support CSV and
   FIX formats.

   chyfo /d=dsn /u=usr /p=pwd /t=tab1 /cmd=mssql /r=10000

   This sample creates files tab1.txt (data file), tab1.log (log file),
tab1.tab file that contains table creation script like this:

   create table tab1(
	col1 integer,
	col2 char(3),
	col3 varchar(20));

and tab1.cmd file (BCP utility script) that contains:

  bcp tab1 in tab1.txt -c -Usa -Ppwd -b10000

------------------------------------






