cancel
Showing results for 
Search instead for 
Did you mean: 

hosting complete website in DB (Sql Anywhere)

Baron
Participant
1,860

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?

Accepted Solutions (1)

Accepted Solutions (1)

Baron
Participant

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!!

Vlad
Product and Topic Expert
Product and Topic Expert

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 🙂

Breck_Carter
Participant

> 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 🙂

Baron
Participant
0 Kudos

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

VolkerBarth
Contributor
0 Kudos

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

Breck_Carter
Participant

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

Breck_Carter
Participant
0 Kudos

> 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 🙂

Breck_Carter
Participant
0 Kudos

...one mustn't forget CSS, that's another scripting language in itself ...

Answers (1)

Answers (1)

Breck_Carter
Participant

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 🙂