Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 :)



I 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;


At 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.


I 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-Devel...

Unfortunately people thought I was serious and I still get questions about it. Reading this thread I am starting to understand why....


Sounds like Oracle's Portal product?


I would guess Oracles mod_plsql


It was a custom built web app that had grown over the course of ten years or so. It was actually a fairly heavily trafficked web site, and this was a particularly old piece of it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: