Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hi, I can create a webservice in DB and define its return type as HTML. Of course I can also write Javascript within the HTML too. My question, is it possible to host a complete website in the DB? Do I still need in this case PHP/ASP? What are the limitations in this regard?

asked 15 Oct '19, 14:10

Baron's gravatar image

accept rate: 48%


yes, you can.

but I don't know if this is a good idea. Breck wrote this article, and it is what you probably need:
I can tell you that some people in this forum like the idea of having web sites hosted in the DB, there are several advantages. I personally like using server-side languages/frameworks. Supportability is much better.

But this will be a holy war... so to avoid it, the answer is "yes, you can. The link to the blog is above".

(16 Oct '19, 07:29) Vlad

Well, Breck's product Foxhound is a complete website hosted in a database (at least AFAIK), so you may check that out... But as stated by Vlad, if that is reasonable for you will depend on your requirements, say whether the whole website is focussed on data retrieval (as in Breck's case) or not.

(16 Oct '19, 08:09) Volker Barth

Actually my website is almost whole website focused! I need it just to show/edit some configurations in the database. I dont have good experience with HTML/Javascript, so I will need the things one by one.

Just wanted to know whether there are theorically any limitations.

Thank you very much!!

permanent link

answered 16 Oct '19, 08:14

Baron's gravatar image

accept rate: 48%

converted 16 Oct '19, 09:03


No limitations. The question is the flexibility & supportability. If you are fine writing HTML code with SQL commands, and you can do this pretty quick... then why not. But if you like VS/VS Code/PhpStorm/WebStorm whatever.... maybe it is a bad idea :)

(16 Oct '19, 10:03) Vlad

> HTML/Javascript

Add HTML5 to that list, as in XMLHttpRequest to SELECT and UPDATE your database directly from inside your HTML code... mind-blowingly fast to execute, and mind-destroyingly hard to code and debug :)

(17 Oct '19, 10:09) Breck Carter
Replies hidden

But I think there should already be a ready tool to ecnapsulate HTML lines inside SQL-Code. Or at least one can find an own way for automating this job (let the select statement deliver the pure HTML content)!

(17 Oct '19, 10:16) Baron

let the select statement deliver the pure HTML content

Well, I guess Breck is talking about the possible requirement that the SELECT statement containing the HTML code itself might include script code to use XMLHttpRequest to call your own web procedures, cf. own of his according blog articles:

Calling Stored Procedures From HTML

Possibly "pure" but certainly not that easy to code and maintain...

(17 Oct '19, 10:56) Volker Barth

> there should already be a ready tool

Oh, yes, there certainly should be! :)

> one can find an own way for automating this job

When you find it, please let me know... I am not being sarcastic, not a day goes by when I don't think "there's gotta be a better way".

But... be careful... you probably have a "Real Job" to do, and that Real Job may have a limited budget for "Building Tools".

In the meantime, if you have some particular task that's giving you trouble, ask a question here... there may be some powerful SQL technique that can help... I might not have any tools to offer, but I've had to work out many techniques over the years.

(20 Oct '19, 14:51) Breck Carter

> I guess Breck is talking about

Exactly so. I was going to say "no" but then realized that's exactly what is going on... SQL-scripts-that-generate-HTML-scripts, even SQL--generating-Javascript-generating-HTML... it's not the quotes that cause the problems, it's the commas and the semicolons :)

(20 Oct '19, 14:56) Breck Carter mustn't forget CSS, that's another scripting language in itself ...

(20 Oct '19, 14:58) Breck Carter
showing 2 of 7 show all flat view

No holy war here :)

Limitation 1: If your database is already a CPU bottleneck then maybe loading client GUI logic into stored procedures will not be Happy Times For You... maybe you want to divide-and-conquer when it comes to assigning CPU cycles to CPUs.

Limitation 2: Other than the STRING and LIST functions (which are wonderful, by the way), SQL Anywhere doesn't offer much support for application developers to create that client GUI logic... there is no developer's IDE GUI for generating HTML via Watcom SQL... none... not even a little bit :)

For the record, Foxhound's big bottleneck is caused by multiple separate ODBC proxy procedure connections to target databases (max 100 per Foxhound dbsrv17.exe instance, with -gn set to 220). The HTML generation has never ever been a performance problem... but then again, Foxhound only ever has a handful of GUI users.

Historically, Foxhound has had its own share of Queries From Hell, especially when it comes to scrolling through gigabytes of historical data... but QFHs are part of Database Life, nothing to do with this topic :)

permanent link

answered 17 Oct '19, 09:59

Breck%20Carter's gravatar image

Breck Carter
accept rate: 20%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 15 Oct '19, 14:10

question was seen: 1,507 times

last updated: 21 Oct '19, 07:11