Create VIEW in Datastage

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
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Create VIEW in Datastage

Post by ds2000 »

How can a VIEW be created in datastage ? I created a view in db and then tried to INSERT data into it using db2 api stage but datastage id was not allowed for insert in a view. Is it right way to do it.

VIEW SQL:
----------------
Create VIEW as MYVIEW
COL1, COL2
From TBL
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's not an updateable view so no-one is allowed to insert records into it, not just DataStage. Have a chat with your DB2 DBA to see what you'd need to do to accomplish that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did the CREATE VIEW statement complete successfully?

Usually a CREATE VIEW statement includes a SELECT clause.

Read the DB2 documentation about how to create updatable views.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

It was typo, I missed it in the message. Just wanted to know if its the right approach that first create a view and then LOAD it with datastage job from different extracts ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's an unusual approach, but it's not wrong per se provided you create an updatable view - which implies that there are already extant tables (on which the view is based) that can actually store the data you push into the view.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, it is unusual as you would typically load the base tables directly. Why the perceived need to target a view? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply