Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
Could someone please help me through understand, how to run the sequential SQL queries in Thive Row Component?
For Example:
DROP TABLE IF EXISTS abcd.table1;
CREATE TABLE abcd.table1;
Something like this, which we generally do.
Thanks,
Santosh
Hello ,
Can you try this
"BEGIN
DROP TABLE... ;
CREATE TABLE ;
DROP TABLE ;
CREATE TABLE ;
DROP TABLE ;
CREATE TABLE ; [...]
COMMIT;
END;"
Good luck,
SGV
What the type of you db source ?
You can always hook up either a tForEach or a tFixedFlowInput in front of the tHiveRow, where each value is a separate query then just pass that object (row.column for tFixedFlowInput, or ((String)globalMap.get("tForeach_1_CURRENT_VALUE") for tForEach) into the tHiveRow query block.
@evansdar Nah, not working. Can you share a snapshot of your subjob?
try this.
@evansdar thanks man!
I was doing syntactical errors in tforeach, now it works.
But i think there is a limitation while using tForeach component with tHiverow, i'm not able to pass a string bigger than 130 characters in tForeach as a value. I tried to create a table with more columns, but the value column cannot take more than 130 characters.
Is there any workaround for this?
If storing queries in a flat file is ok, then you can use a tFileInput component along with the tflowtoiterate component as a workaround. Something like this,