• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Eliminate duplication of information in database

Guest
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

I created a form that allows the user to enter the name of a state and the state's abbreviation. I need a statement that will evaluate the states table and see if the stateName in the form is already in the state table. I want the form to display an errorMessage and repost the form so the user will enter a new stateName and stateAbbr. Any suggestions?

TOPICS
Advanced techniques

Views

943

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

Yes. Learn ColdFusion first if it's what you've chosen to use. Facetious maybe, but what you're asking implies that you have no interest whatsoever in doing this, and that all you really want is for someone else to do your work for you.

What have you tried so far, and where are you struggling?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

From your response I will take it that all of your 286 posts have been responses to other posts and you have never posed a question. You were birthed in the world an expert. In the future if you read a post that you feel does warrant an educated response go with your feeling and don't respond at all.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

Over 7000 of my 7093 posts to date have been responses, as opposed to asking questions.  Quite often I will ask the same question Owain North asked - What have you tried so far and what part are you having trouble with?

If your nose ever comes back into joint, you might consider answering that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

And maybe basic programming and user interface design in general.

Why oh why would you want your poor user to guess what states have and have not been entered into this table in order for them to enter another one?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

From your response I will take it that all of your 2000 posts have been responses to other posts and you have never posed a question. You were birthed in the world an expert. In the future if you read a post that you feel does warrant an educated response go with your feeling and don't respond at all.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

Don't be so defensive: just because you didn't like the sound of their answers doesn't mean they don't have a point.

You asked for a suggestion, this is my one: your question suggests you don't even have a fundamental understanding of how querying a DB works.  There's  nothing wrong with that: we all started from this situation (a point you've made twice now).  However the onus really is on you to find these things out... I guess why you're asking here.  However simply telling you the answer (which is what you seem to want) is not going to help you at all: you have a lot of learning to do, and it needs to start at a slightly earlier level that the answer to the question you're asking would be.  And getting you up to speed with how to query a DB is not something that can sensibly done on a CF forum.  For argument's sake for me to get where you need to be with SQL required me to do DB101 at polytech: four hours a week for eight weeks (it mighta been 16wks... can't remember it was almost 20yrs ago (shudder)).  Not a coupla forum posts.

So... track down a book on SQL, or some online tutorials, or something like that and get learning.  Dan Bracuk will shortly recommend "Teach yourself SQL in 10min", or whatever it is.  I have never seen it, but he recommends it so often I guess he thinks it's pretty good 😉

Another thought.  I'm guessing you're in The States.  So, like, there's only 50 states to worry about... and accordingly - as Ian suggested - why are you even making your users type this stuff in?  Pre-populate a DB table with all of them, and offer this as a select on your form.  You don't want to be making your users type this stuff in.  For one thing, what happens if someone types in "Misissippi" (sic).  That's different from "Mississippi".  How's your DB gonna know that?  And you don't want two entries for Misissippi / Mississippi (man: that's a stupid-looking word after typing it four times in rapid succession!).... or a third one for Missisipi... etc.  This is basic UI design: don't make people type stuff in that you should already be providing for them.

And bring thicker skin to the forums in future 😉

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

Regarding, "Dan Bracuk will shortly recommend "Teach yourself SQL in 10min", or  whatever it is.  I have never seen it, but he recommends it so often I  guess he thinks it's pretty good ;-)"

When I mention that book, I say, "I've heard good things about, ...".  I have seen it in a bookstore, but I've never read it or done the tutorials.  I first learned about it on this forum.  This also applies to Database Design for Mere Mortals.

On the other hand, I sometimes, "personally recommend Teach Yourself Javascript in 24 Hours".  I did buy that book and do the tutorials.

As programmers, we must be anal, I mean precise.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 17, 2010 Nov 17, 2010

Copy link to clipboard

Copied

Well that's a whole lotta smackdown to cope with this early in the morning.

Think I'll join in.

Purely to assist your understanding - I did not come on here when I was new to CF, I was in the fortunate position of having a guy at work I could learn from. However, after a few years of that (and as the majority of stuff I dealt with at work was pretty simple) I joined these forums to get involved in some of the more interesting and complex issues, and to be able to help people out when they were genuinely stuck and out of ideas.

With a question such as yours believe me when I say that had you not have had the (perhaps unwanted) responses you did you would not have gotten any at all. The majority of the people who answer queries on here are professionals who are working full time, and come on here for similar reasons to myself. We are not paid to be here, and often we're replying in our own time. Therefore it's extremely frustrating when people post up a very simple question which is really more of a system spec that they simply want fulfilling - they're not interested in learning anything, they just want someone else to do their work for them so they can go back and get paid for it.

In all honesty you need to actually learn about the technologies you're using. If you come back in a few weeks and say right, I've tried this but this doesn't work. This is what I've done so far, this is what the docs say and this is what the problem is then believe me you'll have all manner of people trying to help you out, people who would normally be charging good money for CF consultancy.

So untwist your knickers and actually give it a try first. When you've learned CF and SQL and both yourself and Google are out of ideas, post on here and someone will be only too happy to help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 18, 2010 Nov 18, 2010

Copy link to clipboard

Copied

cobbphd wrote:

From your response I will take it that all of your 2000 posts have been responses to other posts and you have never posed a question.

Nope, I would guesstimate that approximately 10% of my posts have been questions.

But when I have asked questions, I have:

  1. Explained what I am trying to do.
  2. Explained why I am trying to do it this way (some time the problem is a this point).
  3. Showed what I have already tried.
  4. Showed what errors I have gotten, or explained why the results I have gotten is not the desired or correct results.

In other words I have always tried my best to follow these forum question asking suggestions.

http://www.catb.org/~esr/faqs/smart-questions.html

You seem to have fell afoul of the "Before You Ask" http://www.catb.org/~esr/faqs/smart-questions.html#before section.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 18, 2010 Nov 18, 2010

Copy link to clipboard

Copied

Not that Ian needs me to confirm this, but having been around here for about as long as he has, and read almost every post made to these forums since

2001, I will confirm that that is exactly how he's articulated his questions.

I've tried to answer them when I can, but I seldom know the answers, I have to concede.

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 19, 2010 Nov 19, 2010

Copy link to clipboard

Copied

LATEST

If you ask questions that indicate lack of basic knowledge of a topic, you should expect people to point that out.

In this particular case, rather than discussing the specifics of the implementation you're attempting, you might be better served by describing what exactly you're trying to build.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation