Board index » delphi » Getting SQL 7 Stored Proc parameters in runtime

Getting SQL 7 Stored Proc parameters in runtime

How do you get the parameterlist from a SQL 7 stored proc ? We had a major database change and need to redo all ADO stored procs (which is about 50 components).
I get the "conn.GetProcedureNames(ListBox1.Items);" but not the paramlist of each Proc.

Thnx

 

Re:Getting SQL 7 Stored Proc parameters in runtime


"Amien Crombie" <acrom...@oldmutual.com> schrieb im Newsbeitrag
news:3c74f610$1_2@dnews...

Quote

> How do you get the parameterlist from a SQL 7 stored proc ? We had a major

database change and need to redo all ADO stored procs (which is about 50
components).

Quote
> I get the "conn.GetProcedureNames(ListBox1.Items);" but not the paramlist
of each Proc.

   ADOStoredProc1.Active := False;
   ADOStoredProc1.ProcedureName := 'MyCoolProc';
   ADOStoredProc1.Parameters.Refresh;  // <====
   for i:=0 to ADOStoredProc1.parameters.Count-1 do
   begin
      // do something with Parameters.Items[i]
      // ....
   end;

greetings
Andreas Schmidt

--
Database Explorer for ADO (Freeware)
http://www.tobilan.de/adodeskexe.zip

Re:Getting SQL 7 Stored Proc parameters in runtime


For procedure parameters you might try OpenSchema.

AdoConnection.OpenSchema(
  siProcedureParameters,
   VarArrayOf(unassigned, unassigned, unassigned, unassigned],
  emptyParam,
  AdoDataset1);

For a complete list of OpenSchema calls that work with your provider, and
the criteria for each {the varrArray part}, and to save results in XML, I
suggest you use a tool like AdoAnywhere http://www.adoanywhere.com/cnet

--
DOWNLOAD FREE TRIAL
AdoAnywhere Browser Tool
http://www.adoanywhere.com/cnet

Re:Getting SQL 7 Stored Proc parameters in runtime


Quote
"Andreas Schmidt" <a_j_schm...@rocketmail.com> wrote:

>"Amien Crombie" <acrom...@oldmutual.com> schrieb im Newsbeitrag
>news:3c74f610$1_2@dnews...

>> How do you get the parameterlist from a SQL 7 stored proc ? We had a major
>database change and need to redo all ADO stored procs (which is about 50
>components).
>> I get the "conn.GetProcedureNames(ListBox1.Items);" but not the paramlist
>of each Proc.

>   ADOStoredProc1.Active := False;
>   ADOStoredProc1.ProcedureName := 'MyCoolProc';
>   ADOStoredProc1.Parameters.Refresh;  // <====
>   for i:=0 to ADOStoredProc1.parameters.Count-1 do
>   begin
>      // do something with Parameters.Items[i]
>      // ....
>   end;

>greetings
>Andreas Schmidt

>--
>Database Explorer for ADO (Freeware)
>http://www.tobilan.de/adodeskexe.zip

Andreas

Thanks a million. It works very well. I just had to set all params to null and tyen set my values I pass. I think the ADO component does this automatically

Thanks again
Amien

Other Threads