Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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?
Labels (4)
5 Replies
Anonymous
Not applicable
Author

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.
_AnonymousUser
Specialist III
Specialist III

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.
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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?
Anonymous
Not applicable
Author

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