Re: Select Into problem

From: tzadkiel <tzadkiel_at_surfnetcity.com.au>
Date: 1998/03/09
Message-ID: <01bd4b03$d4e4ee40$85ce6ccb_at_default>#1/1


lose the chr(39). the quotes are implicit when referring to a pl/sql variable.

Mark Cudmore <mcudmore_at_kamloops.env.gov.bc.ca> wrote in article <1998Mar6.141635.9992_at_vmsmail.gov.bc.ca>...
> I have the following code in a Post_query trigger for the block
>
> DECLARE
> user_name varchar2(08);
> criteria varchar2(10);
> counter number(2);
> BEGIN
> --Gets the current user
> user_name := GET_APPLICATION_PROPERTY(USERNAME);
> criteria := CHR(39) || user_name || CHR(39);
> --Checks to see if user is in the admin table
> SELECT COUNT(*) INTO counter FROM TABLEA
> WHERE user_id = criteria;
>
> MESSAGE('Counter: ' || TO_CHAR(counter));
>
> END;
>
> Here is the contents of the table...
>
> USER_ID
> --------
> SIR
>
> Now when I log on to the application with the user name of SIR, I should
> return a count of 1 through the above select into. I am checking to see
 if
> that user_id exists in the column. For the life of my I can't figure out
> why "counter" is returning zero, when I am expecting one??? I've been
> staring at that piece of code all afternoon, so I if you have any
> suggestions, let fly!!
>
> --
> Mark Cudmore
> email: mcudmore_at_kamloops.env.gov.bc.ca
>
>
>
>
  Received on Mon Mar 09 1998 - 00:00:00 CET

Original text of this message