Hello

I have a TOracleQuery Component in Delphi defined as below

object qryMakeInVisible: TOracleQuery
SQL.Strings = (

'Insert into LostApplicants ( Cycle_Year, Applicant_ID, Applicant_SSN )'
'values ( :CYCLEYEAR, :APPLICANTID, :APPLICANTSSN );'
''
'Commit;'
''
'Update Temp_d'
'Set Visible = 0'
'Where Temp_d.Applicant_ID = :APPLICANTID;'
''
'Commit;')
Session = OracleSession1
Debug = True
Variables.Data = {
03000000030000000A0000003A4359434C455945415205000000000000000000
00000C0000003A4150504C4943414E5449440300000000000000000000000D00
00003A4150504C4943414E5453534E050000000000000000000000}
Left = 600
Top = 292
end



The Code that I am using to execute the Query is as follows



begin

{ Make InVisible }

Application.ProcessMessages;

with dmLost_Applicants.dmLostApplicants.qryMakeInVisible do
begin

SetVariable( 'CYCLEYEAR', dbgLostApplicationList.DataSource.DataSet.Fields[5].Value );
SetVariable( 'APPLICANTID', dbgLostApplicationList.DataSource.DataSet.Fields[0].Value );
SetVariable( 'APPLICANTSSN', dbgLostApplicationList.DataSource.DataSet.Fields[1].Value );

sql.SaveToFile( 'MakeInvisibleQuery' );

Execute;

end;

end;


The SaveToFile gives the following code


'Insert into LostApplicants ( Cycle_Year, Applicant_ID, Applicant_SSN )'#$D#$A'values ( :CYCLEYEAR, :APPLICANTID, :APPLICANTSSN );'#$D#$A#$D#$A'Commit;'#$D#$A#$D#$A'Update Temp_d'#$D#$A'Set Visible = 0'#$D#$A'Where Temp_d.Applicant_ID = :APPLICANTID;'#$D#$A#$D#$A'Commit;'#$D#$A


When I run the program in the debugger I can see the correct values of the data in the SetVariable lines of code
and when I turn on qryMakeInVisible.Debug it produces the follow code in the popup.


Insert into LostApplicants ( Cycle_Year, Applicant_ID, Applicant_SSN )
values ( :CYCLEYEAR, :APPLICANTID, :APPLICANTSSN );

Commit;

Update Temp_d
Set Visible = 0
Where Temp_d.Applicant_ID = :APPLICANTID;

Commit;

:CYCLEYEAR = 2013
:APPLICANTID = 111222333
:APPLICANTSSN = 444556666


Everthing looks good to me, but it is giving an "ORA-00911 invalid character" error message --- What Gives


Any help would be appreciated.

Mark Moss