Page 1 of 3

Surrogate Key using sequence ?

Posted: Fri Jan 19, 2007 1:13 pm
by swades
Hi,
I am Really stuck please help me..
I have job which generates surrogate key using Surrogate_key_gent_stage, I want to maintain surrogate key in multiple run, I search in forum I found that I can do with Sequence BUT can anyone please tell me how to retrive Last_run_max_value of surrogate key in sequence please help.

Posted: Fri Jan 19, 2007 1:37 pm
by DSguru2B
Parametrize the start value and provide the start value during run time. You can store the last generated key in a file. During run time, the contents of that file can be passed to the job parameter.

Posted: Fri Jan 19, 2007 7:08 pm
by swades
During run time, the contents of that file can be passed to the job parameter.
Can you please tell me how to do this ? I have read this..in other forums But I want to know how ? please let me know..

Posted: Fri Jan 19, 2007 7:29 pm
by DSguru2B
Well, write your max value a sequential file. Build a sequence job which has two an command activity stage. Pass the command

Code: Select all

type your/fully/qualified/filename
Have a link coming out of command activity stage to a job activity where your calling your job that generates the keys. Open the job activitie's poperties, in the expression for the job parameter, double click, right click, choose execute_activity.$Return_Value.
Thats one way, i am sure there are other ways. Atleast this will get you started.

Posted: Sat Jan 20, 2007 5:38 pm
by swades
I did that and sequence is running fine. BUT output of command is giving me wrong value what can be reason ?

In command_line, I am passing path of my .txt file which contain only single digit and that digit I am passing as parameter of next job_activity..BUT output of this activity is giving me wrong value of that parameter...so please what can be the reason or Is that I am doing something wrong ?

Posted: Sat Jan 20, 2007 6:00 pm
by DSguru2B
Did i say $Return_value. SOrry, you need to pick $Command_Output.

Posted: Sat Jan 20, 2007 7:35 pm
by swades
Thanks for the Replay.

When I am using Execu_command.$Command_Output as value, then the Sequence gets aborted...what can be reason ?

Posted: Sat Jan 20, 2007 9:17 pm
by DSguru2B
What does the log say?

Posted: Sat Jan 20, 2007 10:30 pm
by chulett
For anyone playing along from the home audience, there's no underscore in any of these trigger values. It shouldn't even compile like that, so I'm sure everyone is using them properly but typing them incorrectly here.

We now return you to your regularly scheduled problem.

ps. swades - you need to tell us what the reason was, only then can we help.

Posted: Sat Jan 20, 2007 11:59 pm
by DSguru2B
Thanks for the clarification Craig. I couldnt remember the exact options off of my head as i havent used that option in ages. :)
I hope the OP is actually choosing those options from the drop down rather than typing it, which he probably is as the job ran and aborted.

Posted: Sun Jan 21, 2007 12:00 am
by swades
What does the log say?
is:
Message:
k_ren..JobControl (@Execute_Command_2): Executed: /demo/...../filename.txt
Reply=320
Output from command ====>
SH: /demo/....../filename.txt: 0403-006 Execute permission denied.

AND
Message:
k_ren..JobControl (@Execute_Command_2): Command /demo/......../filename.txt did not finish OK,
reply = '320'

We now return you to your regularly scheduled problem
I am sorry this is not scheduled problem

Posted: Sun Jan 21, 2007 12:07 am
by chulett
You were supposed to 'type' the file, not try to execute it.

Posted: Sun Jan 21, 2007 12:08 am
by DSguru2B
Did you put 'type' before the file's fully qualified name? Does'nt look like it. Put type before your file name.

Posted: Sun Jan 21, 2007 12:12 am
by DSguru2B
chulett wrote:You were supposed to 'type' the file, not try to execute it.
Beat me to it :wink:

Posted: Sun Jan 21, 2007 12:12 am
by I_Server_Whale
swades wrote:
We now return you to your regularly scheduled problem
I am sorry this is not scheduled problem
:? I don't think you got what Craig meant in that sentence. First, a general announcement was made about the trigger values and then the audience were directed to regular flow of solving the problem. :wink:

Craig! Correct me if I botched up.