|
I am sorry if this has been already answered somewhere but I have been searching for 1 1/2 days and I am on a deadline. I have a query that I want to output like the following... "123456","4444","This is the issue, sorry.","This is it---once again." I can get the comma but I cannot get the double quotes around every field. Please help...thanks Rob.
(comments are locked)
|
|
You can add the double quotes to each column, after converting the colunm to a character type where necessary
(comments are locked)
|
|
I've always found the QUOTENAME() function to be easy to read and use. It doesn't get as confusing when concatenating long strings together.
select quotename('quotename','''') -- using two single quotes
select quotename('quotename','"') -- using a double quote
select quotename('quotename','[]') -- using brackets
(comments are locked)
|
|
We just found that in SQL Developer, if you use the following it incoorporates the double quotes on each field. We are using this method in a unix script. select '"' || field1 || '"' from tablename; returns "field1" select '"' || field1 || '"' , '"' || field2 || '"' from tablename returns
(comments are locked)
|
|
Not sure exactly what trouble you're having - it would probably help if you posted your query. Are you looking for something like this?
You can also use SSIS to output into almost any format that you can imagine.
(comments are locked)
|
|
You an also change the behavior of double quotes with set quoted_identifier http://msdn.microsoft.com/pt-br/library/ms174393.aspx Some examples that could be usefull:
(comments are locked)
|


Do you need to do any escaping? Looks like you're trying to create CSV. What happens if there is a double quote in the data?