Thanks for the reply Steve

I ended up working it out :oP

Amazing how 'string' and 'string   ' don't match :oP

one TRIM(...) later, and all was hunky dorey.

Nice to know there are other Oracle users on cfaussie ;o)

Cheers,

Mark

------------------------------------------------------------------
[EMAIL PROTECTED]
ICQ: 3094740
Safe From Bees
[ www.safefrombees.com ]


Quoting Stephen Bosworth <[EMAIL PROTECTED]>:

> We use similar code to below and it works fine.
> 
> Procedure getNumberOfLogins(
>                        t_employeeNumber in Varchar2,
>                        t_application in varchar2,
>                        r_count OUT number
>                        );
> 
> -- body
> Procedure getNumberOfLogins(
>                         t_employeeNumber in Varchar2,
>                         t_application in varchar2,
>                         r_count OUT number
>                         ) IS
> 
> BEGIN
>                    r_count := 0;
> 
>          select count(*) into r_count
>               from login
>               where
>               upper(login.employeenumber) = upper(t_employeeNumber)
>               and
>               upper(login.application) = upper(t_application);
> 
> END getNumberOfLogins;
> 
> Cheers,
> Steve
> >>> [EMAIL PROTECTED] 6/11/2003 2:37:45 pm >>>
> Hey all,
> 
> I've got a simple stored procedure I'm calling - and the SQL returns the
> right results, but no 
> matter what I seem to do it returns '0'.
> 
> Basically it recalls how many times a user has logged in (which is stored on
> a table) nothing 
> fancy there:
> 
> The code is the following:
> 
> -- declaration
>   Procedure getNumberOfLogins(
>                        t_employeeNumber in Varchar2,
>                        t_application in varchar2,
>                        r_count OUT number
>                        );
> 
> -- body
> Procedure getNumberOfLogins(
>                         t_employeeNumber in Varchar2,
>                         t_application in varchar2,
>                         r_count OUT number
>                         ) IS
> BEGIN
>       DECLARE
>          CURSOR c_logins is
>          select count(login.idlogin) as loginCount
>               from login
>               where
>               upper(login.employeenumber) = upper(t_employeeNumber)
>               and
>               upper(login.application) = upper(t_application);
> 
>       BEGIN
>               open c_Logins;
> 
>               fetch c_Logins into r_count;
> 
>               close c_Logins;
> 
>       END;
> END getNumberOfLogins;
> 
> The weird thing is - the variables are being passed fine, but if change the
> 't_employeeNumber' 
> and the 't_application' to hard coded values, the script returns the correct
> values.
> 
> I'm sure I'm missing something small on this - but I just can't see it :oP
> 
> TIA
> 
> Mark
> ------------------------------------------------------------------
> [EMAIL PROTECTED] 
> ICQ: 3094740
> Safe From Bees
> [ www.safefrombees.com ]
> 
> 
> 
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Stephen Bosworth
> Application Development and Integration
> Communication and Information Services
> The University of Newcastle, Australia
> Phone: 02 4921 6574
> Fax: 02 4921 7087
> Email: [EMAIL PROTECTED]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
> 
> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> http://www.mxdu.com/ + 24-25 February, 2004
> 
> 
> 

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to