DB2 API stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
suryadev
Premium Member
Premium Member
Posts: 211
Joined: Sun Jul 11, 2010 7:39 pm

DB2 API stage

Post by suryadev »

I am using db2 API stage to load data into the tables.

the data has to be loaded into table which has 3 fields and everytime the job runs the data has to be cleared and loaded like truncate and load.


I never used this stage to connect to the DB earlier.

please help me with the following tabs present in the stage.

1)query type in general tab
2)update action in general tab
3) query type in SQL tab
4) update action in SQL tab
5)in the options tab do I need to import the metadata of the table or just the table name.
Thanks,
Surya
suryadev
Premium Member
Premium Member
Posts: 211
Joined: Sun Jul 11, 2010 7:39 pm

Post by suryadev »

In the two properties query type and update action I used

querytype:-generate update action from option and column tabs

update action:-insert rows without clearing

and I see that 3 rows pass through them but they are not loaded in the table.

The file from which I read the data has 3 fields and the table has 5 fields

the rest 2 fields are update_time and update_userid
Do I need to generate them or when I load the data they generate automatically?

please let me know!!
Thanks,
Surya
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Change the update action so that the table IS cleared, if that's what you need.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suryadev
Premium Member
Premium Member
Posts: 211
Joined: Sun Jul 11, 2010 7:39 pm

Post by suryadev »

some of the tables need to be truncated and some of them appended.

If I am not wrong I would assume the query type would be the same but the update action would change based on the requirement i.e

truncated:-the update action would be clear table then insert rows
Appended-the update action would be insert rows without clearing


loaded the fields into the table but when I select the fields and view them
All the fields have some empty spaces and they are filled with special boxes(square)

Is there any way to remove them?
Thanks,
Surya
suryadev
Premium Member
Premium Member
Posts: 211
Joined: Sun Jul 11, 2010 7:39 pm

Post by suryadev »

Actually I see that when I change the datatype from char to varchar I can get rid of these square boxes.

Is there any other way to get rid of these special characters other than changing the datatype.


another issue which arises when the data is loaded is the special characters like
registered R and trademark TM cannot be loaded and in the field where there are special characters like these I see a msg like (err) in the field.

please provide a solution
Thanks,
Surya
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post by nitkuar »

Is there any other way to get rid of these special characters other than changing the datatype
Change $APT_PAD_CHAR value to 0x20 instead of default value 0x00 as job parameter
suryadev
Premium Member
Premium Member
Posts: 211
Joined: Sun Jul 11, 2010 7:39 pm

Post by suryadev »

Thanks for the information.
Used the environment variable and got rid of these special boxes.


Is there any other environment variable to load these chars like trademark and registered like ™ and ® ?

The file from which I am reading these characters have these special characters but they cannot be loaded as posted earlier they are loaded as (err).
Thanks,
Surya
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post by nitkuar »

not sure about this one, but I guess its related to NLS setting of your DB2 database.
suryadev
Premium Member
Premium Member
Posts: 211
Joined: Sun Jul 11, 2010 7:39 pm

Post by suryadev »

Thanks,

So is it something I need to discuss with my DB admin?
Thanks,
Surya
Post Reply