stored proc formatted SQL double quote issue Sybase

i have a stored proc like this

--liquibase formatted sql

--changeset author:id

create proc abc

as begin

select @var1= "insert into a1"       select @var1= @var1+ " select  c1,c2"       select @var1= @var1+ " from b2 "        exec (@var1)

end

go

liquibase throws an error column not found .

If i put single quote instead of double quote it is running fine. Please let me know, how to work with double quotes in select @variable= " something"  in a stored proc.

.

I am also getting same above issue…Any one had tried above error and resolved issue

Same issue. Any suggestions or solution found?

Hey everyone, I feel like there is some missing context that might be helpful for this issue. Why the need for double quotes? What specifically is needed here for double quotes, this looks like dynamic sql, does the sql compiler not like exec(‘something’)? Would that procedure run on its own if ran directly in the database?

I’m not 100% sure I have a good understanding of the problem so I will share some general troubleshooting ideas.

Thought #1
Liquibase parses each statement in the changelog before executing it on a target database. Having a mixture of stored logic code and typical DDL statements can cause problems because the statement terminators can be different - a semi-colon vs. “GO”.

Thought #2
Typically, embedded double-quotes need to be escaped. Try executing the stored proc in the native SQL UI tool to make sure it’s formed correctly.