Loading Sequential File into Sybase

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

Loading Sequential File into Sybase

Post by palmeal »

What is the best way to load a sequential file into an existing table on Sybase. The sequential file was created from the output of a transformer stage and looks as I would expect it to.
I have tried the following and can't get any of them to work :-

joining a SEQ File -> SYBASE_OC
joining a Hashed File -> SYBASE_OC
joining a Transformer ->SYBASE_OC

I have been able to join SYBASE_OC -> SYBASE_OC but this doesn't help me with what I am trying to do.

I'm sure this will be a simple answer :-)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

All of these base methods work. You must be doing something (different) wrong in each case. What sort of error message are you receiving? Joining a source to target without intervening transformer stage(s) means you already have the correct column names, formats and contents for inserting into Sybase, right?

Please post the error you are getting from the simplest, the sequential, variatn and I'm sure you'll get a speedy explanation from one or more people in this forum.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
it wouldn't hurt us knowing what Sybase is in question
what OSs are involved, you knwo all the little obvious things to you but a miss to us.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

Post by palmeal »

Sorry I haven't replied - got called away and then straight into the Easter holidays.

I am using Sybase 12.5 - resident on Windows 2000 servers. The DataStage server is on UNIX with the clients on Windows XP.

The flow of the job is

SYBASE_OC -> SEQ File -> Transform -> SEQ File -> Transform -> SEQ File -> SYBASE_OC.

The part that is failing is the very last stage.

On the SEQ File Output tab I have defined the filename and columns to be output - if I hit View Data then I see the file (consists of a numeric(9), varchar(128) and char(12)).

On the SYBASE_OC I have set up the DSN info and on the Input tab added in the table to input data into which brings up the columns required by default. These do match the columns that are in the file to be loaded.
I have chosen to insert the data without clearing. The user in question does have access rights to the table where the insert is to be carried out.

The one part that does look stange and problematic is if I select the SQL tab then the following code appears :-

INSERT INTO spectrum.dbo.t_ptfo_extract_time_perd (series_id,str_typ_1,ptfo_cd) VALUES (?,?,?);

I guess the problem I'm having is how the question marks in the statement get replaced with the data in the file. Hopefully there is a simple answer for this.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
The one part that does look stange and problematic is if I select the SQL tab then the following code appears :-

INSERT INTO spectrum.dbo.t_ptfo_extract_time_perd (series_id,str_typ_1,ptfo_cd) VALUES (?,?,?);

this insert looks fine the question marks are place holders for run time values of the actual columns in each row (in Oracle its :1,:2,:3,... in Sybase its question marks).
what do you mean ? hit the view on the stage or paste this to a isql editor and try to run it? (the later won't work naturaly).

having access rights doesn't mean you have write privilages.
please post the exact error/s you get in the director when running this job so we can try to help.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
palmeal
Participant
Posts: 122
Joined: Thu Oct 14, 2004 7:56 am
Location: Edinburgh, Scotland

Post by palmeal »

thanks Roy - I've now resolved the problem. The file that I was trying to load into the Sybase table had quote's around the char fields. Removing these has sorted the problem.

Thanks for the help - pointing me towards Director certainly helped - lesson learned :)
Post Reply