Copy.in/out prefixes

 wrote in article
> Someone is sending me a file which is a copy of a table.
> The file export is made with copydb and this gives me a
> file where columns is tab-separated and end-of-record mark is newline.
> The problem is that this table contains varchar(x) columns with both tab
> and newline characters inside. Another problem is that the varchar(x) data
> is prefixed with number of character following.
> 
> I want a file where either
> * tab and newline characters inside varchar(x) is replaced with some other
>   obscure characters, or
> * column and end-of-record character is replaced with other characters
>   not used in file.
> 
> In both situation, I want to get rid of the number of character prefix.
> 
> Does anybody have a solution here?
> 
> -Bird


COPY.OUT
The following might be helpful.
Try copying out each field as charater field instead of varchar, this way
you don't get the number of character prefix. Also use a field delimiter
which is highly unlikely to be in data being copied out(ie ! ~ % etc). The
best way to determine this is to run queries over table fields that are
likely to offend be4 copying.

Example :
copy code(
	code= c(0)'~',
	codedetail= c(0)'~',
	printer= c(0)nl
	)
into 'code.dba'
\p\g


COPY.IN
Assumming table already exists in destination database, copy.in should look
like the example below 

Example:
copy code(
	code= c(0)~,
	codedetail= c(0)~,
	printer= c(0)nl
	)
from 'code.dba'
\p\g

Hope this answers your query.
Ingres Q & A
Back to William's Home Page

© William Yuan 2000

Email William