Friday, April 5, 2019

How to create CSV output from NetSuite ODBC using SQL

CSV output can be generated using SQL via NetSuite ODBC interface.
To do this the output needs to be in one field only. Therefore fields need to be concatenated. For longer fields use combination of "concat" function and "+" operator.


select concat('','"' + category_0 + '","' + companyname + '","' + full_name + '", "' + email + '"') as data from customers;


"CUSTOMER","Netsuite","Homer Simpson", """CUSTOMER","Limited L.t.d","Rene Mrkvon", """CUSTOMER","Bankert Bank","Bankert Bank", """PROSPECT","Speedy Delivery Service","Speedy Delivery Service", """CUSTOMER","Cara Systems","Cara Systems", ""

No comments:

Post a Comment