Componenet Chaning SQL

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
whit
Posts: 4
Joined: Wed 19 May 2010 14:24

Componenet Chaning SQL

Post by whit » Wed 19 May 2010 14:31

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,

whit
Posts: 4
Joined: Wed 19 May 2010 14:24

The full SQL is the following:

Post by whit » Wed 19 May 2010 14:42

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')

whit
Posts: 4
Joined: Wed 19 May 2010 14:24

Woops It go cut off

Post by whit » Wed 19 May 2010 14:49

{ "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')

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 20 May 2010 07:11

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.

whit
Posts: 4
Joined: Wed 19 May 2010 14:24

I Fixed it

Post by whit » Mon 24 May 2010 21:23

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.

Post Reply