Subject | Re: Writing A Stored Procedure ?? |
---|---|
Author | akashelkar |
Post date | 2003-07-22T15:04:39Z |
Thanks, Richard, Alex and everyone else (actually I forgot your name :
( ) for the suggestions. It seems there is a bug in IBExpert :(
I finally ran the following SQL in the SQL Editor and it compiled
successfully:
************
CREATE PROCEDURE SP_ADD_CC_USER (
str_DR_ID VARCHAR(50),
int_USER_ID INTEGER)
AS
begin
if (not exists(SELECT * FROM CC_USERS WHERE DR_ID=:str_DR_ID
and CC_USER=:int_USER_ID)) Then
insert into CC_USERS (dr_id, cc_user)
values ( :str_dr_id, :int_user_id );
end
************
Thanks once again! :)
-Anand
--- In firebird-support@yahoogroups.com, "Richard Pendered"
<rpendered@t...> wrote:
( ) for the suggestions. It seems there is a bug in IBExpert :(
I finally ran the following SQL in the SQL Editor and it compiled
successfully:
************
CREATE PROCEDURE SP_ADD_CC_USER (
str_DR_ID VARCHAR(50),
int_USER_ID INTEGER)
AS
begin
if (not exists(SELECT * FROM CC_USERS WHERE DR_ID=:str_DR_ID
and CC_USER=:int_USER_ID)) Then
insert into CC_USERS (dr_id, cc_user)
values ( :str_dr_id, :int_user_id );
end
************
Thanks once again! :)
-Anand
--- In firebird-support@yahoogroups.com, "Richard Pendered"
<rpendered@t...> wrote:
> Try this version
>
> CREATE PROCEDURE NEW_PROCEDURE (
> str_DR_ID VARCHAR(50),
> int_USER_ID INTEGER)
> AS
> begin
> /* Procedure Text */
> if (not exists(select * from cc_users where dr_id=:str_DR_ID
> and cc_user=:int_USER_ID))
> then
> insert into cc_users (dr_id, cc_user) values ( :str_dr_id,
> :int_user_id );
> end