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,
Componenet Chaning SQL
The full SQL is the following:
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')
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
{ "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')
I Fixed it
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.
Thanks for the willingness to help!!! That means allot, when you are willing to support it.