title: Getting Err in Postgres Stored Procedure / Function
body: <pre><code>CREATE OR REPLACE function spInsertReleaseSheet (
  p_RedlineNo int,
  p_RedlineDesc varchar(500),
  p_ParentRedlineId int,
  p_CategoryId int,
  p_ChangeTypeId int,
  p_ObjectName varchar(500),
  p_DeployInfo int,
  p_Notes varchar(500),
  p_CodeReview int,
  p_Env int,
  p_TechId varchar(500),
  p_CreatedBy varchar(50),
  p_DeployStatus varchar(50),
  p_ReleaseCodeStatus int) 
  
  RETURNS VOID as $$
  
  DECLARE v_redlineid int;
  DECLARE v_objectid int;
  Begin
  
  
  if(COALESCE(p_CreatedBy,'')='')
  then
      p_CreatedBy:='Suresh';
  end if;
  
  if(COALESCE(p_DeployStatus,'')='')
  then
      p_DeployStatus:='TBD';
  end if;
  BEGIN
  --LOOP
      START TRANSACTION;
      IF EXISTS (SELECT  "RedlineNumber" from public."Redline"  where RedlineNumber=p_RedlineNo LIMIT 1)
              Then
                  select  "RedlineId" into v_redlineid from public."Redline" where RedlineNumber=p_RedlineNo LIMIT 1;
              else
                  insert into Redline(RedlineNumber,ParentRedlineId,RedlineDesc,CreatedDate,CreatedBy)
                  Select p_RedlineNo,p_ParentRedlineId,p_RedlineDesc,now(),p_CreatedBy
  
               RETURNING Redline into  v_redlineid;
              end if;
  
          insert into Objects(CategoryId,Name) 
          Select p_CategoryId,p_ObjectName
          RETURNING Redline into v_objectid;
  
  
          insert into ObjectImplementation(RedlineId,CodeReviewStatusId,ChangeTypeId,Instructions,ObjectId,Notes,DeploymentStatus,EnvironmentId,TechReqId)
          Select v_redlineid,p_CodeReview,p_ChangeTypeId,p_DeployInfo,v_objectid,p_Notes,p_DeployStatus,p_Env,p_TechId;
  
          insert into ObjectImplementationHistory(ReleaseCodeStatusTypeId,CreateDatetime,EnvironmentId,ObjectId,RedlineId)
          Select p_ReleaseCodeStatus,now(),p_Env,v_objectid,v_redlineid;
  
          COMMIT;
          --END LOOP
          EXCEPTION
           WHEN OTHERS THEN
                -- if error, roll back any chanegs done by any of the sql statements
             ROLLBACK;
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>================================================</p>
  
  <p>I am getting a error </p>
  
  <pre><code>ERROR:  syntax error at end of input
  LINE 64: $$ LANGUAGE plpgsql;
           ^
  SQL state: 42601
  Character: 1750
  </code></pre>
  
  <p>Can some resolve this issue Function</p>
  
  <p>When I run the function I am getting the Error Below </p>
  
  <pre><code>=================================================
  ERROR:  function public.spinsertreleasesheet(integer, unknown, unknown, integer, integer, unknown, integer, unknown, integer, integer, unknown, unknown, integer, integer) does not exist
  LINE 1: SELECT public.spinsertreleasesheet(
                 ^
  HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
  SQL state: 42883
  Character: 8
  =======================================
  SELECT public.spinsertreleasesheet(
      177771, 
      '177771 : Tests', 
      NULL, 
      1, 
      1, 
      'Test', 
      1, 
      NULL, 
      1, 
      1, 
      NULL, 
      'Test', 
      1, 
      1
  )
  </code></pre>
  
  <p>Eventhough the function is there in DB it is giving error</p>