testpa.pp 762 B

123456789101112131415161718192021222324252627282930313233
  1. program testpa;
  2. {$mode objfpc}
  3. uses fpodbc,Classes;
  4. var
  5. Conn : TODBCConnection;
  6. ProcedureParams : TStringList;
  7. I : Integer;
  8. PT : TODBCParamType;
  9. begin
  10. Conn:=TODBCConnection.Create(Nil);
  11. Try
  12. Conn.DSN:='BUGS';
  13. Conn.Active:=True;
  14. ProcedureParams:=TStringList.Create;
  15. ProcedureParams.Sorted:=True;
  16. Try
  17. For PT:=ptUnknown to ptRetval do
  18. begin
  19. Conn.GetProcedureParams('GET_BUGID',[Pt],ProcedureParams);
  20. Writeln('Found ',ProcedureParams.Count,' parameters of type ',ODBCParamTypeNames[Pt],' :');
  21. For I:=0 to ProcedureParams.Count-1 do
  22. Writeln(ProcedureParams[i]);
  23. end;
  24. finally
  25. ProcedureParams.Free;
  26. end;
  27. Conn.Active:=False;
  28. Finally
  29. Conn.free;
  30. end;
  31. end.