Having problems Generating Sequence Number

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

raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Having problems Generating Sequence Number

Post by raju4u »

Hi,

Datastage V 8.1

I am trying to generate the sequence number by using database sequence in surrogate key generator. We have given all the details like database name, instance name, id and password.

The sequence is not generating it is giving zero or 0.

The database value is incrementing but it is not passing to datastage.

what might be the problem?

help me ..
N R REDDY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please show the SQL you are using to insert the row, and indicate how many columns there are in your job design being sent to the database.
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 »

Isn't one of the requirements to doing that that the stage must actually be used to create the sequence? If true, was that in fact done? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Gen SEQ NUMBER

Post by raju4u »

ray.wurlod wrote:Please show the SQL you are using to insert the row, and indicate how many columns there are in your job design being sent to the database. ...
HI

We are able to insert through insert statement in the db2. But we are generating the sequence through surrogate key genarator where the increment value is not comming. It is coming in as '0'.

from Surrogate Key Generator we are mapping that sequence generation number to db2 column.

there are 3 columns.
thanks..
N R REDDY
raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Gen SEQ NUMBER

Post by raju4u »

chulett wrote:Isn't one of the requirements to doing that that the stage must actually be used to create the sequence? If true, was that in fact done? :?

it should genarate the seq but itsn't....

thanks..
N R REDDY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

OK, please show us the properties that you have set within the Surrogate Key Generator stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Gen SEQ NUMBER

Post by raju4u »

ray.wurlod wrote:OK, please show us the properties that you have set within the Surrogate Key Generator stage. ...
db instance
db name
db userid
dbpwd
dbserver
source name: schema.sequencenumber
genarateoutputcoloumn
sequence :database seq


thanks
N R REDDY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Should the source be schema.sequencename.NEXTVAL ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Gen SEQ NUMBER

Post by raju4u »

ray.wurlod wrote:Should the source be schema.sequencename.NEXTVAL ? ...
i tried with that value is also and i am getting thr error undefined value like schema.sequencename.NEXTVAL

please advice us..
N R REDDY
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Let us simplify the problem and take the output out of the equation. Create a simple job with a row generator going to your surrogate key generator and then outputting the generated key to a PEEK stage.

Does this test job work? Does your sequence (as defined in "source name") exist in the database? If you have any messages or warnings or errors please cut-and-paste them to the thread.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Gen SEQ NUMBER

Post by chulett »

raju4u wrote:
chulett wrote:Isn't one of the requirements to doing that that the stage must actually be used to create the sequence? If true, was that in fact done? :?
it should genarate the seq but itsn't....
Regardless of what you think it should or should not do, this is what I was referring to and asking if you had done - from the docs:
Creating the key source

You can create the surrogate key source by adding a Surrogate Key Generator stage to a job by itself, with no input or output links. You must create a key source before you can use it in a job. The key source can be a state file or a database sequence.

If you are using a database sequence, the sequence must be created by the Surrogate Key stage. You cannot use a sequence previously created outside of DataStage.
Emphasis mine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Gen SEQ NUMBER

Post by raju4u »

ArndW wrote:Let us simplify the problem and take the output out of the equation. Create a simple job with a row generator going to your surrogate key generator and then outputting the generated key to a PEEK stage.

Does this test job work? Does your sequence (as defined in "source name") exist in the database? If you have any messages or warnings or errors please cut-and-paste them to the thread.
HI

we have done the debugging with peek stage,but we are getting the warning "When checking operator: When binding output interface field "sa" to field "sa": Implicit conversion from source type "uint64" to result type "int16": Possible range limitation."

we tried with all possible datatypes ...


help us regarding this...

thanks
N R REDDY
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

"sa" is your surrogate? Regardless, it is warning you that your target won't be able to hold all possible generated values. So, what is your target for this?
-craig

"You can never have too many knives" -- Logan Nine Fingers
raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Gen SEQ NUMBER

Post by raju4u »

chulett wrote:"sa" is your surrogate? Regardless, it is warning you that your target won't be able to hold all possible generated values. So, what is your target for this? ...
sa is output coloumn bame and after this i am mapping this to db2 table same coloumn.

thanks,
N R REDDY
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Data types? Precision?
-craig

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