Error 557

  • Only functions and extended stored procedures can be executed from within a function.

     

    I have a function that calls a stored procedure that I made when I tried to test run the function the above error was generated... how do I get around this problem?

  • Does you have to have a function that calls the procedure? Can you change your function to a stored procedure instead?

     

    --------------------
    Colt 45 - the original point and click interface

  • Well the oracle code is written in this way (an sp is called within the function... )

    and well I can't just suggest ways to do this because I haven't seen the entire set of plsql packages that uses this... I'll just have to tell my supervisor and let him do the worrying hehehe.. tnx.

  • This is just the sort of thing I was meaning in my post on your other thread

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=175907#bm176305

    Programming something a certain way, because the other system has it that way is probably going to cause you more grief in the long run.

     

    --------------------
    Colt 45 - the original point and click interface

  • Yup I guess you're right... hmmm... but its not by choice you know

    Now I'm having a problem with reading files in T-SQL.. I was thinking of using some extended stored procedure... or BCP... but I don't even know how to start it.

  • Take a look at the T-SQL BULK INSERT command.

     

    --------------------
    Colt 45 - the original point and click interface

  • I think a nice analogy to think of is how texts are translated. If you would take an English text and start translating it into another language, Swedish for example, and just translate it word by word you would get a very weird result. It might have the same basic meaning, and it would probably still be possible to understand it if you know Swedish, but it would definitely not be a good translation.

  • I agree with Phill. Perhaps you are approaching the problem in the wrong manner. IMHO I would suggest:

     1. Define the desired output

    2. Determine the needed inputs

    3. Forget the Orcal code

    4. Then extract the needed data straight from the DB and perform what ever functions needed to get the desired output.

    Another possible approach would be to forget T_SQL and write the code in Orcal SQL/PL.

    Mike

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply