Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    21

    Unanswered: Problem running SP in ASE-12.5

    Hi,

    I have at table with Curency details and when running a stored procedure on this table, the SP either makes a faulty conversion or reads data from somewhere else.

    When running the SP I get back a Currency called SEK, but SEK is not defined in the Currency table. If I run the SQL code directly it works.

    Is there a easy way to trace on the SP to see what it really does, because
    it must be doing something really bad here?

    Regards,
    Hans


    Printouts from the system:
    ----------------------------

    1> select CurrencyTypeCode, CurrencyCode from Currency
    2> go
    CurrencyTypeCode CurrencyCode
    ---------------- ------------
    0 SDD
    1 EUR

    1> sp_helptext GetActiveCurrency
    2> go

    CREATE PROCEDURE GetActiveCurrency
    as
    select convert(varchar, CurrencyTypeCode) + ' ' + CurrencyCode
    from Currency
    return

    1> exec GetActiveCurrency
    2> go

    ----------------------------------
    0 SEK
    1 EUR

    1> select convert(varchar, CurrencyTypeCode) + ' ' + CurrencyCode from Currency
    2> go

    ----------------------------------
    0 SDD
    1 EUR

  2. #2
    Join Date
    Aug 2004
    Posts
    38
    Is there a chance that the currency table has been renamed at some point in the past? If so, the proc will still point to the old table, while the SQL code running directly will pick up the new one.

    You should be able to see this with an sp_depends against the proc name. The chances are it's looking at another table.

    A drop and recreate of the stored proc should fix it.

  3. #3
    Join Date
    Oct 2004
    Posts
    21
    Thanks KevR,

    You were right, it fixed the problem to recreate the procedure.
    I will try to remember the tips to use the sp_depends command the
    next time I face a similar problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •