cancel
Showing results for 
Search instead for 
Did you mean: 

change SQL server keyword to sybase keyword

Hazeleena
Explorer
0 Kudos
445

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

chris_keating
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

VolkerBarth
Contributor
0 Kudos

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

View Entire Topic
awitter
Participant
0 Kudos

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 ...