Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7170825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:17:23+00:00 2026-05-28T15:17:23+00:00

Ok, First off, I am not a mysql guru. Second, I did search, but

  • 0

Ok, First off, I am not a mysql guru. Second, I did search, but saw nothing relevant related to mysql, and since my DB knowledge is limited, guessing syntactical differences between two different Database types just isn’t in the cards.

I am trying to determine if a particular value already exists in a table before inserting a row. I’ve decided to go about this using two Stored procedures. The first:

CREATE PROCEDURE `nExists` ( n VARCHAR(255) ) BEGIN
    SELECT COUNT(*) FROM (SELECT * FROM Users WHERE username=n) as T;
END

And The Second:

CREATE PROCEDURE `createUser` ( n VARCHAR(255) ) BEGIN
    IF (nExists(n) = 0) THEN
        INSERT INTO Users...
    END IF;
END

So, as you can see, I’m attempting to call nExists from createUser. I get the error that no Function exists with the name nExists…because it’s a stored procedure. I’m not clear on what the difference is, or why such a difference would be necessary, but I’m a Java dev, so maybe I’m missing some grand DB-related concept here.

Could you guys help me out by any chance?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:17:24+00:00Added an answer on May 28, 2026 at 3:17 pm

    I’m not sure how it helped you, but…

    why SELECT COUNT(*) FROM (SELECT * FROM Users WHERE username=n) and not just SELECT COUNT(*) FROM Users WHERE username=n?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I am not very good with MySQL yet, so go easy on
First off, I'm not an expert with MySQL queries, and I can't seem to
First off, I am not a DBA, but I do work in an environment
I know I can read off /proc/[id]/maps but I'm not sure if the first
First off I'm not sure that's the proper title for this question but hopefully
First off - sorry for the wall of code but it's not too horrendous,
First off I want to say that I am not using threads or multiple
First off, I'm not a coder by profession, just a lowly network engineer :)
First off, this is NOT a duplicate of: Turn a C string with NULL
First off, I know the title is generic and not fitting. I just couldn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.