[ts-gen] limits in risk.rb
Nils Gebhardt
mail at ngebhardt.de
Tue Sep 2 13:37:35 EDT 2008
On Mon, 2008-09-01 at 19:47 -0400, R P Herrold wrote:
>
> > Problem: 414 mysql query evaluation failed
> > Error 1452 (23000): Cannot add or update a child row: a foreign key
> > constraint fails (`testing/OrderResult`, CONSTRAINT `OrderResult_ibfk_1`
> > FOREIGN KEY (`ibc`) REFERENCES `Product` (`ibc`))
> > insert ignore
> > into OrderResult(
> > acc, type, curr, name, expiry, rite, strike, position, price, value,
> > avg_cost, un_pnl, real_pnl, ibc)
> > values
> > ('DU33186', 'FUT', 'EUR', 'GBL', '20080908', '0', 0.00, 71, 114.00,
> > 8138729.00, 114818.00, 0.00, 0.00, null);
>
> This is easier to test -- does:
>
> insert ignore into OrderResult(acc, type, curr, name, expiry, rite, strike,
> position, price, value, avg_cost, un_pnl, real_pnl, ibc)
> values
> ('DU33186', 'FUT', 'EUR', 'GBL', '20080908', '0', '0,00', 71, '114,00',
> '8138729,00', '114818,00', '0,00', '0,00', null);
>
> work? The null FK for ibc should presently work, as I
> understand it from Bill.
>
> Please let us know.
>
no, still complains on
ERROR 1452 (23000): Cannot add or update a child row: a foreign key
constraint fails (`testing/OrderResult`, CONSTRAINT `OrderResult_ibfk_1`
FOREIGN KEY (`ibc`) REFERENCES `Product` (`ibc`))
additional observation: it gets the wrong decimals here as well. I do
not know why shim tries to do this insert when calling a plain
./shim --data (nothing to do with risk.rb), I guess it is initializing
the position in the database (?), but the value for 'price' in this
statement again has lost the decimals.
Thanks,
Nils
More information about the ts-general
mailing list