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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:43:07+00:00 2026-05-27T19:43:07+00:00

how to check if all parameters in procedure begins with p_ using a regex?

  • 0

how to check if all parameters in procedure begins with “p_” using a regex?

Procedure sample:

DELIMITER $$

DROP PROCEDURE IF EXISTS `sp_in_sys_blablabla`$$

CREATE  PROCEDURE `sp_in_sys_blablabla`(
    p_cod_componente INT(11),
    cod_tipo_ocorrencia SMALLINT(4), 
    p_dat_inicio CHAR(30), 
    dat_fim CHAR(30), 
    p_cod_usu_inc CHAR(10), 
    p_datInc CHAR(40)
)
BEGIN
    DECLARE v_excecao SMALLINT DEFAULT 0; 
    DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET v_excecao = 1;
    START TRANSACTION;
......
END$$

C# code:

string content = "proceddure code"; 
Regex regex = new Regex(regras[i].Regex, RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);

if (regex.IsMatch(content)) Console.WriteLine(ERROR_MESSAGE);
  • 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-27T19:43:07+00:00Added an answer on May 27, 2026 at 7:43 pm

    From my point of view you have two options:

    1. You can use regular expressions. Read your sql statement line by line. Be sure, that you’re inside the declaration of a procedure! I think that is very error-prone due to the fact, that it is not necessary by syntax. The actual regular expression seems very easy p_[a-z]+.

    2. Use a parser (i.e., Gold parser). Possibly you’ll find a grammar for SQL syntax. You can then grab any parameter within a procedure declaration and check whether it StartsWith("p_").

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

Sidebar

Related Questions

This question Check all associations before destroy in rails suggests using :dependent => :restrict
How would you implement that check? You have N parameters for a stored procedure.
I am using XMLHttpRequest to create a simple form submit and pass 2 parameters.
I have created a stored procedure for my report.. create Procedure [dbo].[sp_Score_Grade] @Month int,
I am trying to check all the checkboxes on a webform (aspx) page, which
Is it necessary to check all the field in equals method of model class
The thing I'm trying is to check all those checkboxes, when "cbkomplet" is checked.
How to enable ctrl + A (check all option ) in a table (inside
I have a form and one of the fields is a check-all-that-applies type field
With selenium can one run a test which check all images on a current

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.