Question:Copy from an ASCII file

Question:Copy from an ASCII file

Post by Francesca Colombin » Fri, 02 Aug 1996 04:00:00



In an earlier version of Ingres (was it some version of 5 or 6??) We
copied data in from an ASCII file using the following code:
     COPY TABLE uo_sample(log_no='c0|',
                                                                                                                                                                                                                lab_loc_id='c0|',
                                                                                                                                                                                                                requester='c0|',
                                                                                depth='c0|'
                                                                                                                                                                                                        ,sampled='c0|',
                                                                                                                                                                                                                note='c0|',
                                                                                                                                                                                                                lab='c0|',
                                                                                doc_cntrl_no='c0|',
                                                                                                                                                                                                                matrix='c0')
                                                                                                        FROM 'sample.xfer';
The table is defined as:
                                                                  Key
Column Name                      Type       Length Nulls Defaults Seq
log_no                           c              12   no     yes
loc_id                           c              12   no     yes
sampled                          date               yes    null
norm_year                        integer         2   no     yes
norm_qtr                         integer         1   no     yes
norm_month                       integer         1   no     yes
type                             c               4   no     yes
depth                            float           4   no     yes
project                          c               4   no     yes
footnote                         c               5   no     yes
note                             c             150   no     yes
lab                              c              10   no     yes
requester                        c              20   no     yes
lab_loc_id                       c              30   no     yes
dup_spike                        c              10   no     yes
entered                          date               yes    null
updater                          c               3   no     yes
doc_cntrl_no                     c               6   no     yes
matrix                           c               2   no     yes
time_zone                        c               3   no     yes
validation                       c               1   no     yes
labcode                          c               2   no     yes
last_updated                     date                no     yes
regulator                        c               1   no     yes
wgmgok                           c               1   no     yes

If one of the columns in one of the records of the ASCII file was too
big we would receive the following message:

COPY: Warning: 1 character domains were truncated when copied from the    
file to character type columns in the table. (E_CO0015)

Since it was a warning, the copy would complete with one field in one
column getting truncated data.

Now, in OpenIngres1.1, we recieve this message, and the copy FAILS. We
want the behavior of the first case where we get a warning and the copy
completes with a truncation.

Does anyone know a way around this?

Francesca Colombini
Lawrence Livermore National Laboratory

 
 
 

Question:Copy from an ASCII file

Post by Kevin Carte » Fri, 02 Aug 1996 04:00:00


Are you thinking of with clause, for example:

        with on_error = continue

I think the default behavior is on_error = terminate

 
 
 

1. Problem copying data from ASCII file to SQL 6.5 using BCP

Hi!

 I'm trying to import some names onto a database using BCP.EXE

In my sourcefile I have the following entry (Id, Name):

23;"Groothof, Ren"

By when doing a query on the table via MS Access after the copying I
get the following response:

Groothof, Ren

How come ??? My input-file uses characters in ISO-format, so why this
funny stuff ??? I also have a problem with the German "ss" character
(looking like the Greek beta-sign). Any hints on what to do ???

/Brian

--
Spammers read this: US CODE title 47, chapter 5, sub-chapter 2,
section 227(b)(1)(C), section 227(b)(3)(B) and section 227(b)(3)(C)

2. One more question about convirsion

3. Using BCP to copy data form ASCII file to SQL 2000 table

4. Large (multierabyte) daabases in a datawarehosue environment

5. Copy: How to make ordinary ascii delimited files?

6. Trigger Help...

7. Removing trailing/leading spaces from ASCII copy files

8. repl_publisher: not associated with a trusted SQL Server connection?

9. ASCII, ASCII, ASCII, ASCII

10. Assorted questions about uploading a flat ascii text file ported from an IBM mainframe

11. Binary file to Ascii question

12. ASCII, ASCII, ASCII

13. Converting an ASCII file to .DBF file using VB