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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:17:50+00:00 2026-05-25T12:17:50+00:00

Here I wrote a mysql procedure which select all text type field of specified

  • 0

Here I wrote a mysql procedure which select all text type field of specified database ‘wp’

and I want to update every text type field row appending extra string via CONCAT function.

after I call test2 , error shows:

Query : call test2()

Error Code : 1146
Table 'wp._tbl' doesn't exist

Execution Time : 00:00:00:000
Transfer Time  : 00:00:00:000
Total Time     : 00:00:00:000
---------------------------------------------------

mysql regards _tbl as a string but not a variable.

So can I correct this?

code:

DELIMITER $$
USE `wp`$$
DROP PROCEDURE IF EXISTS `test2`$$
CREATE
    PROCEDURE `test2`()
    BEGIN
    DECLARE _tbl VARCHAR(100);
    DECLARE _cl VARCHAR(100);
    DECLARE notFound INT DEFAULT 0;
    DECLARE cur CURSOR FOR SELECT table_name,column_name FROM information_schema.columns WHERE table_schema = 'wp' AND data_type ='text';
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET notFound =1;
    OPEN cur;
        WHILE notFound = 0 DO
            FETCH cur INTO _tbl,_cl;
            UPDATE _tbl SET _cl = CONCAT(_cl,'extra string goes here.....');
            IF NOT noFound THEN SET notFound = 0;
            END IF;
        END WHILE;
    CLOSE cur;
    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-25T12:17:51+00:00Added an answer on May 25, 2026 at 12:17 pm

    You’ll need to use prepared statements.
    Also see How To have Dynamic SQL in MySQL Stored Procedure

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

Sidebar

Related Questions

Hey guys, PHP and MySQL newguy here. Wrote this php file which display the
hey guys,i'm new to mysql.here i wrote a procedure that error occured: DELIMITER $$
here's the stored procedure i wrote.In this proc p_subjectid is an array of numbers
I have to store hindi text in a MySQL database, fetch it using a
Well I have this MySQL stored procedure that I wrote and if I run
I am trying to implement a basic full-text search with MySQL. I wrote this
Hej guys, I wrote a little php script which access a database and simply
I'm (attempting) to write a MySQL stored procedure that parses a large text file.
I've wrote a quick PHP class to ease the access to a mysql database.
I wrote a simple Stored Procedure with a while loop that's not working. Here's

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.