alrightydooda
Programmer
Hi,
I am trying to convert an oracle database function into a SQL Server function and i am stuck on a particular line of code. Here is the PL/SQL:
OPEN c1;
LOOP
FETCH c1 INTO StageDesc;
EXIT WHEN c1%NOTFOUND;
Treatment := Treatment || StageDesc ||chr(13;
END LOOP;
Here is what i have converted it to in T-SQL:
OPEN c1
While (@@FETCH_STATUS = 0)
BEGIN
FETCH c1 INTO @StageDesc
@Treatment := @Treatment || StageDesc ||chr(13)
END
The error i am getting in query analyzer is "Incorrect syntax near '@Treatment'" on line 5
Any ideas how this should be converted?
I am trying to convert an oracle database function into a SQL Server function and i am stuck on a particular line of code. Here is the PL/SQL:
OPEN c1;
LOOP
FETCH c1 INTO StageDesc;
EXIT WHEN c1%NOTFOUND;
Treatment := Treatment || StageDesc ||chr(13;
END LOOP;
Here is what i have converted it to in T-SQL:
OPEN c1
While (@@FETCH_STATUS = 0)
BEGIN
FETCH c1 INTO @StageDesc
@Treatment := @Treatment || StageDesc ||chr(13)
END
The error i am getting in query analyzer is "Incorrect syntax near '@Treatment'" on line 5
Any ideas how this should be converted?