Code: Select all
Query := TOraQuery.Create(nil);
try
Query.Session := Session;
Session.Connect;
WriteLn('Connected');
// Setup the SQL and params.
Query.SQL.Text := 'begin :MyOutText := :MyInText; end;';
Query.ParamByName('MyInText').AsString := 'Some Text';
Query.ParamByName('MyInText').ParamType := ptInput;
Query.ParamByName('MyOutText').DataType := ftMemo; // also ftWideMemo with Unicode settings on;
Query.ParamByName('MyOutText').ParamType := ptOutput;
Query.Execute;
WriteLn('');
WriteLn(' Input: ' + Query.ParamByName('MyInText').AsString);
WriteLn('Output: ' + Query.ParamByName('MyOutText').AsString);
if Query.ParamByName('MyInText').AsString = Query.ParamByName('MyOutText').AsString then
WriteLn(' Correct Results')
else
WriteLn(' ++++++ ERROR ++++++ ');
Query.ParamByName('MyInText').AsString := '';
Query.Execute;
WriteLn('');
WriteLn(' Input: ' + Query.ParamByName('MyInText').AsString);
WriteLn('Output: ' + Query.ParamByName('MyOutText').AsString);
if Query.ParamByName('MyInText').AsString = Query.ParamByName('MyOutText').AsString then
WriteLn(' Correct Results')
else
WriteLn(' ++++++ ERROR ++++++ ');
Query.ParamByName('MyInText').AsString := 'Different Text';
Query.Execute;
WriteLn('');
WriteLn(' Input: ' + Query.ParamByName('MyInText').AsString);
WriteLn('Output: ' + Query.ParamByName('MyOutText').AsString);
if Query.ParamByName('MyInText').AsString = Query.ParamByName('MyOutText').AsString then
WriteLn(' Correct Results')
else
WriteLn(' ++++++ ERROR ++++++ ');
WriteLn('');
Write('Press Enter to exit: ');
ReadLn;
finally
Query.Free;
end;
Input: Some Text
Output: Some Text
Correct Results
Input:
Output:
Correct Results
Input: Different Text
Output:
++++++ ERROR ++++++
Let me know if you can't reproduce this. Thanks.