Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » sql query
Showing page 1 of 2 (12 total posts)
  • Split SQL WHERE Clause

    I am pretty new to this Reg Exp stuff, but gaining more understanding every day.  My ASP application is attempting to Split a WHERE clause on the " AND "s, but having no luck.  I would also one day like to expand it to be able to split on " OR " but for now I settle with the baby step. Expression: ...
    Posted to Construction Advice (Forum) by JHulse on March 20, 2008
  • SQL Statement split

    Hi, Programming language: Delphi with pcre-compatible component The question is: Split the SQL-statement items to: -type (select|insert|delete|truncate table) -distinct mode if exist (is disitinct|is not distinct) -top if exist (top statement - rows or persent) -join if exist (type of join, cross-table and cross-condition) Thats what I ...
    Posted to Construction Advice (Forum) by Ilway on March 18, 2008
  • Parse SQL in Javascript or PHP

    Hello all, new to this community. Having some difficulties getting a regex to parse a standard SQL query. It make it simple I will just answer the bullet points from the 'READ FIRST' post. 1.  Programming language used - Javascript (or if PHP is easier is accomplish this task, that can be done too) 2. My ultimate task is to create ...
    Posted to Construction Advice (Forum) by rootsage on February 22, 2008
  • Tokenize SQL Query

    hi,  i want to parse a file that contains SQL queries which can be executed within SQL Server Query Analyzer. The format of the file is  SQL Statement 1 GO SQL Statement 2 GO SQL Statement 3 GO etc  What i want to do is extract each SQL statement, eg (SQL Statement 1, SQL Statement 2 etc). Each statement maybe multiple ...
    Posted to Construction Advice (Forum) by rumballs on November 3, 2007
  • Split SQL INSERT statement

    Hello I have to parse a SQL INSERT statement to get all the values to include in the database. I thought that a regex should exist to do this, and I found this very nice regex (http://regexlib.com/REDetails.aspx?regexp_id=1750) : (INSERT ...
    Posted to Construction Advice (Forum) by Flexx on September 27, 2007
  • Finding similar records

    Hi, I need to create a system that if a user signs up it will check if this user is already signed up. it will check sometimes by phone number somtimes on address and firstname sometimes on addres and lastname sometime on lastname and city and address. sometimes for the customer ID. so how would I use regex to check if there is a similar ...
    Posted to Construction Advice (Forum) by rnby on May 17, 2007
  • split SQL SELECT query

    Hello,  I've been trying to write a regex that would split any sql select query and capture different clauses to the groups. That is, there should be 5 groups (eg. top, select, from, where, order) each containing corresponding text (the group is empty if the clause is missing). For example, lets try and split this query: SELECT  ...
    Posted to Construction Advice (Forum) by geriadejes on May 2, 2007
  • Re: advice for simple SQL where clause expression

    thanks guys, very useful forum ! let me try the expression & i will till you the findings   Thanks alot
    Posted to Construction Advice (Forum) by bashar_naffa on May 2, 2007
  • Re: advice for simple SQL where clause expression

    Here you go: (?i)^\[[^\]]+\]\.\[[^\]]+\]\s+(?:LIKE|=|<|>|<>|<=|>=)\s+(?:'[^']*'|\d+)(?:\s+AND\s+\[[^\]]+\]\.\[[^\]]+\]\s+(?:LIKE|=|<|>|<>|<=|>=)\s+(?:'[^']*'|\d+))?\s*$
    Posted to Construction Advice (Forum) by eSquire on May 1, 2007
  • Re: Expression for SQL parsing

    I'd rather have a regex to split SQL statements with, but this generates problems with not splitting quoted strings as well. You would need a variable length lookbehind assertion. I'll try to match non whitespace characters instead. If you also need to have operators like "<=" and ">=" and numbers in any ...
    Posted to Construction Advice (Forum) by eSquire on April 21, 2007
1 2 Next >