Topic Data Types and Data Length

Beverly started the topic:
2017-12-12 21:27

Data Types and Data Length

Getting Data from CLOUD (VARCHAR2 255) - don't know datatype or length. Suggested by Quadient help to use JavaScript. I don't know Java. Can you help me figure out this screen? I want to capture length and write to a documentation type Oracle table. Also data type would be GREAT also but seeing from other comments...can't.
Beverly replied:
2017-12-12 21:30
Suggested I put values[0].length; Return type: NUMBER. Errors off - says Cannot read property length from null.
Arjan replied:
2017-12-13 08:21
The most probable reason that it gives this error message is that the column contains a null value. You can remedy this by adding a "Convert to string" transformer where you fill in a default value in the optional "Null replacement" field and then use the output column of that transformer as input column for the JavaScript transformer.

Regards,
Arjan Seijkens
Beverly replied:
2017-12-13 21:10
It gave me length of column on each row. I need to know max length for a column on the table. What I get if I run String Analyzer but I need to capture that max length to write to a table.

Beverly replied:
2017-12-13 21:35
So if Name, address, city, state, zip on a table all defined as VARCHAR 255 from CLOUD...I need to find out that name's max is 35, and address is 40, and city is 25, and state is 2 and zip is 9, DOB is 16. So on the output table there would be 6 rows.
TABLE_NAME = PERSONAL, COLUMN_NAME = NAME, DATA_TYPE = CHAR, DATA_LENGTH is 35
TABLE_NAME = PERSONAL, COLUMN_NAME = ADDRESS, DATA_TYPE = CHAR, DATA_LENGTH is 40
TABLE_NAME = PERSONAL, COLUMN_NAME = CITY, DATA_TYPE = CHAR, DATA_LENGTH is 25
...
TABLE_NAME = PERSONAL, COLUMN_NAME = DOB, DATA_TYPE = TIMESTAMP, DATA_LENGTH IS 16
You are not signed in.
You need to be signed in to participate in the discussion.