Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Angry Unanswered: Stored proc using select

    Hello Pervasive SQL kings and queens.

    I'm using Crystal Reports using a Pervasive 2000i backend. I understand I cannot create a view using UNION. >;-(
    So I decided to use a stored procedure. Can someone give me a the syntax to create a stored procedure that simply uses SELECT to return a result set? Here's what it would look like in SQL Server:

    CREATE PROCEDURE MYPROC

    AS

    SELECT name from table A
    UNION
    SELECT name from table B

    How can I create same in Pervasive SQL???? I'm a newbie to Pervasive.

    Thanks all for your help!!

  2. #2
    Join Date
    Sep 2003
    Posts
    2

    Re: Stored proc using select

    I figured it out:

    CREATE PROCEDURE MYPROC () RETURNS (NAME CHAR(25))
    AS SELECT NAME from person UNION ALL SELECT NAME from class;




    Originally posted by chuckdudley
    Hello Pervasive SQL kings and queens.

    I'm using Crystal Reports using a Pervasive 2000i backend. I understand I cannot create a view using UNION. >;-(
    So I decided to use a stored procedure. Can someone give me a the syntax to create a stored procedure that simply uses SELECT to return a result set? Here's what it would look like in SQL Server:

    CREATE PROCEDURE MYPROC

    AS

    SELECT name from table A
    UNION
    SELECT name from table B

    How can I create same in Pervasive SQL???? I'm a newbie to Pervasive.

    Thanks all for your help!!

Posting Permissions

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