Sybase ASE - INSERT INTO statment i stored procedure, problems in formating string -
i have following problem formatting @p_f_field variable correct, error:
could not execute statement. incorrect syntax near ‘+’ sybase error code=102, sqlstate=”42000” severity level=15, state=181, transaction state=1 line 7
my stored procedure:
create proc dbo.sp_m_efi_dw_full_dsa_table_load_im ( -- parameter examples: @p_skm_name varchar(4096), @p_usr_name varchar(4096), @p_t_name_dsa varchar(4096), @p_t_name_bas varchar(4096), @p_f_name varchar(4096), @p_f_field varchar(4096) ) begin declare @sql varchar(4096) if @p_skm_name not null begin if @p_usr_name not null begin set @sql='truncate table '+@p_skm_name+'.'+@p_usr_name+'.'+@p_t_name_dsa exec (@sql) end end set @sql='insert '+@p_skm_name+'.'+@p_usr_name+'.'+@p_t_name_dsa+' '+@p_f_name+ ' values '+@p_f_field exec (@sql) end
my call stored procedure:
execute bas_efi.dbo.sp_m_efi_dw_full_dsa_table_load_im @p_skm_name = 'b_ef', @p_usr_name = 'dbo', @p_t_name_dsa = 'a_log', @p_t_name_bas = 'a_log', @p_f_name = '(newfield1)', @p_f_field = '('+char(39)+'daf9af01-6bc2-11e-b23182b0623e'+char(39)+')'
any suggestions on how format variable @p_f_field correct, or others suggestions on how execute simple insert procedure?
Comments
Post a Comment