if (isset($id_resposta["inserted_id"]) && trim($id_resposta["inserted_id"]) !== '') {
USE [portalfornecedores]
GO
/****** Object: StoredProcedure [dbo].[core_user_createUser] Script Date: 09/10/2015 10:24:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ================================================
-- Author: Ricardo Antunes, Fullscreen
-- Create date: 09-10-2015
-- Description: create resposta
-- ================================================
ALTER PROCEDURE [dbo].portal_concurso_createResposta
@id_concurso int = 0,
@id_user int = 0,
@obs varchar(200) = NULL,
@cond_p varchar(200) = NULL,
@prz_e varchar(200) = NULL,
@anexo varchar(200) = NULL
AS
BEGIN
SET NOCOUNT ON;
DECLARE @ins_id int;
INSERT INTO portal_concurso_resposta ([id_concurso], [data_resposta], [id_user],
[observacao], [condicao_pagamento], [prazo_entrega])
VALUES(@id_concurso, GETDATE(), @id_user, @obs, @cond_p, @prz_e);
SELECT @ins_id = (SELECT SCOPE_IDENTITY());
SELECT @ins_id AS inserted_id;
IF (NULLIF(@anexo, '') IS NOT NULL)
BEGIN
INSERT INTO portal_concurso_resposta_anexo ([id_resposta], [anexo])
VALUES(@ins_id, @anexo);
END
END