Welcome Guest, Not a member yet? Register   Sign In
PostgreSQL specific: Multiline SQL INSERT/UPDATE statements
#1

[eluser]Max Attila Ruf[/eluser]
Hello everyone,

I recently tried to contribute the code of CI with a tiny little piece, but it as it seems it did not make sense. The problem came from multiline queries.

In general this should not make any problems, but lets assume, that someone is writing long SQL code, and by long I mean at least 20 lines of code - i don't want to go into details here. So lets assume the code is an UPDATE query, with returning values (for such thing, you need to add the RETURNING keyword and an expression to the end of a query).
If this is an UPDATE query and I pass it as it is as an argument to the $ci->db->query(), i wont get the result, but the status of the query.

If I remove the newlines from the query, I get the expected result.

This is pretty annoying, same goes for the fact that i have to remove every newline from the query when i pass it to the function.

Wouldn't it make sense to handle multiline queries?

I know this is by far not the best solution, but does it not make sense?

https://github.com/EllisLab/CodeIgniter/...t-24175117





Theme © iAndrew 2016 - Forum software by © MyBB