Ver Mensaje Individual
  #4  
Antiguo 18-06-2007
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Reputación: 23
maeyanes Va por buen camino
Primero tienes que declarar la UDF SUBSTR, esto lo haces así:

Código SQL [-]
DECLARE EXTERNAL FUNCTION SUBSTR
  CSTRING(80) CHARACTER SET ISO8859_1,
  SMALLINT,
  SMALLINT
RETURNS CSTRING(80) CHARACTER SET ISO8859_1 FREE_IT
ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf';

Luego puedes hacer una consulta del tipo:

Código SQL [-]
select * from Tabla where SUBSTR(Campo, 1, 10) = 'ABABAG5004'

Con esto te debe devolver todo los registros cuyo valor en el Campo inicie con la cadena especificada...


Saludos...

Última edición por maeyanes fecha: 18-06-2007 a las 20:03:41.
Responder Con Cita