Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#828192
Hi.
I'm trying to load a dropdown with data from an external DB (SQL Server 11), but this error shows up and won't let me continue.
issue.png
issue.png (5.61 KiB) Viewed 454 times
I'm already using data from this DB in another form with another query, however, in this specific case, I have the error.
Can someone help me?
Thanks.

That's the query (in HeidiSQL it works just fine):
Code: Select all
SELECT Forneced.fornecedor, PessoaFJ.RazaoSocial FROM dbo.forneced
JOIN PessoaFJ ON PessoaFJ.empresa = Forneced.emppessoa
AND PessoaFJ.filial = Forneced.FilPessoa
AND fornecedor = pessoa
WHERE PessoaFJ.indativo = 'S'
AND PessoaFJ.IndFisJur = 'J'
AND forneced.empresa = @%EMPRESA
AND Forneced.TipoTributacao = 31
ORDER BY fornecedor
#828194
Hi,
Please use query like this:
Code: Select all
SELECT Forneced.fornecedor, PessoaFJ.RazaoSocial FROM dbo.forneced
JOIN PessoaFJ ON PessoaFJ.empresa = Forneced.emppessoa
AND PessoaFJ.filial = Forneced.FilPessoa
AND fornecedor = pessoa
WHERE PessoaFJ.indativo = 'S'
AND PessoaFJ.IndFisJur = 'J'
AND forneced.empresa = '@#EMPRESA'
AND Forneced.TipoTributacao = 31
ORDER BY fornecedor
Please check the following link:
pmlearning.info
#828198
programerboy wrote:Hi,
Please use query like this:
Code: Select all
SELECT Forneced.fornecedor, PessoaFJ.RazaoSocial FROM dbo.forneced
JOIN PessoaFJ ON PessoaFJ.empresa = Forneced.emppessoa
AND PessoaFJ.filial = Forneced.FilPessoa
AND fornecedor = pessoa
WHERE PessoaFJ.indativo = 'S'
AND PessoaFJ.IndFisJur = 'J'
AND forneced.empresa = '@#EMPRESA'
AND Forneced.TipoTributacao = 31
ORDER BY fornecedor
Please check the following link:
pmlearning.info
Hi.
Thanks for your reply.
I tried your suggestion but it still doesn't work. Any other options?

The 500 Internal Server Error is the general catch[…]

Really very nice blog information for this one and[…]

This is a long, lengthy and cumbersome process. T[…]

Great read for when on the road. The book provides[…]