| « Prev | Page 1 | Page 2 | Next » |
|
So basically, he uses a single-column table as (totally unnecessary) scratch space for this existence check, when he could have just as easily has run SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '?' [table_name]. Assuming he really needed to check if the table existed in the first place.
He'd better have a really good justification for this... |
Madness? |
Scarecrow? Ain't this new word? I am massaging my hands to gether to find what it menes. |
What if the disk where the XML file is stored is offline also. All access to metadata shall be done through a MetadataManager class (subclassed from a DataManager and, ultimately, an AbstractManager class) which maintains a list of MetdataManagerDriver objects that represent different ways in which the metadata can be stored: MetadataManagerXMLDriver, MetadataManagerDBDriver, MetadataManagerCSVDriver, MetadataManagerExcelCompatibleCSVDriver, etc... To prevent overloading any one storage medium, a different MetadataManagerDriver will be used for each method call to the MetadataManager. The algorithm for choosing which MetadataManagerDriverSelector to use per call (MetadataManagerDriverRandomSelector, MetadataManagerDriverRoundRobinSelector, etc.) shall be implemented in the MetadataManagerDriverSelectorMediator. Just hardcode all the config values for the MetadataManager right in the constructor for now. |
I ain't understanding this. |
Well, toshir0, I hope you're happy. Now he's "learned" a third word. |
This madarchod is bad version of imitating me. Atleast I have spell-checking feature in my browser all enabled now. |
I have seen code like this in real live production system. It is only for some special group of users, but each user having individual table that define rights and privileges. We found out after some user changes his single-sign-on identity name. Then lose all rights. This table never maintained, except by severe sql scripts kept in a Unix folder with label of IMP-DO-NOT-MESS-WITH-THIS. Then we discover reason for lost rights for that user. This is still the way the system is running. This is system in place for client in Canada. Not develop by Indian programmers, but now being maintain by us only I could never make this story anonymous, so I not submit it to WTF |
enum UniverseIsThere (is, ain't, FileNotFound); Kant compile. Must the ' marke be require for spell ain't? Pls send me the corect codez. Pls do not ignore becuse I know you are think "bad Nagesh I punnish him by ignore" but even so you are think about Nagesh so I win. |
You do realize that a DBMS will routinely create temporary tables to execute large SELECT queries, right? There is absolutely nothing wrong with generating temp tables to handle your work, especially if they're only visible to your transaction. For handling really large modifications to a table, often the best way to do it is through a CREATE ... AS SELECT because the DBMS doesn't have to do any locking: no one else can possibly access that table because it hasn't been created yet. Certain systems absolutely do, for legal reasons such as provenance and auditing, require a fixed schema. Many don't. The only good reason not to do DDL in a system that doesn't have a legal restriction on the schema is your concurrency model. Oracle, for instance, isolates DDL from transactions. That is, (BEGIN DML DDL DML COMMIT) is quietly changed to (BEGIN DML COMMIT) DDL (BEGIN DML COMMIT), since, being Oracle, it happens in the most unexpected way possible. Others, like PostgreSQL, handle DDL within a transaction just fine. As to whether you have a genuinely good reason that your fields aren't fixed, and whether these tables you're constructing have any actual meaning in the real world, that's a whole other debate... |
Well, the person who gave me the example teaches in a US College, he's a Professor. Perhaps he was thinking in an abstract way, but the information is way too often absorbed as "dogmatic way of doing things". No wonder, then, that some graduates come out with some abominations. |
I'm not really a DB person as I find them incredibly boring, but wouldn't the obvious way to look at it be similar to a OO approach in programming? Tables take on the role of classes, and each row would be an instance of that class. If you think of it this way, then creating a table for each user would be analogous to creating a separate class for each user...i.e. batshit insane. |
I am intrigued by your ideas. Hmmm... an opportunity to implement a UserClassFactory Class! No, you're right. Not enterprisey. Need more layers of factories. |
Most, yes. Another exception would be an installer that creates a database and initializes its tables and such.
You wash your hands out with soap, young man! |
So Oracle databases have a table called DUAL which has only ONE thing in it. But you can fix this by making a DUAL with 2 things in it. But that breaks normal code. Yet DUAL isn't a reserved word, or otherwise restricted to its valid if ill-named purpose. Conclusion: Oracle is the Real WTF. AMIRITE? |
Close - we have here a pentabool, able to return TRUE, FALSE, NULL, RECORD_NOT_FOUND and TABLE_NOT FOUND. |
D'oh - I misread the table definition, the field isn't nullable, so this is just a boring old quadbool. |
Re: tblIsThere
2012-06-06 07:01
•
by
Mr Clever Ideas
(unregistered)
|
DDL should also include syntax for anonymous inner tables. |
Fine, fine, but I think multiple inheritance of tables should be avoided. Instead we should have abstract and interface tables with no actual columns, just ideas. captcha: letatio = lettuce head |
|
You guys are all crazy. He's obviously using this code to see if the DATABASE is there. Jeez...
|
Umm, could you please properly paranthesize that? My brain's Language Interpretation Module just overflowed on me... :"> |
And if the database is down? Is the metadata useful in any way? I doubt. |
| « Prev | Page 1 | Page 2 | Next » |