on 07-30-2011 5:51 AM
Buen día compañeros, necesito un transaction que no permita grabar códigos que no sean iguales a 10 caracteres, tengo el siguiente código pero no me funciona, ¿que debo corregir? Saludos.
If @object_type = '4' and @transaction_type In ('A', 'U')
Begin
declare @ItemCode as varchar (20)
declare @tamano as numeric
set @ItemCode = (select (ItemCode) from OITM T0 where DocEntry = @list_of_cols_val_tab_del)
set @tamano = ( select len (@itemcode))
if (@tamano <>10)
begin
set @error =-5
Set @error_message = N'Código debe de ser de 10 caracteres'
End
End
Hola
Prueba este codigo...
IF @object_type = 4 AND @transaction_type IN ('A','U')
BEGIN
IF (SELECT LEN(ItemCode) FROM OITM WHERE ItemCode=@list_of_cols_val_tab_del)!=10
BEGIN
SELECT @error = -10,@error_message = 'SP:Codigo debe tener 10 caracteres'
END
END
Slds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gracias, funciona perfecto.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.