- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
In our multi-layered application, we rely on Hibernate to do all CRUD work. The business logic is kept in a remote service hosted on a Unix box. The front-end is browser based. I personally am not sold on stored procedures being useful. This approach allows us to change tiers or layers as we want. The DB is simply a data source only.
Admin
I know that T-SQL and PL/SQL can run outside of procedures. I've never done it with T-SQL, but I've done it with PL/SQL. It's an old trick of the trade, with its valid uses (and many abuses).
That does not make them SQL. SQL is SQL, a declarative language for writing deciders on finite input and with limited control structures for transactions and data definitions.
The programming constructs, including control structures, found on T-SQL are not SQL. Furthermore, an Ada-like, module capable language like PL-SQL cannot qualify as SQL, either. How about a store procedure written in Java? Would that be magically be SQL just because?
That you can piggy-bag a vendor-specific stored procedure written in a Turing complete language like PL/SQL through a SQL statement, that does not make the whole thing SQL, either.
A database engine can receive an string encoding either a SQL statement, or a program construct written in a vendor's specific stored procedure language, or a combination of both (a combination ruled by a SQL standard from trampolining into a stored procedure call AND vendor specific syntax for doing so). And it can execute it if the construct if valid. But that doesn't turn whatever you put into that string into SQL.
SQL is not defined as a capability to send a string to a possibly remote relational database engine and have it execute there.
Let me give you an example: This would be akin to me pasing control to a a library written in C from Java via JNI and claim that the library itself is Java. By virtue of it be written in C, I can do things within the library that are impossible with Java. And if I don't preserve certain invariants, I can break the calling Java program. This is an example of crossing domain boundaries - from one trusted domain into an untrusted one, hoping that the untrusted one preserve certain invariants.
Likewise, I can do things within a stored procedure that makes it impossible for a calling SQL statement to halt, to act as a decider. Again, crossing domain boundaries, from a declarative, set-oriented one (SQL) into one that is vendor specific and that has never been fully defined in SQL (because it is pretty much impractical if not impossible.)
Now, if you are using the term "SQL" to refer to
then
by YOUR (really, yours) definition of "SQL" you would be right in saying you can use SQL to implement anything that can be implemented in a stored procedure.
The problem is that it is not the standard definition of SQL; that is not what people universally refer to as "SQL", either academically or in the real world. I've never seen anyone (in academia or industry) referring to vendor-specific stored procedure program language constructs when referring to (or as part of) SQL.
If that's how you define and see SQL and that works well for you, that's great. Just understand then that people in general will disagree with you (or misunderstand you) because you are using "oranges" to describe "apples and oranges" (and the fruit salad made thereof) when everyone else is using "apples" and "oranges" (and "orange and apple fruit salad") in a manner that is commonly understood.
Peace.
Admin
Regardless of my loose use of the term, my posts would have made no sense with the strict definition of SQL. Wouldn't it have been easier to start with a criticism of the terminology rather than attack the conclusions?
This is the problem with any discussion of stored procedures. Those who believe that stored procedures are the only solution will do anything to avoid listening to the truth that they are only one of several technologies to accomplish the goal. I can build an application that is fast, manageable and secure both with or without stored procedures. I use them when they make sense and ignore them when they are counter-productive. There is absolutely no goal that can only be attained throug a stored procedure. I take all of these attempts to derail the conversation as an admission of defeat.
Admin
So you advised people to ditch stored procedures completely. You provided no evidence that your solution is better; you didn't even establish any form of measurement by which to compare the two solutions. That's why so many people jumped down your throat about it. "My experience tells me X is better than Y" is not a convincing argument. It is flamebait.
Admin
Admin
BTW, I think he's wrong about a DB only being a data source. I also think that writing vendor agnostic SQL virtually gaurantees less than stellar results. But I am more than happy to use his statements as a launching point to speak to those who think stored procedure are the only way to go. My biggest argument for moving as much logic as possible out of the physical data tier is that databases are hard to scale while middle tier servers are easy to scale.
Admin
Before I lost you it sounded like you were saying your opponents' collective belief is that stored procedures are the only solution. But it seems to me that few of the people with whom you've actually been arguing have made that case. In fact, luis.espinal and I have been arguing with you this whole time simply because of a misunderstanding over your terminology.
I'm just saying...
Admin
Addendum (2011-01-28 16:52): *wording, not working
Admin
Admin
Clear to you maybe.
At the end of the day "ad-hoc" means something you can make on the fly. SQL means... well, SQL. And "ad-hoc SQL" means... well, a SQL statement created on the fly. And nobody, nobody uses SQL to mean either ANSI SQL (or vendor specific SQL) in addition and combination to vendor specific store procedure language constructs.
The only thing unclear until now was the origin of your atypical usage of the term "SQL" and "ad-hoc SQL" and the confusion about whether that atypical usage is done 1) for a purpose unbeknown to us, 2) a new technical trend, 3) because of a posting accident (we all do that), or 4) you don't know what you are talking about.
Even if it is clear that you are using SQL to mean "anything" including the kitchen sink, it is not clear why you (or anyone) would use such an obtuse definition in lieu of a definition that has universally been used for effective communication of what SQL is for the last 4 decades.
That's why nobody understand what you are talking about, and why anybody (not just me) is ranting. It makes no sense and serves no useful or practical purpose beyond your need to redefine an industrial term to make your proposition satisfiable. That which you did is a WTF.
The existence of a context does not imply its validity or usefulness. An invalid or illogical context does not warrant attention. You don't like that response from readers of your post, then build logically valid contexts. That's akin to building an improbably edge case to attack the validity of a general purpose solution to a particular problem. Gee, you win, here have a cookie.
Not loose. Incorrect. Non-standard. Confusing. Without apparent useful communicating purpose.
Not just strict, but standard and universally accepted in technical discussions, ergo correct.
Gee, I thought I did (see below)
Attacking a conclusion is perfectly valid when the terminology is unclear (and in your case obtuse, non-standard... and wrong when it comes to standards.) Not to mention that I did criticize your terminology (see above.)
I'm sorry, but I never engaged in a discussion on the validity or invalidity of stored procedures as my original post was about ORMs making stored procedures obsolete and unnecessary. If I did engage in a discussion on the validity or invalidity of stored procedures point out the post where I did so.
As it is, the discussion between you and me is about your continuous and extensive usage of the term "SQL" and "ad-hoc SQL" in a manner distinct from what has been typically been used for the last four decades.
Nice strawman (possibly crossbred with an Ad hominen). I challenge you to quote me anywhere where I've said or stated that stored procedures are the only solution, in this thread or in any thread. I challenge you. If that statement is not being directed at me, then that statement is out of place with respect to the discussion we are having (your usage of the terms "SQL" and "ad-hoc SQL")... it would be again another statement out of context (or with an unclear/invalid/malicious/fallacious/superfluous context.)
That's a fine statement, so fine it would have brought me to tears of joy had it been the topic of discussion. It is not.
It is a red herring. It is not what is being argued about, and it is not an argument that I've made any reference of (in pro or in con) in this specific discussion (or in this thread.)
Fine statement. Fine red herring. Certainly a fine oxymoron, a redundant statement of the obvious. Point to where I've made any argument for or against that in this thread to you or anyone and you'll win a fine kindergarten shinny star sticky for being such a good boyscout.
You have made a series of strawmen and red herrings thorough your reply, so to talk about derailments (and to weaselly imply that questions to the validity of your statements amount to derailments) feels a little bit like a black pot and a black kettle feverishly discussing about their shared ability to absorb all frequencies of light.
Perhaps you might feel like redefining the statements in my reply as a "derailment" in the same way you redefined "SQL" and "ad-hoc SQL" mistakenly (or purposely or ignorantly, only know).
And since the interpretation of such statements... I mean "derailments" can only be taken in a melodramatic way as an admission of defeat at your sole, solemn, imperious and infallible discretion and interpretation (however illogical that might be), who am I to argue against your glorious triumph?
You have teh winx0r by last man standing. Congratulations.
Admin
I actually worked in the Adult Entertainment Industry as a Web Developer for almost 3 years, it's on my resume. Every damn job i go to the people ask me "So i've never known anyone who worked in the porn industry." or "Tell me about the porn industry!!!". First time I went job hunting after that job, i got 9 offers out of 10 interviews I sent to.
Admin
CnC Dirge BigJim sql guy M will Design Pattern
Not spam, not spam, not spam.
Admin
Admin
Wait, what were you trying to prove with the above comment?
Admin
Every poster above seems to hold at least one of these beliefs.
Admin
Admin
Admin
Admin
For the second time in a row I'm asking you to quote the post I've made where I've stated any the beliefs that you just listed. I'm waiting.
You listed a bunch of people who made those arguments. Having said you also mentioned a same veiled accusation when you replied to me (in the second to the last of my posts that you replied to.)
That was in your reply that you address to me, as a reply to a post I addressed to you. Explain to me what post I've made that states that which you are pointing at. I'm waiting.
Admin
If you call that explaining.
As to Jamie:
The link you point to Atwoods' post only discusses a balanced between ad-hoc SQL (which is not defined anywhere as you do) and stored procedures.
Quote the text in Atwood's post where he defines ad-hoc sql as you did.
Where does Bouma in his post defines ad-hoc sql as you did? All he does in his post is provide the same balanced view of using ad-hoc SQL (SQL that you can execute verbatin off to a remote database engine) vs stored procedures. No arguments there.
I've not argued anything against Atwood's or Bouma's POV on the subject. It is not an argument I've made, nor one that is in contention.
Doing a google on ad-hoc sql and linking and misquoting programming personalities is simply an appeal to authority (and a poorly made attempt at that.) Again, the ability to piggy-bag vendor-specific constructs that are not part of SQL in any liberal interpretation of the dialect does not make it SQL, the declarative language that goes by that name.
You did not make you context clear at first. And you stuck by it as the argument went by without stopping until many posts later to explicitly define it. Only later you introduced the term ad-hoc SQL. And ad-hoc SQL in the general sense of the world, as applied to all RDBMS, not just MSSQL simply means what I told you before: SQL run ad-hoc.
And people jumped on it because we don't know whether you use that liberal interpretation of what SQL is (the term you previously said was as powerful as any stored procedure language) because you made a mistake in typing or don't know what you are talking about.
Nothing on that is predicated in your false, red-herring argument that we (whoever 'we' that is) believe stored procedures are the alpha and omega of it all.
Couple that with your infantile "I take all of these attempts to derail the conversation as an admission of defeat" (on an argument of SP being supreme, something I never made), it paints a very silly picture.
If you still don't get that, that's on you, not me or anybody else.
Admin
You simply sidelined the conversation into SQL vs. T-SQL, a sideline based on a simple misunderstanding. Let it go. BTW, if you don't hold any of those seven beliefs, then you have the same opinion as me. Why call me out, but not call out any of those who have actual substantially differing opinions?
Admin
Also, stop getting offended that my rants were in responses to your posts. We are conversing in public, not private. It is tiresome to break each thought into a separate response post, so I sometimes tack these little rants onto the end of specific responses. I do use language to attempt to clarify the audience, such as "Those who". In order to feel that comment is directed at you, you must first self-select as one of "Those who". Are you?
I have had the stored procedure discussion many times and it always seems like I'm aiming at a moving target. That specific statement was an attempt to get the discussion back on focus. This whole SQL vs. T-SQL thing is like focussing on the bacteria on a flea on an angry lion. Drop it. We didn't connect, but it is resolved now.
Admin
I admit, it's crazy to turn the guy down on that basis, but it would be just as crazy to hire him because of it.
I think most of us would rather work with competent bores than incompetent "characters"...
Admin
FTFY
Admin
Admin
Admin
Altogether, in this altercation, you came off as the guy with the religious view that stored procedures are evil (yes, I know, you never said that, it's just the impression your tone generated) and the reality-distortion field.
Calm down a little and when somebody calls you out on your wrong terminology, say "Oops, my bad" and don't claim to be the winner when they finally make it clear that their issue with you is terminological.
Peace.
Admin
Well, hopefully, the recipient will have arranged e-mail forwarding with the Post Office so that doesn't happen.
CAPTCHA: validus: the sword used by a Roman validator.
Admin
Bull. When recruiting, you are trying to find someone who will be an asset and who will get along fine with the rest of the team. A previous job in the pornographic industry would tend to indicate fairly low moral standards, and bringing this experience in a recruitment interview for a programmer position demonstrate a lack of common sense.
It's not relevant, and for *** sake's, if that was his most interesting job and his past programming jobs were boring to him, what is he doing applying for a job at a software company?
So, if low moral standards and lack of common sense are not valid grounds for rejecting a candidate, what are?
Admin
That's because France was part of Germany when Germany was in the process of becoming more racially homogenous.
Admin
Admin
I solved this with linq by creating the tree manually using the linq.expression namespace. Not so cool in contrast with using linq sintatic sugar, but it will do the job. And the sql are generated only to filters set istead of superduper non-optimizable convoluted logic expression.
Admin
will's error was that he thinks not using stored procedures creates extra round-trips. That is false. I'm certain that this means that he will recommend stored procedures are the best answer to a category of problems where it is simply not true. This is why his post is included in the list. I admit that only one or two on the list are completely on the "always use procs" bandwagon, but that's still one or two. The others are recommending procs in specific situations where they have zero benefit. I'll bet 100 people who read this thread work in shops where not using stored procedures will get code rejected.
Unfortunately, most of the bandwidth in this discussion has been spent on the definition of the acronym "SQL" (and in one case "falsifiable" vs "disproven"). I tried to get off it by admitting defeat several times, but it still won't go away. In truth, I don't really think I was wrong. SQL can be a specific term that is applied only to those topics addressed in ANSI SQL (SELECT/INSERT/UPDATE/DELETE), or it can mean database languages that have grown from it, like T-SQL or PL/SQL. It's hard to argue that Transact-SQL isn't a variant of SQL, given its name.
As for my tone, I'm actually hoping it will cause someone to take up the challenge. I've specifically called out at least seven people who hold pretty widely held beliefs. Unfortunately, all I got out of it was a bunch of people who fundamentally agree with me nit-picking terminology.
Admin
"Atomic" in this context doesn't refer to the physical concept of atoms, but rather the name itself, given due to the same attribute as was once believed physical atoms posessed; "atomos" is Greek for "cannot be cut".
Admin
So you are not against the "procedure" part, you are against the "stored" part. So everything's fine if you drop the procedure afterwards? Wow.
Admin
This post was about "is it possible", not "is it a good idea".
Admin
Similarly, when interviewing for a graduate trainee:
Question "How would you describe polymorphism?"
Answer (in a broad Scots accent) "Aw aye, that's when it kind ae like spreads oot aw ower the page like, eh?"
It does sound like he might actually have seen The Enterprise Dependency but we were looking for something a bit more technical.
Admin
I was only taking a friendly jab at you (at the time) for implying that falsifiability was a bad thing. It was in no way previously an extensive debate as you seem to characterize it in the comment above.
Non-falsifiable statements are a detriment to intelligent discussion; implying that the difference between "falsifiable" and "disproven" is trivial or even "nit-picking" demonstrates a real misunderstanding of proper argument on your part, and should have indicated to me early on that I'd better back out of the discussion altogether.
I strongly urge you to read up on falsifiability and it's importance in scientific discussion and debate. I sincerely believe it could improve your arguing abilities, and maybe even help you to avoid some of these side arguments you frequently tend to be a part of.
As for the discussion on SQL, I have already backed out; it isn't going anywhere, and I don't have time for it any more.
Admin
I started a discussion here
Can I not start a discussion?
Admin
Another win for stored procedures is over things like views that have nested subqueries. Sometimes the internal optimiser can't pass a WHERE clause through to the inner query, so the view runs very slowly. With a stored procedure you can filter the inner query directly with a parameter which can massively speed things up.
I assume you aren't against views as well?
As long as you don't have dynamic SQL in your procedures they should be immune to SQL injection. But then so will ad-hoc SQL as long as you use parameters and don't make the newbie mistake of building SQL strings by simply concatenating variables. But as a DBA do you want to put the security of your database at the mercy of application developers who might not understand SQL security issues so well? Clearly it can be done in other ways, but I would argue they aren't as good. Encapsulation of your database (to borrow an OO term) is always a good idea. This is very true in my experience. If you have a fixed set of ways to access the database you only have to go through them and check performance and indexing is all set up OK for them. If you have ad-hoc SQL statements hitting the server that are possibly changing over time without your knowledge, the only way to do it is to put on a SQL trace recording every query hitting the server (maybe over a certain time threshold) and trawl through them looking for problems. This seems obvious - how would you fix a data access bug that was in client code without re-deploying it? Very true in my experience. Simply give EXEC permissions to the application user on a fixed set of stored procedures. Much easier than setting various SELECT, UPDATE, DELETE, INSERT permissions on hundreds of individual tables. Especially if the database schema is evolving over time. Again, true in my experience. Especially if you have two teams working together, one for database and one for front-end code. Decoupling your data access and your presentation front-end is a good idea, with a fixed and clearly defined interface of stored procedures between the two.Admin
Possibly when your application has some kind of caching going on and needs to know when tables have changed content? I'm sure there are ways round that problem though.
Admin
asdglkm al;kwe gakwle g [email protected]
Admin
Admin
Nagesh=Troll (do not feed)
Admin
No. We will also accept a picture of a spider.
Admin
And when they informed the other applicant, is that what they told her... ?
Admin
Selection bias. By putting it on your resume, you only heard from people who either were not opposed to the porn industry or were so vehement in their opposition to the porn industry they called you just to rant at you. However, since I assume we're talking about businesses here, rather than churches, it's unlikely you got many of the latter.
Also, your experience is completely relevant to IT: for three years, you worked in what is perceived by many to be the most demanding of all web developer jobs. (I've looked at a few porn sites - for a time I helped administer a friend's website on a server that also served some porn, and I got to see what crap code and crap security they can spew. So I'd agree that a porn server administrator is probably going to be reasonable to high quality. But a porn web developer may be stellar, or may be crap, and you can only tell by checking out the work product.)
Admin
Dat's easy. You're human.
See, the vast majority of people posting stuff on the Internet are either computers or humans. The computers usually do their best to not stand out, so they wouldn't ask others what race they are.
The dogs and cats (and occasional monkey) posting aren't nearly as adept with English and typing{1} as you apparently are. The dwarves, elves, gnomes, sylphs, kzinti, nymphs, demons, mermaids, dragons, dopplegangers, tauren, kobolds, goblins, gremlins, xorn, hooloovoos, elementals, kraken, and pretty much all other fantasy creatures that you see online aren't really real - they're generally computers or people pretending to be fantasy creatures.
{1} Not to imply that all humans or computers are adept with English. Most humans or computers who are active on the Internet are adept in at least one language, but it is not always English. And some seem to not be ept in any language.
Admin
I agree, I was in a similar situation, but luckily the interviewers re-phrased the sentence, and I caught on and changed my answer rather quickly. I got the job!!! Glad they didn't pull a dick move too, otherwise I may be in the same boat as him......
Admin
jezisku, napis to tam vole