Re: Problem With Foreign Data Wrapper

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem With Foreign Data Wrapper

John Sichi
Administrator
Maybe you have an old .bcp file in the same directory and it's missing
a definition for the last field?

JVS

On Thu, Mar 10, 2011 at 1:58 PM, Jeremy Lemaire <[hidden email]> wrote:

> In a new implementation of an existing system I am suddenly seeing problems
> when trying to import csv data via a flat file wrapper.  Although the data
> looks fine in the csv file, a select on the following foreign table appears
> to be having problems with row delimiters.
>
> Schema Setup
>
> create server imp_file_link
> foreign data wrapper sys_file_wrapper
> options (
> directory '/home/lucid/luciddb/import',
> file_extension 'csv',
> with_header 'NO',
> log_directory 'trace/',
> field_delimiter ',',
> timestamp_format 'yyyy-MM-dd HH:mm:ss' );
>
> create foreign table aws_imp."impression_parameter_set" (
> parameter_set_key varchar(32),
> age varchar(16),
> gender varchar(16),
> "LANGUAGE" varchar(16),
> phone_type varchar(16),
> carrier varchar(16),
> country varchar(16),
> zipcode varchar(16),
> areacode varchar(16),
> dma varchar(16),
> income varchar(16),
> genre varchar(16),
> state varchar(16),
> destination varchar(16)
> ) server imp_file_link;
>
>
> Source CSV Data
>
> 00D0F99290EA147DC854F43BE719C761,unknown,unknown,SPANISH,2,T-MOBILE,US/Eastern,UNITED
> STATES,07601,201,NYC,unknown,unknown,NJ,502
> 00D122AC18B3A8E6C7B1A24FA171A798,unknown,unknown,SPANISH,2,BOOST,US/Eastern,UNITED
> STATES,10128,646,NYC,unknown,unknown,NY,unknown
> 00D12A51856E9AEDB4B105F5ACD63D69,unknown,unknown,SPANISH,2,OTHER,US/Mountain,UNITED
> STATES,unknown,224,CHICAGO,unknown,unknown,unknown,52
> 00D12CDF15E80B15A338299B6D33E3DA,unknown,unknown,SPANISH,2,VERIZON,US/Arizona,UNITED
> STATES,86325,928,PHOENIX,unknown,unknown,AZ,unknown
> 00D1B50618C680FDC73B22366EE89D82,unknown,unknown,ENGLISH,2,T-MOBILE,US/Eastern,UNITED
> STATES,34744,407,ORLANDO,unknown,unknown,FL,unknown
>
>
> SELECT Result On the Same Lines
>
> '00D0F99290EA147DC854F43BE719C761','unknown','unknown','SPANISH','2','T-MOBILE','US/Eastern','UNITED
> STATES','07601','201','NYC','unknown','unknown','NJ'
> '00D122AC18B3A8E6C7B1A24FA171A798','unknown','unknown','SPANISH','2','BOOST','US/Eastern','UNITED
> STATES','10128','646','NYC','unknown','unknown','NY'
> 'nknown','','','','','','','','','','','','',''
> '00D12A51856E9AEDB4B105F5ACD63D69','unknown','unknown','SPANISH','2','OTHER','US/Mountain','UNITED
> STATES','unknown','224','CHICAGO','unknown','unknown','unknown'
> '00D12CDF15E80B15A338299B6D33E3DA','unknown','unknown','SPANISH','2','VERIZON','US/Arizona','UNITED
> STATES','86325','928','PHOENIX','unknown','unknown','AZ'
>
>
>
>
> --
> View this message in context: http://luciddb-users.1374590.n2.nabble.com/Problem-With-Foreign-Data-Wrapper-tp6159515p6159515.html
> Sent from the luciddb-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> luciddb-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/luciddb-users
>

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
luciddb-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luciddb-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem With Foreign Data Wrapper

Jeremy Lemaire
There is no .bcp file in this case but shortly after posting this question I tracked down an extra timezone field in my source CSV file from an error found in the Trace.log file.  

SEVERE: Could not process input:
[00000AE2F901F2D0CEB2BF48F5DB1EDD,unknown,unknown,SPANISH,1,unknown,US/Central,UNITED STATES,50309,515,DES MOINES,unknown,unknown,IA,503]
Messages: Row has too many columns

I attempted to remove this post but you are obviously far too efficient with your responses ;-)

 
Loading...