| Issue 6: | Not error raised | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
[The output must be (Using console SQL from MSSQL Server)]
(1 filas afectadas)
@@error1 is 0.
Servidor: mensaje 547, nivel 16, estado 1, línea 1
Instrucción INSERT en conflicto con la restricción COLUMN CHECK
'CK_tm_asunto'. El conflicto ha aparecido en la base de datos 'ctrl_emi',
tabla 'taller_movimiento', column 'asunto'.
[What happend instead inside of try block, not enter in except block]
>>> u.execute(s)
1
What version of the product are you using? On what operating system?
Windows XP SP3
SQL Server 2000
pyodbc 2.0.58 (I use Zope so I need using with python 2.4. I not know how
compile with this version)
Please provide any additional information below.
The query is
SET XACT_ABORT ON
BEGIN TRANSACTION
DECLARE @err int
UPDATE taller SET
comercial = ''
where taller = 1
select @err = @@error
PRINT '@@error1 is ' + ltrim(str(@@error)) + '.'
IF (@ERR <> 0) BEGIN
raiserror('error al actualizar',16,1)
ROLLBACK TRANSACTION
END
insert into taller_movimiento (estado, taller, fecha, asunto, observacion
) values(
'14',
1,
'',
'',
''
)
select @err = @@error
PRINT '@@error2 is ' + ltrim(str(@@error)) + '.'
IF (@ERR <> 0) BEGIN
raiserror('error al insertar',16,1)
ROLLBACK TRANSACTION
END
COMMIT TRANSACTION
Dec 3, 2008
Thanks for the update.
Status:
Invalid
Nov 21, 2010
(No comment was entered for this change.)
Status:
NoFix
|
Forget, The problem is select @err = @@error PRINT '@@error2 is ' + ltrim(str(@@error)) + '.' IF (@ERR <> 0) BEGIN raiserror('error al insertar',16,1) ROLLBACK TRANSACTION END After removed, raised the error