Subject Fw: [ib-support] rdb$db_key inside view
Author Danny García Hernández
regarding my first message and your answer, i was testing some code to show
what´s happen. The following SP get the rdb$db_key value (through the view )
for a client and then try to update the clients table (using the
rdb$db_key).

create procedure update_client(client integer)
as
declare variable aux:_dbkey numeric(18,0);
begin
select dbkey from view_clients
where client=:client
into :aux:_dbkey;

update clients
set name = 'danny'
where rdb$db_key=:aux:_dbkey;
end

this SP was compiled , but can´t be execute, interbase break the execution
saying :

ERROR: Access violation. The code attempted to access a virtual address
without privilege to do so.

regards
danny
> > ---------- Forwarded message ----------
> > Date: Fri, 06 Sep 2002 13:46:39 -0400
> > From: Ann W. Harrison <aharrison@...>
> > Reply-To: ib-support@yahoogroups.com
> > To: ib-support@yahoogroups.com, ib-support@yahoogroups.com
> > Subject: Re: [ib-support] rdb$db_key inside view
> >
> > At 07:16 PM 9/6/2002 +0200, Danny García Hernández wrote:
> > >hello list:
> > >
> > >i have created the following view:
> > >
> > >create view view_clients (
> > >dbkey,
> > >client,
> > >name)
> > >as
> > >select c.rdb$db_key,client,name from clients
> > >
> > >that is ok!!!
> > >
> > >the view is working fine for all clients table column, but is lying
with
> the
> > >rdb$db_key value, this appears like symbols.
> > >
> > >i would like what is happen!!!
> >
> > The dbkey is an eight byte binary number, normally declared as
> > char(8). The values are not constrained to printable characters.
> > You might try declaring it as numeric(18,0)
> >
> >
> > Regards,
> >
> > Ann
> > www.ibphoenix.com
> > We have answers.
> >
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > ib-support-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
>