dbTalk Databases Forums  

Re: [Info-Ingres] Copying to flat file causingerrorthroughIngresGateway.

comp.databases.ingres comp.databases.ingres


Discuss Re: [Info-Ingres] Copying to flat file causingerrorthroughIngresGateway. in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paul White
 
Posts: n/a

Default Re: [Info-Ingres] Copying to flat file causingerrorthroughIngresGateway. - 01-07-2009 , 05:13 PM






Hi Joan,

I've just run a quick test on EA/MSSQL R2.6 and found the same problem as
yourself.
Then I found some of my notes from 2004 which says character copy is not
supported through the gateway.

However binary copy is supported. I used binary copy to unload ingres data
from Solaris then reload to MSSQL 2000.
the only gotcha was in the mapping of money fields. We had to multiply all
money values by *.01 after the import.
I cant remember if Oracle has the same gotcha.

If you are doing this from OpenROAD I suspect you'll have to do it the hard
way, cursor string object, line by line. etc.

Paul


-----Original Message-----
From: info-ingres-bounces (AT) kettleriver...ting (DOT) com
[mailto:info-ingres-bounces (AT) kettleriverconsulting (DOT) com]On Behalf Of Graham
Jakins
Sent: Thursday, 8 January 2009 8:19 AM
To: Ingres and related product discussion forum
Subject: Re: [Info-Ingres] Copying to flat file causing
errorthroughIngresGateway.


Hi Joan/Marty,



Was wondering if the invalid target expression comes because the file is
specified as 'C:/ ral_new_staff.txt'.



I am sure that this should be a "\" on Windows not a "/" - i.e.'C:\
ral_new_staff.txt'



Regards



Graham Jakins

Team Leader Database Engineering



tel: 08 9340 5234

fax: 08 9340 5111

mbl: 0408 956 864




----------------------------------------------------------------------------
--

From: info-ingres-bounces (AT) kettleriver...ting (DOT) com
[mailto:info-ingres-bounces (AT) kettleriverconsulting (DOT) com] On Behalf Of Martin
Bowes
Sent: Thursday, 8 January 2009 5:51 AM
To: Ingres and related product discussion forum
Subject: Re: [Info-Ingres] Copying to flat file causing error
throughIngresGateway.



Hi Joan,



Yes this is exactly the right newsgroup to post Ingres questions to.



Try replacing all but the last 'c0NL' with 'c0tab'. The last 'c0NL' should
be 'c0nl'.



Note that this produces an ascii file. You need to be careful of dates and
floats with such files. Looking at the column names I'd guess you have many
dates in this data and probably no floats. Check the data in the file to
ensure you have 4 character years.



The command you've given to load the data uses a binary file not an ascii
file...ie they are incompatible.

If the download works without error then alter the copy for the upload to
read:

copy table ral_new_staff(

pid=c0tab,

dlpid=c0tab,

...etc...

) from 'C:ral_new_staff.txt';





Martin Bowes




----------------------------------------------------------------------------
--

From: info-ingres-bounces (AT) kettleriver...ting (DOT) com on behalf of Berry, J
(Joan)
Sent: Wed 07/01/2009 16:52
To: info-ingres (AT) kettleriverconsulting (DOT) com
Subject: [Info-Ingres] Copying to flat file causing error through
IngresGateway.

Dear All,



I wonder if anyone could shine some light on my problem. I have a table
in Oracle (10g) that I am copying out to a flat file. I have tried a bulk
copy which runs successfully through the gateway (EA 2.6/0605 (int.w32/00))
on windows 2003 server, however when I run the same command with the
following syntax :-



COPY table ral_new_staff (

pid = c0NL,

dlpid = c0NL,

pwaid = c0NL,

title = c0NL,

initials = c0NL,

forename = c0NL,

surname = c0NL,

date_of_birth = c0NL,

sex = c0NL,

laboratory = c0NL,

org_unit = c0NL,

structure = c0NL,

band = c0NL,

pay_no = c0NL,

bu_id = c0NL,

bu_name = c0NL,

start_date = c0NL,

end_date = c0NL,

federal_id = c0NL,

status = c0NL,

time_imported = c0NL,

advertised_email_address = c0NL

) into'c:/ral_new_staff.txt';



I get the following error.



E_GX0204 Syntax Error: Found a keyword or token other than that which was

expected



COPY: Invalid target expressions

(Wed Jan 07 16:29:45 2009)



If I run the copy into command on the Ingres database (II 2.6/0604
(int.w32/0000) on windows server 2003 I get the following message



1> copy table ral_new_staff()

from 'C:\schedules\FinanceProjectOwners\data\ral_new_st aff.txt'



E_CO0024 COPY: Unexpected END OF FILE while processing row 1.



E_CO002A COPY: Copy has been aborted.



Can anyone help? Am I one the right mailing list?



Joan.





__________________________________________________ ____________







Joan Berry - Administrative Database Team Leader

STFC - Science & Technology Facilities Council,
Corporate Information and Communications Technology,
Business Technology Unit, S10, Daresbury Laboratory,

Daresbury, Warrington, Cheshire, WA4 4AD.



Telephone : +44 (0) 1925 60(3412) , Mobile: 07920 703440

E-Mail : joan.berry (AT) stfc (DOT) ac.uk dmthelpdesk (AT) rl (DOT) ac.uk

Internal ADT Web: http://database7a.dl.ac.uk/ADTWeb/index.html

-------------------__________________________________________________ _____
_______






This message contains confidential information and is intended only for
the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. E-mail transmission cannot be guaranteed to be
secure or error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message, which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version.


Reply With Quote
  #2  
Old   
Paul White
 
Posts: n/a

Default Re: [Info-Ingres] Copying to flat file causingerrorthroughIngresGateway. - 01-07-2009 , 05:23 PM






And I just found this in the manual.
No mention of character copy format here.


Enterprise Access Developing Portable Applications Guide
pp 3-27

Copy Table Support
The gateway supports the binary forms of copy into and copy from. These
commands allow a fast and efficient way of loading and unloading data from
the database through the gateway:

copy table table_name() into 'file_name'

This command copies table data from a gateway table or view and unloads it
into the specified file. This file can be used later in the copy from
command
to load the data into another gateway or an Ingres database.
All data transformations are handled by the gateway. The generated file can
only be used on the client platform. Ingres/Net is used to handle any
platform or architecture differences.
copy table table_name() from 'file_name'
This command copies table data from the specified file and loads it into a
gateway table or view. This file was created in the copy into command
issued against another gateway or an Ingres database.
All data transformations are handled by the gateway. Likewise, the file
generated can only be used on the client platform. Ingres/Net is used to
handle any platform or architecture differences.
The copy table command requires that the original and target tables have
identical characteristics. No coercion between data types is performed by
the
gateway. The original and target attributes must also have identical
nullability characteristics.








Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.