How to force a numeric value into a string?

43 views
Skip to first unread message

Ion Dijkstra

unread,
Feb 12, 2015, 10:34:22 AM2/12/15
to oracle...@googlegroups.com
Hello,

I'm doing a program in which you have to upgrade a users password. This password will need to contain enlist one number among other conditions I've already done. However I can't get to it.

"password" is the one to contain a number on it. Here goes my program: 



delimiter //

  drop function if exists login;
  
Create Function login (nombreusuario varchar(20), password varchar (10), repite varchar (10), vieja varchar (10))

Returns boolean no SQL

begin
      /* Comparar los valores nombre y password con los reales */ 
       declare comparacion varchar(30);
  declare compa varchar(30);
  set comparacion = (SELECT nombre
                     FROM usuarios
                     WHERE (nombre = nombreusuario)) ;
       set compa = (SELECT contrasena                   
 FROM usuarios
                     WHERE (nombre = nombreusuario)); 
  
     if (comparacion = nombreusuario) and (compa = vieja) and length(password)>=6 and (password = repite) then 
    
   /* Hacer el UPDATE  */
        UPDATE usuarios 
SET contrasena = password
WHERE nombre = nombreusuario;
        /*Como es verdadero devuelve verdadero */
        Return TRUE;
     else
        Return FALSE ;
     end if;
end
//

delimiter ;



¿What should I add to the program?

My thanks.

Michael Moore

unread,
Feb 12, 2015, 11:39:02 AM2/12/15
to oracle-plsql
This does not look like PL/SQL to me. What computer language are you trying to use?

--
--
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle...@googlegroups.com
To unsubscribe from this group, send email to
Oracle-PLSQL...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

---
You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oracle-plsql...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages