Advertisement
panxop

Untitled

Nov 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.67 KB | None | 0 0
  1.    IF @ROL = 'PVR'
  2.         BEGIN
  3.             SELECT @num_cli = PVR_NUM_CLI,
  4.                 @nro_id = pvr_rut,           
  5.              @SEGMENTO = pvr_segm,
  6.              @TIP_PROD = pvr_tip_prod,
  7.              @TIP_IDE = pvr_tip_ide
  8.             FROM PVR
  9.             WHERE pvr_id_pvr = @ID_CLI
  10.         END;
  11.     ELSE
  12.        SELECT @num_cli = gpg_NUM_CLI,
  13.           @nro_id = gpg_rut,         
  14.           @SEGMENTO = gpg_segm,
  15.           @TIP_PROD = gpg_tip_prod,
  16.           @TIP_IDE = gpg_tip_ide
  17.        FROM gpg
  18.        WHERE gpg_id_gpg = @ID_CLI
  19.  
  20.        SELECT @COD_PROD = ID FROM BF_TASAS..PRODUCTO  WHERE moneda = @MONEDA AND segmento = @SEGMENTO AND @TIP_PROD =
  21.           (CASE  tip_prod_ibs
  22.           WHEN 1 THEN 2
  23.           WHEN 2 THEN 1
  24.           END
  25.           )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement