#1  
Old 13th October 2005, 03:27 AM
Mark Clark
 
Posts: n/a
Default Procedures and Triggers

Can someone point me to an example of a procedure, trigger, and
instructions on how to use them in NexusDB?

Thanks
  #2  
Old 13th October 2005, 04:08 AM
Ole Willy Tuv
 
Posts: n/a
Default Re: Procedures and Triggers

Mark,

<< Can someone point me to an example of a procedure, trigger, and
instructions on how to use them in NexusDB? >>

As a start, you should check the following topics in the NexusDB V2 SQL
Reference:

- Stored Procedures and Functions
- CREATE PROCEDURE statement
- CREATE FUNCTION statement
- CREATE TRIGGER statement

Ole


  #3  
Old 13th October 2005, 04:38 PM
William O.
 
Posts: n/a
Default Re: Procedures and Triggers

"Mark Clark" <mcmahling@mac.com> wrote in message news:434d3c0c@wic040d....
> Can someone point me to an example of a procedure, trigger, and
> instructions on how to use them in NexusDB?
>
> Thanks


You can go to the online help at
http://www.nexusdb.com/onlinemanualv...nce/index.html

Here is an example stored procedure:

DROP ROUTINE IF EXISTS "GENERALGLCODES";
create PROCEDURE GENERALGLCODES
(
out code1 VARCHAR(15), // can be in or out
out code2 VARCHAR(15),
out code3 VARCHAR(15),
out RESULT SMALLINT
)
READS SQL DATA // if altering tables then use MODIFIES SQL DATA to give
write access
AS
BEGIN
set code1 = '';
set code2 = '';
set code3 = '';
set Result = 0;
set code1 = (Select CODE from glcodes where gTYPE = 'abc'); //gTYPE has
unique values
set code2 = (Select CODE from glcodes where gTYPE = 'def');
set code3 = (Select CODE from glcodes where gTYPE = 'ghi');
if ((code1 = '') or (code2 = '') or (code3 = '')) then
set Result = -1;
end if;
END

To use it within EM SQL you will need something like:
declare
myCode1 varchar(10),
myCode2 varchar(10),
myCode3 varchar(10),
myResult integer; // or smallint
CALL GENERALGLCODES(myCode1, myCode2, myCode3, myResult);
//variables now holding data returned from calling the stored procedure.
select myCode1 from #dummy; //to show the value

Regards,
William.




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debug Triggers and stored procedures Matthew Balraj nexusdb.public.support.adoprovider 2 27th November 2009 07:20 AM
Crystal Reports and Stored Procedures Paul Toms nexusdb.public.support.odbc 0 2nd June 2008 09:31 PM
Re: Stored Procedures Martijn Tonies nexusdb.public.support.sql 1 16th September 2005 09:15 PM
Re: Stored Procedures Wolfgang nexusdb.public.support.sql 0 16th September 2005 05:39 PM
Looping in Stored procedures - Converting IB Procs to nxdb William O. nexusdb.public.support.sql 11 19th August 2005 08:27 PM


All times are GMT +11. The time now is 12:16 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.