Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

i have this select query below.

SELECT @ColumnName = ISNULL(@ColumnName + ',', '') + QUOTENAME(TestName) FROM (SELECT DISTINCT [TestName] FROM #Test t INNER JOIN #Marks m ON m.TestID =t.TestID WHERE Semester = @Semester) AS [TestName]

Sybase give this error : Function 'QUOTENAME' not found. If this is a SQLJ function or SQL function, use sp_help to check whether the object exists (sp_help may produce a large amount of output).

how this fix this.. Thank you

asked 09 Jul, 22:18

lina77's gravatar image

lina77
102
accept rate: 0%

Are you using Adaptive Server Enterprise (ASE)? SQL Anywhere does not report the message you cite.

Note that ASE does not have QUOTENAME function. That appears to be a Microsoft SQL Server T-SQL function.

If you are using ASE, please review faq related to ASE.

(2 days ago) Chris Keating
Replies hidden

According to the question, it might be SAP IQ...

(2 days ago) Volker Barth

AFAIK, there's no QUOTENAME() or according builtin function in SQL Anywhere. However, QUOTENAME() is basically a rather simple function that adds the specified quote characters (default open resp. closing square brackets) before and after the parameter, even if the parameter itself would do as an identifier. So you could simple use

@ColumnName = string('[', YourUnquotedColumnName, ']') FROM...

to have something comparable.

permanent link

answered 2 days ago

Volker%20Barth's gravatar image

Volker Barth
40.5k365556827
accept rate: 34%

What are you trying? This looks very complicated just to get all the test names... How about:

select list(distinct TestName) into @ColumnName from #Test inner join ...

or, if you need the quotes and maybe sorted:

select list(distinct '''' || TestName'''' order by TestName) into @ColumnName from #Test inner join ...
permanent link

answered 2 days ago

ArcoW's gravatar image

ArcoW
3013515
accept rate: 4%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×42

question asked: 09 Jul, 22:18

question was seen: 95 times

last updated: 2 days ago