Pergunta

I'm new to Delphi, but im a old PHP and MySQL programmer.

I have a system that needs to be used on a desktop too, so I've created some stored procedures to list the queries from the database. The stored procedures just select and join tables to show it.

I'm using the zeos component in Delphi 7. It shows my tables in the db grid well, but I need to show the result from my stored procedure. I've tried to use the zstoredproc but it returns the error

PROCEDURE xxxxx cant return a result set in the given context

Please help me; I just want to show the data from the stored procedure in to a grid or combobox.

Foi útil?

Solução

Zeos cannot properly deal with multiple resultsets. I used to use Zeos for all my projects, but once my coworkers started using multiple resultsets, I was forced to look for another solution. Maybe it's not intrinsic to Zeos, but at least with the MySQL driver there doesn't seem to be a way to get it done.

If you use DBX, you'll be able to do it. It comes with Delphi, so that's a plus. Downside of that: it requires extra .dlls in your project.

Another solution would be to call a stored procedure that writes its results to a temporary table, and retrieve the results via a normal query. That's how I used to work around it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top