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

  • SEARCH
  • Home
  • 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 7488795
In Process

The Archive Base Latest Questions

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

I am have created function in mysql. This is code of my function DROP

  • 0

I am have created function in mysql.

This is code of my function

 DROP FUNCTION `star`//

CREATE DEFINER=`root`@`localhost` FUNCTION `star`(
num INT

) RETURNS int(11)
DETERMINISTIC
 BEGIN

                IF(num>=0 && num<20)
                THEN
                RETURN 1;
                ELSEIF(num>=20 && num<40)
                THEN
                RETURN 2;
                ELSEIF(num>=40 && num<60)
                THEN
                RETURN 3;
                ELSEIF(num>=60 && num<80)
                THEN
                RETURN 4;
                ELSEIF(num>=80 && num<=100)
                THEN
                RETURN 5;
                END IF;
    END

I have forgotten how did i made this function in my database. Now i want to create same function into another database.

For this i just copy above code and paste that in sql. and press Go. But it creates error.
Please tell me what mistake i have done.

  • 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-29T15:02:25+00:00Added an answer on May 29, 2026 at 3:02 pm

    You need a DELIMITER // statement at the top…

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

Sidebar

Related Questions

I have this code DELIMITER $$ DROP FUNCTION IF EXISTS `GetNextID` $$ CREATE FUNCTION
i have created a module with this among others this function in it: <?php
we are trying to create a calendar function in python. we have created a
I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
PHP mysql database I have created a follow on question to this one here
Hey guys, I have this piece of jquery code: <script type=text/javascript > $(function() {
I have used this code on an autosuggest script to split the CSV created
I have created a MySQL function to determine if a set of latitude and
I have created a function that takes a SQL command and produces output that
I have created a function outside of $(document).ready() , but am still using jQuery

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.