Hi All,
Im trying to create a bit of Dynamic SQL in a Sybase stored procedure, im used to MS SQL Server so im not sure what im doing wrong in Sybase.
Heres my bit of code
declare @sql varchar(100)
declare @sql2 varchar(100)
Select @sql = """0001/100212"",""0001/100218"",""0001/100240"",""0001/100243"""
select @sql2 = 'select * from bndtra where bnd_tra_code in (' + @sql + ')'
Exec @sql2
now i would have thought this would have executed @sql2 and returned a result set, but no . Any ideas?, idealy i will be passing in @SQL as a paramenter.
Cheers
Ben
Im trying to create a bit of Dynamic SQL in a Sybase stored procedure, im used to MS SQL Server so im not sure what im doing wrong in Sybase.
Heres my bit of code
declare @sql varchar(100)
declare @sql2 varchar(100)
Select @sql = """0001/100212"",""0001/100218"",""0001/100240"",""0001/100243"""
select @sql2 = 'select * from bndtra where bnd_tra_code in (' + @sql + ')'
Exec @sql2
now i would have thought this would have executed @sql2 and returned a result set, but no . Any ideas?, idealy i will be passing in @SQL as a paramenter.
Cheers
Ben