Hi I am using Sybase 10 and am passing a comma separated string into a stored procedure to split into multiple rows. At the moment I am only able to get this working when I pass numbers in. Anytime I pass in a word or letter I get a message saying that column doesn't exist?ALTER PROCEDURE "DBA"."sp_split_data"(@testData varchar(500))begin declare @sql varchar(8000); declare local temporary table TempTable( testRecord varchar(500) null, ) on commit delete rows; set @sql='insert into TempTable select ' +replace(@testData,',',' union all select '); execute immediate @sql; select testRecord from TempTableend
I call this stored procedure by: call sp_split_new_onet('1,2,3') and it will return the following:testrecord123But anytime I would execute the stored procedure call sp_split_new_onet('A,B,C') it would say the columns do not exist.So basically I am trying to find a way to split up a comma separated string where words/characters are passed in. Any help is appreciated.Thanks!