4 ms·
While we're sharing horror stories... I once encountered a stored procedure that returned HTML in a result set. It literally created the UI of a webpage. It
by dos1 15y ago
While we're sharing horror stories...
I once encountered a stored procedure that returned HTML in a result set. It literally created the UI of a webpage. It returned several columns of HTML that the app would place in strategic parts of the page. Well, as years went by, the app required a more innovative and web 2.0 UI. Rather than remove the HTML from the sproc, more columns were returned with more HTML, Javascript and the like. One time I had to fix some Javascript that rendered on the page. When I finally found where the errant JS was coming from, I realized I had to file a database change ticket to fix the UI :)
- spydum 15y agoSounds like Oracle's Portal product?
- thwarted 15y agoI had a boss one time who, rather than write a CGI, would write SQL statements against oracle to format the results as HTML. Things like select '<table>' from dual; select '<tr><td>'||column1||'</td><td>'||column2||'</td></tr>' from dual;
- jarek 15y agoAt least some versions of Sybase SQL Anywhere have a small HTTP server built in. Specially named/declared stored procs return HTML. I've built a smallish web app based on one, complete with Ajax touches. It was fun for one of my first programming jobs, but I don't know how maintainable it ended up. On one hand, at least your logic is close to your data... on the other hand, oh my god.
- einhverfr 15y agoI once joked (as an April fools joke) about writing an HTTP server as a stored procedure on PostgreSQL (that would mean patching PostgreSQL to run as root since only root can listen on port 80). You can read the email at http://ledger-smb.1045705.n5.nabble.com/Announcing-the-Development-of-LSMB-RDE-td2242754.html http://ledger-smb.1045705.n5.nabble.com/Announcing-the-Devel... Unfortunately people thought I was serious and I still get questions about it. Reading this thread I am starting to understand why....