Page 1 of 1

Componenet Chaning SQL

Posted: Wed 19 May 2010 14:31
by whit
I am building a SQL insert command like the following
UnicodeString aString = "INSERT INTO ordered (OrderedID, Notes) VALUES (1, 'SC----EGG')";

UniQuery->SQL->Clear();
UniQuery->SQL->Add(aString);
UniQuery->Execute();

It fails with a complaint that */ is not valid. When I look at the MySQL log, I see that it is changed to.

INSERT INTO ordered(OrderedID, Notes) VALUES(1,'SG/*--EDD')*/

Any Ideas on why it is changing the text?

Thanks,

The full SQL is the following:

Posted: Wed 19 May 2010 14:42
by whit
The Item that is getting changed is at the end 'SC----EGG'

Any Ideas


INSERT INTO ordered (LocationGUID ,OrderedID,ClientID,OrderClientID,ProductID,AllowedID,ProcedureID,Amount,Units,CalibrationTime,PatientName,PONumber,PhysicianID,OrderedByID,OrderDate,OrderTime,
OrderTakenByID,Filled,FilledByID,FilledDate,FilledTime,Quantity,RXNumber,ActualActivity,ActualActivityUnits,ActualVolume,ActualVolumeUnits,ActualSalineAdded,ActualTotalVolume,ShipContainerID,Processed,ProcessedByID,
ProcessedDate,ProcessedTime,Billed,BilledByID,BilledDate,BilledTime,PriceID,PriceOverriden,Price,StatementID,AmountBilled,AmountCredit,Paid,DatePaid,AmountPaid,Adjustment,Deleted,DeliveryDate,DeliveryTime,CalibrationDate,ContainerID,Tax,ActualQuantity,Returned,BioDoseScheduleID,ReturnedByID,ReturnedQuantity,ReturnedDate,ReturnedTime,RouteID,PrepFee,Notes,PharmacistID,Synced)
VALUES ( '1EE28AF5-7373-4276-944D-2C8F14EAB721' ,

'35133','95','95','111','1006','230','1.00000000000','mCi','11:00:34','Physician\s Use Only','','193','195','2008-03-28','14:01:43','2','0','9','2008-03-

31','03:40:30','1','35133','1','mCi','0.103','ml','0.397','0.5','0','0','9','2008-03-

31','03:40:30','','','','','0','0','0.00000000000','','','','','','','','1','2008-03-31','04:30:00','2008-03-

31','2','','1','0','','','','','','1','','SC----EGG','-10000','0')

Woops It go cut off

Posted: Wed 19 May 2010 14:49
by whit
{ "INSERT INTO ordered (LocationGUID, OrderedID, ClientID, OrderClientID, ProductID, AllowedID, ProcedureID, Amount,Units, CalibrationTime, PatientName, PONumber, PhysicianID, OrderedByID, OrderDate, OrderTime, OrderTakenByID, Filled, FilledByID, FilledDate, FilledTime, Quantity, RXNumber, ActualActivity, ActualActivityUnits, ActualVolume, ActualVolumeUnits, ActualSalineAdded, ActualTotalVolume, ShipContainerID, Processed, ProcessedByID, ProcessedDate, ProcessedTime, Billed, BilledByID, BilledDate, BilledTime, PriceID, PriceOverriden, Price, StatementID, AmountBilled, AmountCredit, Paid, DatePaid, AmountPaid, Adjustment, Deleted, DeliveryDate, DeliveryTime, CalibrationDate, ContainerID, Tax, ActualQuantity, Returned, BioDoseScheduleID, ReturnedByID, ReturnedQuantity, ReturnedDate, ReturnedTime, RouteID, PrepFee, Notes, PharmacistID, Synced) VALUES ( '1EE28AF5-7373-4276-944D-2C8F14EAB721' , '35133','95','95','111','1006','230', '1.00000000000', 'mCi', '11:00:34', 'Physician\s Use Only', '', '193', '195', '2008-03-28', '14:01:43', '2', '0', '9', '2008-03-31', '03:40:30', '1', '35133', '1', 'mCi', '0.103', 'ml', '0.397', '0.5', '0','0', '9', '2008-03-31', '03:40:30', '', '', '', '', '0', '0', '0.00000000000', '', '', '', '', '', '', '', '1', '2008-03-31', '04:30:00', '2008-03-31', '2', '', '1', '0', '', '', '', '', '', '1', '', 'SC----EGG', '-10000', '0')

Posted: Thu 20 May 2010 07:11
by Dimon
I could not reproduce the problem.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script to create a table.

Also supply me the following information:
- the exact version of MyDAC;
- the exact version of your IDE;
- the exact version of MySQL server.

I Fixed it

Posted: Mon 24 May 2010 21:23
by whit
For some reason if I had two -- in a long SQL statement, it would think that they were escape characters. I just trapped it out before I sent the SQL statement off. I will try to get you a script in the next few days.

Thanks for the willingness to help!!! That means allot, when you are willing to support it.