Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble inserting data
Message
 
 
To
18/06/2013 16:40:50
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01576652
Message ID:
01576655
Views:
45
>
>INSERT INTO base1.dbo.PRESTAMOS
>(idprestamo,idcliente,fecha, fechap1, fechav, duracion, interes, comision, monto, balance,idtipo, fecha_pago, 
> cuota,idpago)
>SELECT CAST(RIGHT([Código Préstamo],8) AS INT) AS IDPRESTAMO,CAST(RIGHT(CodCliente,8) AS INT) AS IDCLIENTE,
>FECHA,Inicio AS FECHAP1,Vence AS FECHAV,Cuotas AS DURACION,cast(Tasa as numeric(12,2))*12 AS INTERES,0 AS COMISION,
>Monto,case when Balance>0 then monto else 0 end as balance,6 as idtipo,
>convert(varchar(10),CONVERT(datetime,ultpago,105),111) AS FECHA_PAGO,[Monto Cuotas]AS Cuota,
>IDPAGO=CASE WHEN periodopago='D' THEN 1 ELSE 
>CASE WHEN periodopago='S' THEN 2 ELSE
>CASE WHEN periodopago='Q' THEN 3 ELSE 4 END END END FROM Préstamo
>
I suggest to make this minor change close to the end:
CASE   periodopago WHEN 'D' THEN 1  WHEN 'S' THEN 2 WHEN Q' THEN 3 ELSE 4 END AS IDPAGO
to simplify the expression a bit.

In any case, the problem most likely lies in the trigger's code - can you post it?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform