Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a CHAR(6) Account ID field that I am populating via a tDBRow component. At the end of my process, I want to see the output of the field via a tLogRow component. However, I am only getting the first character in that field, i.e. if I have Acct 123456, it displays 1 as output and leaves out the rest. Any idea on where my mistake is?
You brought up a good point. It seems as though the data type was the issue. I changed it to String in the schema and synced up the columns and I got all the value now instead of only the first character. Thanks for your continued help, it's nice to see an active forum that helps.
Hello,
Have you ever defined field length for your column in schema setting?
Best regards
Sabrina
Yes, I have set the length in schema and synced it across the job. No matter how long I put the field length, I always get the first character only.
tDBRow_6 = creates volatile table in teradata
"CREATE VOLATILE TABLE ACCTS
(
ACCT_ID CHAR(6)
,EFF_DT DATE
,FROM_DT DATE
,THRU_DT DATE
)
UNIQUE PRIMARY INDEX (ACCT_ID) ON COMMIT PRESERVE ROWS"
tDBRow_2 = inserts records in volatile table
"BEGIN TRANSACTION;
INSERT INTO ACCTS (ACCT_ID, EFF_DT) VALUES ('203544', '2018-10-01');
INSERT INTO ACCTS (ACCT_ID, EFF_DT) VALUES ('325412', '2018-10-01');
UPDATE ACCTS SET FROM_DT = EFF_DT - interval '19' month, THRU_DT = EFF_DT - interval '5' month;
END TRANSACTION;"
Attached is the schema, job layout and the output from tLogRow_1.
Just curious, shouldn't be your tDBCommit_6 be after your tDBRow_2.
Also, how does your tLogRow_1 schema looks have you synced the columns correctly.
You'd think right? But I have tried to put the commit after tDBRow_2 but Teradata gives me an error that says:
[Teradata Database] [TeraJDBC 16.20.00.06] [Error 3932] [SQLState 25000] Only an ET or null statement is legal after a DDL Statement.Exception in component tDBInput_1 (test)
Only after putting a commit after the table creation and then inserting values did it work.
I did sync the scheme in tLogRow_1, attached is the screenshot.
You brought up a good point. It seems as though the data type was the issue. I changed it to String in the schema and synced up the columns and I got all the value now instead of only the first character. Thanks for your continued help, it's nice to see an active forum that helps.