Search code examples
sqlsybasesap-ase

how to get procedure arguments in sybase ?


Is there a way I can select the arguments of a procedure in Sybase for example in oracle there is this

select * from user_arguments

Solution

  • Assuming you're looking for the values assigned to the stored proc's parameters ... no, there is no feature like 'select * from user_arguments' in Sybase ASE.

    If on the other hand you're just looking for the names of the stored proc's parameters ... you could select the parameter names (and datatypes) from syscolumns, eg:

    select ... from syscolumns where id = @@procid
    

    where @@procid is the object id of the currently executing procedure.

    NOTE: It gets a bit more complicated if the procedure exists in a different database as you'll then need to reference 'different_dbname'..syscolumns.