If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Stored proc using select

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-03, 08:42
chuckdudley chuckdudley is offline
Registered User
 
Join Date: Sep 2003
Posts: 2
Angry 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!!
Reply With Quote
  #2 (permalink)  
Old 09-04-03, 14:00
chuckdudley chuckdudley is offline
Registered User
 
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;




Quote:
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!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On