Web Service

Y

yovys

Hi
When I use a web services to populate a listbox, If I use a "union" in the select, the value appear in blank, otherway, if use only select the values is good. why?
 
S

Steve van Dongen [MSFT]

Hi
When I use a web services to populate a listbox, If I use a "union" in the select, the value appear in blank, otherway, if use only select the values is good. why?

You'll have to look at your webservice code. You probably have
invalid SQL in the UNION case but are handling the error in such a way
that it is never seen.

Regards,
Steve
 
S

Steve van Dongen [MSFT]

You'll have to look at your webservice code. You probably have
invalid SQL in the UNION case but are handling the error in such a way
that it is never seen.

The output recordset must have identical column names/case as the form
was originally designed with. Hypothetical example... If you designed
your form with this query:

SELECT DISTINCT NOMBRE, RUC, DIGITO_VERIF,
tipcontrib,tipo_prov,enpat FROM BENES ORDER BY NOMBRE

and then changed it to this:

SELECT ' No aplica' nombre, '' Ruc, '0' DIGITO_VERIF, '' tipcontrib,
'' tipo_prov, '' enpat UNION SELECT DISTINCT NOMBRE, RUC,
DIGITO_VERIF, tipcontrib,tipo_prov,enpat FROM BENES ORDER BY NOMBRE

The case of the first 2 columns is different. The resolution would be
to make sure the case is the same.

SELECT ' No aplica' NOMBRE, '' RUC, '0' DIGITO_VERIF, '' tipcontrib,
'' tipo_prov, '' enpat UNION SELECT DISTINCT NOMBRE, RUC,
DIGITO_VERIF, tipcontrib,tipo_prov,enpat FROM BENES ORDER BY NOMBRE

Regards,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top