The format file follows:
<format file>
7.0
13
1 SQLCHAR 0 50 "|" 2 call_date
2 SQLCHAR 0 50 "|" 10 call_time
3 SQLCHAR 0 50 "|" 3 call_cli
4 SQLCHAR 0 50 "|" 4 call_destination
5 SQLCHAR 0 50 "|" 5 call_destination_text
6 SQLCHAR 0 50 "|" 6 call_duration
7 SQLCHAR 0 50 "|" 7 call_customer_id
8 SQLCHAR 0 0 "|" 0 unknown
9 SQLCHAR 0 0 "|" 0 unknown
10 SQLCHAR 0 0 "|" 0 unknown
11 SQLCHAR 0 0 "|" 0 unknown
12 SQLNUMERIC 0 9 "|" 8 call_charge
13 SQLCHAR 0 0 "\r\n" 0 unknown
</format file>
> -----Original Message-----
> From: Colin Robinson [mailto:[EMAIL PROTECTED]]
> Sent: 25 September 2001 14:29
> To: SQL
> Subject: RE: Data type conversion
>
>
> I'm using a bulk insert
>
>
> <code>
>
> CREATE PROCEDURE importcsv
> @user_site_id varchar(100),
> @filename varchar(255),
> @tablename varchar(25),
> @template varchar(255)
> as
> declare @dynINSERT varchar(300)
> declare @dynDELETE varchar(300)
> declare @dynUPDATE varchar(300)
>
> select @dynDELETE = ' DELETE FROM '+@tablename
>
> select @dynINSERT = ' BULK INSERT '+@tablename+'
> FROM '''+@filename+'''
> WITH( FIELDTERMINATOR = ''|'' ,
> ROWTERMINATOR = ''\r\n'' ,
> FIRSTROW=2,
> FORMATFILE='''+@template +''' )'
>
> select @dynUPDATE = ' UPDATE '+@tablename+'
> SET call_site_id = '''+@user_site_id+'''
> WHERE call_site_id = ''unknown'''
>
>
> print @dynDELETE
> exec(@dynDELETE)
>
> print @dynINSERT
> exec(@dynINSERT)
>
> print @dynUPDATE
> exec(@dynUPDATE)
>
> </code>
>
> > -----Original Message-----
> > From: Dean H. Saxe [mailto:[EMAIL PROTECTED]]
> > Sent: 25 September 2001 14:17
> > To: SQL
> > Subject: RE: Data type conversion
> >
> >
> > How are you inserting your data? Lets see the SQL...
> >
> > -dhs
> >
> > At 02:08 PM 9/25/01 +0100, you wrote:
> > >I am now getting negative numbers ?
> > >
> > > > -----Original Message-----
> > > > From: Dean H. Saxe [mailto:[EMAIL PROTECTED]]
> > > > Sent: 25 September 2001 13:31
> > > > To: SQL
> > > > Subject: Re: Data type conversion
> > > >
> > > >
> > > > Use a numeric datatype. In Oracle, number(7,6), SQL server
> > > > is something
> > > > similar. The first digit inside the parenthesis is the
> number of
> > > > significant digits, the second number is the number of digits
> > > > after the
> > > > decimal. If you data is >= 0 and <= 1 this will work,
> > > > assuming you only
> > > > need six decimals.
> > > >
> > > > -dhs
> > > >
> > > > At 12:34 PM 9/25/01 +0100, you wrote:
> > > > >I am bulk inserting a file into my database that contains
> > > > the column 'cost'
> > > > >
> > > > >The column has the following values:
> > > > >0.113333
> > > > >0.0105
> > > > >0.02178
> > > > >0.040333
> > > > >0.028022
> > > >
> > > >
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists