Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/09/2012, 13:27
afuentealba
 
Fecha de Ingreso: abril-2012
Mensajes: 65
Antigüedad: 12 años
Puntos: 0
Respuesta: saber si el registro existe

Arregle lo que decias:

Código PHP:
$sql="BEGIN pk_carvig_user.p_validauser('".$idf_usuario."'"
                                                     
.",:po_sw, :po_texterr, :po_existe); END;";
                            
                            
$stmt OCIParse($conexion->conecta,$sql);
                            
OCIBindByName($stmt,":po_texterr",&$po_texterr,256);
                            
OCIBindByName($stmt,":po_sw",&$po_sw,256);
                            
OCIBindByName($stmt,":po_existe",$po_existe,256);
                            
ociexecute($stmt);
                            
ociexecute($po_existe);

if(
$po_existe == '1'){

echo 
"esta duplicado";



Código SQL:
Ver original
  1. PROCEDURE P_VALIDAUSER       (  PO_EXISTE           OUT NUMBER,
  2.                                 PI_USRSYS_ALIAS     IN VARCHAR2,
  3.                                
  4.                                 PO_SW               OUT NUMBER,
  5.                                 PO_TEXTERR          OUT VARCHAR2)IS
  6.  vl_valor NUMBER;
  7. BEGIN
  8.  
  9.      BEGIN
  10.                                 --OPEN PO_VALIDAUSER FOR
  11.                                     --  VALIDA ID Usuarios del sistema
  12.                                  
  13.                                     SELECT COUNT(1)
  14.                                     INTO vl_valor
  15.                                     FROM TCARVIG_USRSYS
  16.                                     WHERE USRSYS_ID = PI_USRSYS_ALIAS;
  17.  
  18.                                   IF vl_valor > 0 THEN --el registro existe
  19.                                     PO_EXISTE:= 1;
  20.                                   END IF;
  21.                                  
  22.                                
  23.      END;
  24.  END;

Ahora me da el siguiente error

Cita:
Warning: ociexecute() [function.ociexecute]: ORA-06550: línea 1, columna 22: PLS-00302: el componente 'P_VALIDAUSER' se debe declarar ORA-06550: línea 1, columna 7: PL/SQL: Statement ignored in C:\AppServ\www\registro\registro.php on line 226

Warning: ociexecute() expects parameter 1 to be resource, null given in C:\AppServ\www\registro\registro.php on line 227