One Star

Running RUNSTAT command from tDB2Row component

Hello,
I am trying to run a simple RUNSTAT command from Talend Studio using a Simple Query 
"RUNSTATS ON TABLE ABC.TABLE1 use profile"
I am getting the following error,
DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=USE;TABLE1;JOIN <joined_table>, DRIVER=3.63.75
Can you please help to find how to run the same?
5 REPLIES
Seventeen Stars

Re: Running RUNSTAT command from tDB2Row component

You can use the RUNSTATS command without enclosing it only in the DB2 client. From an SQL interface you have to use a stored procedure:
CALL SYSPROC.ADMIN_CMD( 'RUNSTATS ON TABLE ABC.TABLE1 use profile' )

Use this SQL statement in the tDB2Row.
One Star

Re: Running RUNSTAT command from tDB2Row component

Same error when I pasted the same command 
CALL SYSPROC.ADMIN_CMD( 'RUNSTATS ON TABLE ABC.TABLE1 use profile' )

In the tDB2Row component.
Even I tried with Truncate table command. Getting the same issue there as well.
Seventeen Stars

Re: Running RUNSTAT command from tDB2Row component

Sorry to hear but I am absolutely sure this works because I do this very often. Please post a screenshot of the basic settings of the tDB2Row component and also the error message you get. It is simply impossible to get the same error message running this command and running a truncate command. Perhaps you overlook something here.
One Star

Re: Running RUNSTAT command from tDB2Row component

Hello jlolling,
I am able to run RUNSTAT now Getting issue with TRUNCATE TABLE Statement. Do you know how I can truncate a table in tdb2row component?
One Star

Re: Running RUNSTAT command from tDB2Row component

Hi Ayan,
Were you able to run truncate table with tDB2Row? how did you do it?
Thanks