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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:31:57+00:00 2026-06-08T23:31:57+00:00

wrong INSERT in Procedure . This insert add all column without UserId ———————————————————————————- —

  • 0

wrong INSERT in Procedure . This insert add all column without UserId

----------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS CreateTable $$
CREATE PROCEDURE `CreateTable`
(
    md5 VARCHAR(255),table_name VARCHAR(255),CommentsId INT(11),
    Parent VARCHAR(100), Content TEXT,UserId INT(11), Title VARCHAR(255), 
    Nick VARCHAR(20), IdLength INT(11), suffix INT(11)
)
BEGIN



DECLARE full_table_name varchar(255);

SET @SQL=CONCAT('SELECT COUNT(\'X\') INTO @COUNTER FROM INFORMATION_SCHEMA.COLUMNS ',
            'WHERE TABLE_NAME like \'', table_name, '%\'');

PREPARE stmt FROM @SQL;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

    SET full_table_name= table_name;


    SET @SQL=CONCAT('CREATE TABLE IF NOT EXISTS ', full_table_name, ' LIKE CommentsPattern');
    PREPARE stmt FROM @SQL;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt;


SET @SQL=CONCAT('INSERT INTO ', full_table_name,'(md5,UserId, Parent, Content, CommentsId, Title, Nick,IdLength,suffix)',
        'values(',UserId,',"',md5, '",', Parent, ',"', Content, '",',CommentsId,',"',Title,'","',Nick,'",', IdLength, ',',suffix, ')');
    prepare stmt from @sql;
    execute stmt;
    deallocate prepare stmt;

END

I want add this values:

call CreateTable('dcf57shasdsd5723m','dcf',2,60201,'My article is',444,'New Title','Ethan',1,2);

Where:

  1. md5 – dfc7shgsnsty3475723m
  2. table_name – dfc
  3. UserId – 444
  4. Title – New Title
  5. Nick – Ethan
  6. CommentsId – 2
  7. Parent – 60201
  8. IdLength – 1
  9. suffix – 2
  10. Content – My article is
  • 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-06-08T23:31:59+00:00Added an answer on June 8, 2026 at 11:31 pm

    In the INSERT INTO you declare the columns in the order: md5, UserId, Parent,…
    However, in the values the md5 and UserId values are switched: ‘,UserId,’,”‘,md5, ‘”,’, Parent

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

Sidebar

Related Questions

There is something wrong with this trigger. But what? CREATE TRIGGER MYCOOLTRIGGER AFTER INSERT
What is wrong with this code ? set<string> nk ; bitset<3> bs1(string(100)); nk.insert(bs1.to_string()); error:
I have a dynamic query which reads like this Alter PROCEDURE dbo.mySP -- Add
Anybody tell me what's wrong with creating this stored procedure. CREATE PROC ImportData AS
Could somebody explain what I'm doing wrong in attempting to insert a new UITableViewCell?
Any ideas what I am doing wrong??? INSERT INTO LondonFixes ('id', 'Metal', 'AmPm', 'GBP',
INSERT INTO `tablecity` (`City`, `Country`) VALUES('胡志明市', 'Vietnam'); City become e883a1e5bf97e6988ee5b882 What's wrong? In some
JPA.em(default).createQuery(insert into USER (FULLNAME, EMAIL, USERNAME, PASSWORD) + VALUES (\'+fullname+\',\'+email+\',\'+username+\',\'+password+\');); is it a wrong
What wrong with this validation: Jquery: $(document).ready(function(){ $(#addcmd).attr(disabled,disabled); $(#cmdstxt).keypress( function(event){ var txt=$(#cmdstxt); if( txt.val().length
This stored procedure is taking care of material reservations. The basic idea is that

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.