Having problems Generating Sequence Number
Moderators: chulett, rschirm, roy
Having problems Generating Sequence Number
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 ..
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Gen SEQ NUMBER
HIray.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. ...
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
Gen SEQ NUMBER
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Gen SEQ NUMBER
db instanceray.wurlod wrote:OK, please show us the properties that you have set within the Surrogate Key Generator stage. ...
db name
db userid
dbpwd
dbserver
source name: schema.sequencenumber
genarateoutputcoloumn
sequence :database seq
thanks
N R REDDY
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Gen SEQ NUMBER
i tried with that value is also and i am getting thr error undefined value like schema.sequencename.NEXTVALray.wurlod wrote:Should the source be schema.sequencename.NEXTVAL ? ...
please advice us..
N R REDDY
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.
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.
Re: Gen SEQ NUMBER
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:raju4u wrote:it should genarate the seq but itsn't....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?
Emphasis mine.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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Gen SEQ NUMBER
HIArndW 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.
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
Gen SEQ NUMBER
sa is output coloumn bame and after this i am mapping this to db2 table same coloumn.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? ...
thanks,
N R REDDY