Importing Data in a SQL

by Dinesh 2012-08-27 17:15:10

Anyone can import data in a SQL using following syntax.

Syntax:
Insert into tablename
(fieldname, fieldname, fieldname)
Values
(@fieldname, @fieldname, @fieldname);

Before you can import, you must create a data file in one of the following formats:

Btreive unformatted (.unf) -- File layout.
Logical, date, and time fields are in binary format.
Each row is preceded by its length, followed by a comma.
Each row is terminated with a carriage return.

Standard Data Format (.sdf) -- File layout.
All data is represented in ASCII characters.
A comma is used to separate fields.
Character fields are enclosed in double quotes.
Each row is terminated with a carriage return.

ASCII
Each row is preceded by a comma or a space.
Each field and each row is a specified length.
Each row is terminated with a carriage return.

DIF (.dif)
Each file is made up of two sections: header and data.
Each row has a standard length.
Each field has a standard length.

The Values clause is used to specify substitution variables.
Substitution variables must be preceded by an @ sign.
Each field in the Insert statement must be in the same order as the corresponding field in the data file.
694
like
0
dislike
0
mail
flag

You must LOGIN to add comments