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 6789235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:34:46+00:00 2026-05-26T17:34:46+00:00

I forget put delimiter directive, some semicolon and was using tsl syntax like [select

  • 0

I forget put delimiter directive, some semicolon and was using tsl syntax like [select variable = field] that is not valid in mysql.
Mysql error when you use tsl syntax is [not allowed to return a result set from a function] and dont help much.
@AndreKR point all of it to me, thanks.
Im using mysqlworkbench 5.2.30 CE.
The work function become:

delimiter //
CREATE FUNCTION nextval (seq_name varchar(100))  
  RETURNS bigint(20)  
    READS SQL DATA  
  NOT DETERMINISTIC  
    BEGIN  
     DECLARE workval bigint(20);  
     SELECT count(1) into workval  
        FROM tip_sequence  
        WHERE sequencename = seq_name;  
     IF workval <> 1 THEN  
        DELETE  
            FROM tip_sequence  
            WHERE sequencename = seq_name;  
        INSERT  
            INTO tip_sequence (sequencename, sequenceval, sequencestep)  
            VALUES (seq_name, 1, 1);  
     END IF;
     SELECT sequenceval into workval  
        FROM tip_sequence  
        WHERE sequencename = seq_name;  
     UPDATE tip_sequence  
        SET sequenceval = sequenceval + sequencestep  
        WHERE sequencename = seq_name;  
     RETURN workval;
    END//
delimiter ;
  • 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-26T17:34:47+00:00Added an answer on May 26, 2026 at 5:34 pm

    I don’t think the SELECT workval = count(1) FROM ... syntax is valid. I think what you mean is: SELECT count(1) INTO workval FROM ....

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

Sidebar

Related Questions

Sorry guys! i am so into the code! that i forgot to put the
Accidentally I may forget to describe some parameters or exception throwing (or something else)
I always forget how to do things like this. I have a database table
We all know that deadlines and/or critical bugfixes and make us forget a bit
OK here's the deal. There are some people who put their lives in the
If I forget to put an empty line at the end of any of
We're using team foundation server for our source control. I frequently put files into
I redefined some maths functions (so that they're faster -ie: less accurate-, or use
I've been put on a project that has a messy class that writes buttons
We are using code collab and have to put the entry --no-prefix each time.

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.