Bulk Copy Example - Sybase 12.5.1 User Manual

Historical server
Table of Contents

Advertisement

Bulk copy example

User's Guide
This section describes how to pass historical data files to the Bulk Copy (
utility to populate Adaptive Server tables.
To store recorded data in an Adaptive Server table by using
create a table for each view defined for the session. In the table, create a
separate column for each of the data items that comprise the view. The first
column for each table, which stores the date and time of the sample, must be of
the
datatype.
datetime
If no data is returned for a view during a sample interval while Historical
Server is recording, a placeholder record is written to the view's data file. This
record contains the timestamp of the sample followed by a comma-separated
list of empty values. For this reason, it is recommended that all but the first
column be defined to allow nulls.
You may simplify the process of creating tables by having the Historical Server
create a script file for you. Use the
hs_create_recording_session
After you create the tables on Adaptive Server, you can use the
import data from the view data files to their respective tables. Run the
following command once for each data file for which you want to import the
data into an Adaptive Server table:
bcp [[database_name.]owner.]table_name in
view_data_file -c [ -e errfile] [-U username]
[-P password] [-S sqlserver] -t,
where:
database_name is the name of the database where the tables to hold the
imported data are located.
owner is the name of the table's owner (presumedly your own user name
in the database that contains the table).
table_name is the name of the database table into which the data from the
view's data file is to be imported.
view_data_file is the name of the data file for the view.
errfile is the name of an error file in which any rows that could not be
transferred to the database table are to be stored.
username is the login name to Adaptive Server.
password is the password of the username.
parameter of the
script_type
command.
CHAPTER 5
Data Files
, you must first
bcp
utility to
bcp
)
bcp
99

Advertisement

Table of Contents
loading

Table of Contents