Calling Stored procedure DRS Stage SQL Before tab
Moderators: chulett, rschirm, roy
Calling Stored procedure DRS Stage SQL Before tab
I am trying to call a oracle stored proc say
TRUNC_MYTABLE(tablename varchar in, msg varchar out)
I want to execute this proc before loading data via DRS stage, hence am using the SQL > Before tab.
After going through the posts I tried various combinations of the following in the DRS Stage > SQL > Before Tab:
=======================================
CALL myschema.TRUNC_MYTABLE('MYTABLENAME',variable vmsg varchar(22))
[gives error > ORA-00907: missing right parenthesis]
=======================================
variable vmsg varchar(22);
CALL myschema.TRUNC_MYTABLE('MYTABLENAME',:vmsg);
[gives error > Incorrect sql statement variable vmsg varchar(22);]
Any suggestions?
TRUNC_MYTABLE(tablename varchar in, msg varchar out)
I want to execute this proc before loading data via DRS stage, hence am using the SQL > Before tab.
After going through the posts I tried various combinations of the following in the DRS Stage > SQL > Before Tab:
=======================================
CALL myschema.TRUNC_MYTABLE('MYTABLENAME',variable vmsg varchar(22))
[gives error > ORA-00907: missing right parenthesis]
=======================================
variable vmsg varchar(22);
CALL myschema.TRUNC_MYTABLE('MYTABLENAME',:vmsg);
[gives error > Incorrect sql statement variable vmsg varchar(22);]
Any suggestions?
If my design is as follows:DSguru2B wrote:I highly doubt you can get a OUT parameter from the before/after sql tab. For that you need to run it via STP stage. ...
[Transformer] > [DRS Stage]
Where do i put in the [STP] stage such that it is invoked once before the data is laoded via the DRS stage? I do not see any Before Stage option in DRS Stage.
I can think of a few options:
1. Create a shell script which invokes the stored proc and execute it as a Before Job sub routine.
2. Create a separate job which has a Stored Proc stage and run this job before the data load job.
(The stored proc truncates a given table and returns a success/eror message)
Any other options possible?
1. Create a shell script which invokes the stored proc and execute it as a Before Job sub routine.
2. Create a separate job which has a Stored Proc stage and run this job before the data load job.
(The stored proc truncates a given table and returns a success/eror message)
Any other options possible?
Thanks Narasihma. I tried to do this(see my first post), but was not able to, it kept on throwing errors. Any idea whats wrong?narasimha wrote:If you are not very keen in capturing the success/error message.
You can put the truncate stagement directly in the before tab of the DRS stage.
I also tried:
CALL myschema.TRUNC_MYTABLE('MYTABLENAME')
Oracle Error> Incorrect number or type of arguments.
Is it the case that if a procedure has a OUT parameter, we cant call it through the Before SQL tab, even if we don't intend to use that OUT return value?
I was talking in terms of executing the truncate statement directly in the before tab of the DRS stage, rather an wrapping it into a procedure. If you are ok with it, enter it directly. You can also parameterize the table name.
Code: Select all
truncate table <TABLE_NAME>
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
The reason one typically uses a 'sproc' for that is because the user doesn't have the permissions needed, so I would guess that isn't an option.
And AFAIK you cannot call one before/after that has OUT parameters. Makes sense as there's no place for them to go, but not positive. For grins, have you tried?
CALL myschema.TRUNC_MYTABLE('MYTABLENAME','')
And AFAIK you cannot call one before/after that has OUT parameters. Makes sense as there's no place for them to go, but not positive. For grins, have you tried?
CALL myschema.TRUNC_MYTABLE('MYTABLENAME','')
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers