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 > New To Pervasive

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-07, 15:32
darrellj darrellj is offline
Registered User
 
Join Date: Jan 2007
Posts: 7
New To Pervasive

Hello.

I would like some help on simple stored procedures. Here is some of the code that I am using as a test....

CREATE PROCEDURE emp_sp(in:empID char(4)) AS
BEGIN
SELECT * FROM EMPLOYEE WHERE E_ID = empID;
END;
CALL emp_sp('2269')

This generates a "No Such Table or Object" error. Any help would be great.

Regards,
darrellj
Reply With Quote
  #2 (permalink)  
Old 01-12-07, 17:01
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
First, you need to change the procedure to include a RETURNS clause to return the data you are SELECTing. As it stands, it would not return any data.
Second, you need to make sure there's an "EMPLOYEE" table in the database you are using. THe error indicates there isn't one.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 01-15-07, 11:28
darrellj darrellj is offline
Registered User
 
Join Date: Jan 2007
Posts: 7
New To Pervasive Question.

I have altered the stored procedure to include a RETURNS statement. I have also made sure that there was a table named "EMPLOYEE". I am still getting this error "No such Table or Object". Am I missing something in my stored proc syntax?

Regards,
Darrell
Reply With Quote
  #4 (permalink)  
Old 01-15-07, 12:34
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
And what do you get if you issue:
SELECT * FROM EMPLOYEE WHERE E_ID = '2269'

As a second test, what happens if you create and then execute the following SP:
create procedure GetTable()
RETURNS (TableName char(20));
begin
select xf$name from x$file;
end;

call GetTable()
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #5 (permalink)  
Old 01-15-07, 13:38
darrellj darrellj is offline
Registered User
 
Join Date: Jan 2007
Posts: 7
Thanks For The Reply

I copied and pasted your sample code into the stored proc window and tried to save the procedure. I received the same message.....

Save Failed:com.pervasive.psql.utilities.core.DBExcepti on:
[LNA][Pervasive][ODBC Engine Interface][Data Record Manager]
No Such Table Or Object

Thanks again for your help.

darrellj
Reply With Quote
  #6 (permalink)  
Old 01-15-07, 14:02
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Sounds like you've got some problems with your DDFs. What happens if you use my sample in the DEMODATA database?
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
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