Re: Can I use replace function on a string to create form drop bo x options?
On 10/21/06, Andrew Tyrone [EMAIL PROTECTED] wrote: Just put the days in the list, not codes ;-)) That will make a field with a max of what? 50 characters may be? Big deal! ;-) And...? It doesn't matter which types of data you store in those lists. How would you return a workable query? You can't, and you'd have to jump Well, MySQL has some stuff for working with lists... I don't like it, because it's one of those things that locks you in with a DB, but hell, who are we kidding? At any rate, don't pre-optimize or whatever, neh? Wot Wot (I think that may be brittish for what what, but I'm not certain) I'm not sure it's cut and dry. There are times where it is much easier to use a list than a link table. I guess it's one of those judgement calls. If only we didn't need judgement, neh? *sigh* 'Prolly be boring as hell... G'night folks- strange as it is to say stuff like that in a timeless medium, or whatever. Heh. =] ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257699 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
What if a manager would like a printout of the days of the week and which employees are available to work on each of those days. If I worked for a company and had a manager liable to ask anything after a project has been designed, then of course, I would take a belt and suspenders and use a cross table. For the time being, I'm my own manager, and I have my customers pay for what the need, not for what they could possibly need in a couple of years. If they need new features later (and sometimes they do), I charge them for whatever it takes for doing it. Look, I never said that using cross tables is an heresy. I just say that saying always use cross table is abusive for the least, and I would even qualify it as a proof of lack of experience. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257715 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop bo x options?
1º using a (small) list is not a workaround, it is a short cut. Before I take short cuts, the first thing that comes to mind is, I hope I won't need to redo this later. 2º updating one field in a table is much more straightforward than updating a multi records cross table. If you mean the SQL is easier to write, then yes, but I would only say it's faster to write, since most link table queries and code can be re-used with little modification once you've written them before. 3º you don't need a joined table in the query, just one table; The purpose of and RDBMS is storing data in a relational way in the first place, so using one join to get at additional data isn't taboo; these systems are made for that type of work. 4º you don't need a query each time you want to check if an item has a certain property, you just check for the property in a list, which you can even store in a session variable. You can grab the items from the link table and use ValueList() if you want to put them in a list. 5º only beginners go by the bible, experienced programmers know short cuts. Experienced programmers are experienced because they've learned a lot of do's and donts from experienced programmers that came before them. 6º bibles are made for beginners; One thing that experts and true beginners have in common: they both know they still have a lot to learn. 7º beginners are supposed to learn from experience, if they keep on going by the bible, and don't experiment, they will remain beginners... Beginners learn from a lot of different sources, and one of the major sources is the experience of others who have tried something 10 different ways. For instance, if you need to store in an employee table which days in the week he is ok to work, will you create a table with the 7 days in the week and a cross table between the employees and the days? SURE, just in case some one decides to make an eigth day in the week, who knows! This is ridiculous. ;-) What if a manager would like a printout of the days of the week and which employees are available to work on each of those days. Show me, using a single query, how you'd list all employees grouped by the days they work. Andy ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257675 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop bo x options?
1º using a (small) list is not a workaround, it is a short cut. Whatever you want to call it, doesn't matter to me. I find that, for me, taking short cuts now often means longer detours later. 2º updating one field in a table is much more straightforward than updating a multi records cross table. It takes me less than five minutes to write the logic within a page that updates multiple records. I can't imagine it would take you any longer. Therefore, the time you're saving with your shortcut is negligible. For instance, if you need to store in an employee table which days in the week he is ok to work, will you create a table with the 7 days in the week and a cross table between the employees and the days? SURE, just in case some one decides to make an eigth day in the week, who knows! This example has a couple of characteristics that are clearly identifiable; if you wanted to say that, in the case where you have those characteristics you might take an alternate approach, that's fine. In this specific case, you have a fixed list of Boolean values. But you don't say that, you simply say take shortcuts instead of when you have a fixed list of Boolean values, you can store that within a single field of your existing table. And, in this case, you still wouldn't want to store this as a list, because that's more complicated than necessary. You'd simply use bit fields within your table. Now, that's not a shortcut, it's the proper way to handle a fixed list of Boolean values. So, in summary, your shortcut sucks. This is ridiculous. ;-) Yes, it is. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257676 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
Before I take short cuts, the first thing that comes to mind is, I hope I won't need to redo this later. Then if you're not sure, don't do it. The purpose of and RDBMS is storing data in a relational way in the first place, Right, when there is a relation worth to be treated as such. so using one join to get at additional data isn't taboo; these systems are made for that type of work. Harvesters are also mad to cut grass, though I don't use them to mow my green in my yard ;-) You can grab the items from the link table and use ValueList() if you want to put them in a list. This is what I do when the list is worth to be stored in a table. What if a manager would like a printout of the days of the week and which employees are available to work on each of those days. Show me, using a single query, how you'd list all employees grouped by the days they work. Just put the days in the list, not codes ;-)) That will make a field with a max of what? 50 characters may be? Big deal! ;-) ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257679 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
In this specific case, you have a fixed list of Boolean values. I said a short list, it doesn't have to be fixed. It can be a list of codes related to a table with codes and description, and this table is expandable. But you don't always need a cross table between them. I use this for permissions to access areas in my CMS system. For the time being, I have about 15 areas to 20, this system could be good for more than 100 different areas, but I KNOW that I'll never need that much, it's as simple as that. I also have in the same database about 7500 photographs, and 2 individuals, each of whom may be identified in several photos, and yes, in THAT case I use a cross table. It's just a matter of judgment. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257681 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Can I use replace function on a string to create form drop bo x options?
Just put the days in the list, not codes ;-)) That will make a field with a max of what? 50 characters may be? Big deal! ;-) And...? It doesn't matter which types of data you store in those lists. How would you return a workable query? You can't, and you'd have to jump through a bunch of hoops and use CF code to sort it all out, just because you didn't want to use a link table. This isn't about how much data is stored as much as it is about the efficiency with which you can use the data. From your example, a simple, useful report would take workarounds to produce just because you refused to use a link table and save a few hundred extra kilobytes or so. Andy ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257693 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop bo x options?
I'd actually rather brush my teeth with a chainsaw than store a delimited list in a database field You see? This is unbelievable what kind of weirdness people can do when they go by the book ;-) I've got to agree with Andrew here. Why bother implementing a bunch of workarounds, etc, when you can just build a table and the appropriate relationship? It would take me less time to do it the right way than the wrong way. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257666 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
Why bother implementing a bunch of workarounds, etc, when you can just build a table and the appropriate relationship? C'mon, we've discussed this many times, 1º using a (small) list is not a workaround, it is a short cut. 2º updating one field in a table is much more straightforward than updating a multi records cross table. 3º you don't need a joined table in the query, just one table; 4º you don't need a query each time you want to check if an item has a certain property, you just check for the property in a list, which you can even store in a session variable. 5º only beginners go by the bible, experienced programmers know short cuts. 6º bibles are made for beginners; 7º beginners are supposed to learn from experience, if they keep on going by the bible, and don't experiment, they will remain beginners... For instance, if you need to store in an employee table which days in the week he is ok to work, will you create a table with the 7 days in the week and a cross table between the employees and the days? SURE, just in case some one decides to make an eigth day in the week, who knows! This is ridiculous. ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257670 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4