on 2024 Jul 09 11:18 PM
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
Request clarification before answering.
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 ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
52 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.