Subject | Re: Incompatible column/host variable data type. |
---|---|
Author | Sergio |
Post date | 2011-02-04T11:58:53Z |
> Huh? I'd say your query does the opposite:Hi Set!! As usual, THANK YOU VERY MUCH for the detailed answer!!
What I want, is to warn the user. If the query returns one or more records I should display someting like this:
"Hey!, there's already one (at least) record with the same name *OR* the same address *OR* the same phone (etc...) are you sure, the customer you are adding isn't in the table yet??"
if the user, lets say, leave the phone field empty, I don't want to test it because he/she would get a warning if there's already another record without phone.
I hope I'm clear now!! And if my query is still wrong (or not the best way to do what I want), I'd LOVE to hear your opinion!
And returning to the original qustion, here I add the table structure:
CREATE TABLE CLIENTES_ASEGURADOS (
ID ID /* ID = NUMERIC(9,0) NOT NULL */,
ID_CLIENTES FK_ID /* FK_ID = NUMERIC(9,0) */,
NOMBRE DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
DIRECCION DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
CODIGO_POSTAL CODIGO_POSTAL /* CODIGO_POSTAL = VARCHAR(10) */,
LOCALIDAD DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
CONTACTOS DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
TELEFONOS DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
FAX DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
EMAIL DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
PAGINA_WEB DESCRIPCION /* DESCRIPCION = VARCHAR(150) DEFAULT '' */,
CUIT CUIT /* CUIT = VARCHAR(15) */,
DESCUENTO PORCENTAJE /* PORCENTAJE = NUMERIC(8,3) DEFAULT 0 */,
ID_CONDICION_VENTA FK_ID /* FK_ID = NUMERIC(9,0) */,
NOTAS NOTAS /* NOTAS = BLOB SUB_TYPE 1 SEGMENT SIZE 80 */,
FECHA_DE_ALTA FECHA /* FECHA = DATE */,
ID_PROVINCIAS FK_ID /* FK_ID = NUMERIC(9,0) */,
ZONA DESCRIPCION_CORTA /* DESCRIPCION_CORTA = VARCHAR(30) DEFAULT '' */,
CODIGO_AGRUPACION CODIGO /* CODIGO = VARCHAR(30) DEFAULT '' */,
ID_CONDICION_IVA FK_ID /* FK_ID = NUMERIC(9,0) */,
ID_EMPRESAS FK_ID /* FK_ID = NUMERIC(9,0) */,
NUMERO NUMERO_DOC /* NUMERO_DOC = NUMERIC(18,0) DEFAULT 0 */,
CODIGO CODIGO /* CODIGO = VARCHAR(30) DEFAULT '' */,
VIGENCIA FECHA /* FECHA = DATE */
);