Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.CSV_COUNT() UDF returns a count of the number of CSV columns it detects in the CSV data.
UDF | Return Type | Description |
CSV_COUNT | integer | A count of the number of CSV columns that are detected in the CSV file. |
iQuery.csv_count( data )
The data parameter identifies the name of the result set buffer that contains the raw CSV data. This parameter must be DATA; the value returned by the iQuery.CSV() UDTF. Any other value will cause unpredictable results to occur.
Example
select csv_val(data,'custno'), csv_date(data, 'order date'), csv_count(data)
from iQuery.csv('/home/pickles/customers.csv');