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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:51:39+00:00 2026-06-10T09:51:39+00:00

I need to create a procedure that: 1) selects some text from a field

  • 0

I need to create a procedure that:
1) selects some text from a field in a table and stores it in a variable
2) updates the same record field only adding the date in yyyymmdd format plus additional text input into the procedure
…something like this…

delimiter //
create procedure table1.sp_updateComment (IN inputIP varchar(15), IN inputAccount varchar(10))
begin
start transaction;
select comment from table1 where ip = inputIP;
update table1 set comment = '<comment from above> + yyyymmdd + inputAccount', status = 'u' where ip = inputIP;
commit;
end;
//
delimiter ;
;

thanks in advance 🙂

  • 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-10T09:51:40+00:00Added an answer on June 10, 2026 at 9:51 am

    Use SELECT…INTO to select some value and store it in a variable:

    SELECT comment INTO @my_comment_variable FROM table1 WHERE ip = inputIP;
    

    However, it doesn’t seem necessary in your case. Try using CONCAT:

    UPDATE table1
    SET comment = CONCAT(comment, DATE_FORMAT(CURDATE(), "%Y%m%d"), inputAccount'), status = 'u'
    WHERE ip = inputIP;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to create sql procedure or function that need to find duplicate
I need to delete some text files when a certain database is dropped from
I need a some stored procedure that called like: search('foo bar') makes a search
I'm trying to create a stored procedure that uses SELECT TOP 20 * from
I need to create a stored procedure that needs to return a count of
When and Why does some one decide that they need to create a View
I need to create a Postgres 9.1 PL/pgSQL stored procedure that, among other parameters,
I need to create an SQL query to insert some data into a table
i need create a variable with parent subclass. Example: Parent Class <?php class parentClass
I use MS SQL 2008 R2, I need create a Table with a CHECK

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.