Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    73

    Unanswered: Stored Procedure Equivalent

    hello there,
    I'm just stepping into the wonderfull world of postgresql 8.0 on a windows platform, and I'm already confused. My initial impression was that it had stored procedures or equivalent with user-functions. I created a function as follows:

    CREATE FUNCTION "public"."fnallparts" () RETURNS SETOF "public"."tblPart" AS
    $body$
    SELECT * FROM "public"."tblPart";
    $body$
    LANGUAGE 'sql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

    now the only way to call this is like so:
    select * from fnallparts;
    and then it returns a bunch of data separated with commas. Is there anyway to return data in a column (table) format like a regular query like you can in mssql?

    Your answers are greatly appreciated. thx

  2. #2
    Join Date
    Jun 2004
    Posts
    57

    Perform

    I believe you can use the perform syntax. It will ignore the return value and it will function like a sp in sql server

  3. #3
    Join Date
    Oct 2003
    Posts
    73
    thx for the reply. I'll give it a shot.

Posting Permissions

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