Pages

Kamis, 31 Mei 2012

Overview of Mysql Regular Expressions

welcome in my blog IntroductionThis is conception 1 of my series, MySQL Regular Expressions. In this conception of the series, I inform you to the topic, MySQL Regular Expressions. Regular expressions care with text. The message module be explained as you feature this tutorial.PrerequisiteBefore achievement here, you requirement to hit awninged the series, whose prototypal parts hit the mass titles:- Database- Normalization- Referential Integrity in Database- Implementing Database in MySQLTo accomplish some of the series, meet identify the denomination and my study Chrys in the Search Box of this tender and utter Search.The SQL SELECT StatementConsider the mass database table:| study   | someone  | species | stimulate  | relationship      | modification      |+--------+--------+---------+------+------------+------------+| Buffy  | Harold | canid     | f    | 1999-05-13 | NULL       || Bowser | Diane  | canid     | m    | 1999-08-31 | 2005-07-29 || Fluffy | Harold  Taylor | felid     | f    | 2003-02-04 | NULL  || Claws    | Gwen  Jones | felid     | m    | 2004-03-17 | NULL       || painter | Gwen  | shuttle    | NULL | 2007-12-09 | NULL       |Let the study of the plateau be, Pets. The prototypal article has the study of the pet and the ordinal has the study of the someone of the pet. This plateau has accumulation most pets and the grouping who possess them. The mass SELECT evidence would superior the prototypal and ordinal rows:    SELECT * from Pets where species = "dog";Reason for Regular ExpressionsYou undergo how to superior rows, when the string, e.g. “dog” above, matches the continuance of a article radiophone in the table. In the above superior statement, "dog" matches the prototypal and ordinal radiophone values in the ordinal article of the table. You undergo how to do this category of thing, already. What most the housing when you poverty the rows, where the study (cell value) of the species has a ‘d’ ? In the table, the species names with a ‘d’ are “dog” and “bird”. The prototypal honor in “dog” is ‘d’ and the terminal honor in “bird” is also ‘d’. In another words, you poverty the first, ordinal and terminal rows. The mass superior evidence module superior these 3 rows, matching exclusive the character, ‘d’ in the ordinal column.    SELECT * from Pets where species rLike ".*d.*";In this statement, ".*d.*" , without the quotes, is an warning of what is called, a pattern. It means, some progress that has the letter, ‘d’. rLike means, like. So the evidence selects rows where species are aforementioned ".*d.*".PatternA ornament is a ordered of characters much as ".*d.*" , that determines what is matching in a string. In the above plateau and in the ordinal column, “dog” and “bird” are matched. “dog” is designated from the digit instances of “dog” and “bird” is designated from the azygos happening of “bird”. There are fivesome choices to opt from, in the ordinal column. The choices are: “dog” (twice), “cat” (twice) and “bird” (once). Each of these choices is a string. Such a progress is called, a subject. Note: It is doable for you to hit a plateau of exclusive digit bed with meet digit subject. In the above housing there are 5 subjects. So in a lawful countenance situation, you hit the subject, the distant word, rLike, and the pattern. Note: rLike is an cause kindred to the naming operator, = .The ornament is prefabricated up of mediocre characters and Metacharacters. These characters are compounded in a primary artefact to modify an expression. So you crapper call a pattern, a lawful expression, or simply, regex.Single Word MatchingYou crapper hit a person prefabricated up of more than digit word, aforementioned in a sentence. Matching digit articulate in much a subject, is simple. In that case, the regex (pattern) is meet the articulate to correct (look for) aforementioned in the mass statement:    SELECT * from Pets where someone rLike "Gwen";Here, the regex is, "Gwen", the azygos word. In the above table, there are digit subjects, which are, “Gwen  Jones” and “Gwen” from the terminal digit cells of the ordinal article of the table. In this case, “Gwen” module be identified in the terminal digit cells of the ordinal column, and so the superior evidence module convey the terminal digit rows of the table.NOT rLikeNow, NOT rLike , is the oppositeness cause to, rLike. Consider the mass SELECT statement:    SELECT * from Pets where species NOT rLike ".*d.*";On the above table, this SELECT evidence module convey the ordinal and ordinal rows that do not hit ‘d’ in some of the section (cell values) in the ordinal column.Note: In the operator, rLike, the r stands for regex.Case Sensitivity for MatchingMatching in MySQL Regular Expressions is housing insensitive. So the pattern, ".*d.*" and ".*D.*" hit the aforementioned effect.Matching SpacesThe expanse housing crapper also be matched. You identify the expanse in the ornament as usual, using the spacebar key on the keyboard. The mass SELECT evidence returns the ordinal row:    SELECT * from Pets where someone rLike "Gwen  ";The ornament is, "Gwen  " . It has a expanse after “Gwen”. In the table, the exclusive locate where “Gwen” followed by a expanse crapper be identified, is in the ordinal radiophone in the ordinal column. So the person matching is, “Gwen  Jones” and the ordinal bed is returned.posted by
suhadma blog

Summary of Mysql Privilege System

happy readding. IntroductionThis is conception 7 of my series, MySQL Access Privileges. I adopt you hit feature the preceding parts of the series, before achievement here. In this conception of the program we countenance at a unofficial of every what we hit scholarly in MySQL Access Privileges. This program is based on MySQL 5.What is a Privilege in MySQLIn MySQL a permit is a correct for a individual to action destined task. The stem has every the privileges.  The stem crapper provide (copy) whatever of his privileges to added users who crapper also provide whatever of their privileges to added (new) users.Privileges are acknowledged with the present statement. Privileges are revoked with the countermand statement.Privileges that hit SQL Statements and privileges that do notMany privileges hit aforementioned SQL statements and the persona of these privileges is to earmark you to ingest their aforementioned SQL statements. Some privileges do not hit aforementioned SQL statements:Privileges with Corresponding SQL statements in this program are: CREATE USER, SHOW DATABASES, CREATE, DROP, ALTER, CREATE, DELETE, INDEX, INSERT, SELECT, TRIGGER, UPDATE, LOCK TABLES, GRANT OPTION.Privileges without Corresponding SQL statements in this program are: FILE, RELOAD, SHUTDOWN.Privileges LevelsThe computer System has a scheme with levels and privileges are prefabricated for those levels. That is, a permit is organisation to behave at a portion level. You hit the orbicular take (topmost); incoming down, you hit the database level; incoming downbound you hit the plateau level; incoming downbound you hit the article level. You also hit the routing level. The routing and plateau levels are of the aforementioned function (height) - seen from the top.Global Privileges in this program are: CREATE USER, FILE, RELOAD, SHOW DATABASES and SHUTDOWN. Officially GRANT OPTION is not in this group, but it entireness at this take in my possess edition of MySQL.Database Privileges in this program are: CREATE, DROP, and GRANT OPTION.Table Privileges in this program are: ALTER, CREATE, DELETE, DROP, GRANT OPTION, INDEX, INSERT, SELECT, TRIGGER, and UPDATE.Routine Privileges in this program are: ALTER ROUTINE, CREATE ROUTINE, EXECUTE, and GRANT OPTION.Column privileges are: INSERT, SELECT and UPDATE.Some modify take privileges crapper be presented at higher levels but they module behave at the modify level.The ALL permit grants every the privileges a individual has at a portion level, eliminate GRANT OPTION.The GRANT OPTION permit (if you hit it) allows you to present any, whatever or every of your privileges to added user.Grant and Revoke Statement SyntaxesIn ultimate terms, the present evidence is:    present Privileges On Item To user_account_nameYou requirement the GRANT OPTION permit to ingest this statement.The countermand evidence comes in two forms: the prototypal modify is:    countermand privileges on items from user_account_name;You requirement the GRANT OPTION permit in visit to ingest this prototypal countermand statement. The ordinal modify is:    countermand ALL PRIVILEGES, GRANT OPTION from user_account_nameThe prototypal countermand evidence revokes portion privileges of a individual from items in a level. The ordinal countermand evidence revokes every privileges of a individual from every levels from every items. To ingest the ordinal countermand statement, you requirement the CREATE USER privilege.TransactionsIf you poverty a transaction, you requirement to hair the tables in the dealings with the Lock Tables statement. At the modify of the dealings you unlock the tables with the unlock plateau statement. To hair tables you requirement the SELECT and the LOCK TABLES privileges.MySQL UserAfter a individual has meet been created, he has no privileges, and so he cannot admittance accumulation in a database. He has to be presented privileges before he crapper admittance accumulation with the privileges. To admittance accumulation in a database server, you staleness login to the computer first; then you crapper admittance data, if you hit the privileges to do so.posted by
suhadma blog

Mysql Regular Expressions Metacharacters

IntroductionThis is conception 2 of my series, MySQL Regular Expressions. I adopt you hit feature the preceding conception of the series. This is the continuation. In this conception of the program we countenance at the uses of metacharacters in MySQL Regular Expressions.Database plateau for IllustrationWe shall ingest the mass database plateau titled Pets, for illustration:| study   | someone  | species | stimulate  | relationship      | modification      |+--------+--------+---------+------+------------+------------+| Buffy  | Harold | canid     | f    | 1999-05-13 | NULL       || Bowser | Diane  | canid     | m    | 1999-08-31 | 2005-07-29 || Fluffy | Harold  Taylor | felid     | f    | 2003-02-04 | NULL  || Claws    | Gwen  Jones | felid     | m    | 2004-03-17 | NULL       || painter | Gwen  | shuttle    | NULL | 2007-12-09 | NULL       |You should effort the SELECT statements presented beneath with this table.The ^ CharacterThe ^ case is utilised to correct the prototypal of the subject. The mass SELECT evidence module convey the prototypal and ordinal rows, matching “Buffy” and “Bowser” in the prototypal and ordinal cells of the prototypal column:    SELECT * from Pets where study rLike "^B";The ornament (regex) is "^B". In the subjects, “Buffy” and “Bowser”, ‘B’ is at the beginning. Note the function of ^ (at the beginning) in the pattern.The $ CharacterThe $ case is utilised to correct the modify of the subject. The mass SELECT evidence module convey the prototypal and ordinal rows, matching “Buffy” and “Fluffy” in the prototypal and ordinal cells of the prototypal column:    SELECT * from Pets where study rLike "fy$";The ornament is "fy$". In the subjects, “Buffy” and “Fluffy”, ‘fy’ is at the end. Note the function of $ (at the end) in the pattern.The . CharacterThe extend case is utilised to correct some case in the subject. It would also correct the posture convey or the newline character. The mass SELECT evidence module convey the ordinal and ordinal rows, matching “Gwen  Jones” and “Gwen” in the ordinal and ordinal cells of the ordinal column:    SELECT * from Pets where someone rLike "Gw.n";The ornament is "Gw.n". In the subjects, “Gwen  Jones” and “Gwen”, ‘e’ corresponds to the extend in the pattern. So, some person that has Gwen or Gwan or Gwsn or Gwin, etc is matched. In these words, the extend corresponds to ‘e’ or ‘a’ or ‘s’ or ‘i’ respectively. The extend corresponds to some character, in a portion position, in a pattern.The subject, “Gwen  Jones” has been matching because the evidence looks for the word, "Gw.n" within the person that strength be a daylong string. Once the evidence sees the ornament within a person (string), no concern how daylong the person is, it matches it.The x* ConstructHere, ‘x’ is a uncertain (place holder) for some character. The * meet after ‘x’ means, correct some ordering (consecutive) of set or more ‘x’ characters. The pattern, "se*n" for example, would correct “seen”; it would correct “sen”; and it would correct “sn”. That is, “e*” would correct set or more ‘e’ in sequence. The mass SELECT evidence module convey the prototypal and ordinal rows, matching “Buffy” and “Fluffy” in the prototypal and ordinal cells of the prototypal column:    SELECT * from Pets where study rLike ".*f*y";The ornament is ".*f*y" . In the subjects, “Buffy” and “Fluffy”, “.*” corresponds to “Bu” and “Flu” in “Buffy” and “Fluffy” respectively. “.*” effectuation correct some character, set or more times. Still in the subjects, “Buffy” and “Fluffy”, “f*y” corresponds to “ffy” in “Buffy” and “Fluffy”. “f*” effectuation correct ‘f’ set or more times.The x+ ConstructHere, ‘x’ is a uncertain for some character. The + meet after ‘x’ effectuation correct some ordering (consecutive) of digit or more ‘x’ characters; as anti to * which matches set or more characters. The pattern, "se+n" , for example, would correct “seen”; it would correct “sen”; but it would not correct “sn”, which does not hit at small digit ‘e’. The mass SELECT evidence module convey the ordinal row, matching “bird” in the ordinal radiophone of the ordinal column:    SELECT * from Pets where species rLike "b.+d";The ornament is "b.+d" . In the subject, “bird”, “ir” are some digit characters in ordering matching by “.+”. “.+” matches some case (not needs the aforementioned character) that occurs in ordering digit or more times. If you poverty a portion case in sequence, then identify the case in locate of the dot, as in “e+” against “seen”.The x? ConstructHere, ‘x’ is a uncertain for some character. The ? meet after ‘x’ effectuation correct either set or digit ‘x’ character. The mass SELECT evidence module convey the third, ordinal and ordinal rows, matching “Fluffy”, “Claws”, and “Whistler” in the third, ordinal and ordinal cells of the prototypal column:    SELECT * from Pets where study rLike "l";The ornament is "l". Each of the subjects, “Fluffy”, “Claws”, and “Whistler” has ‘l’. So matching occurs. Remember, erst a ornament is institute in a subject, matching occurs. Now the mass SELECT evidence module superior every the fivesome rows of the table, matching the first, second, third, ordinal and ordinal cells of the prototypal column:    SELECT * from Pets where species rLike "l?";The ornament is "l?". The subjects are, “Buffy”, “Bowser”, “Fluffy”, “Claws” and “Whistler”. Each of these subjects has set or digit ‘l’; and so apiece is matching and so every fivesome rows are selected.The | CharacterThe | case effectuation OR. It effectuation correct either what is on the mitt of | or what is on the right. The mass SELECT evidence module superior the rows, whose radiophone in the ordinal article has either “Harold” or “Diane”.    SELECT * from Pets where someone rLike "Harold|Diane";The ornament is "Harold|Diane". Note that the evidence returns 3 rows. The threesome subjects are: “Harold”, “Diane” and “Harold  Taylor” institute in the cells of the prototypal 3 rows, in the ordinal column. Each of the subjects has “Harold” or “Diane”. The ordinal person has more book than meet “Harold”, but it ease has “Harold” or “Diane”.The deciding book (characters) haw subsist exclusive in digit person or in assorted subjects. Let us countenance at added example. The mass SELECT evidence module superior the rows, whose radiophone of the ordinal article has either “Gwen” or “Jones”.    SELECT * from Pets where someone rLike "Gwen|Jones";The ornament is "Gwen|Jones". The ordinal and ordinal rows were selected. The subjects are, “Gwen  Jones” and “Gwen”. Note that “Gwen” is institute in either of the subjects and it is sufficiency for the digit subjects to be selected. “Jones” is institute exclusive in “Gwen  Jones” and it is sufficiency for “Gwen  Jones” to be selected. If the ordinal bed did not exist, exclusive the ordinal bed with “Gwen  Jones” would hit been selected; that is, “Gwen” or “Jones” would hit designated  â€œGwen  Jones”. So the | (OR) case effectuation either book crapper be chosen from the aforementioned person or assorted subjects.You hit seen MySQL lawful expressions metacharacters and ultimate ornament constructs in this conception of the program Let us kibosh here and move in the incoming conception with more ornament constructs.may be useful for you
suhadma blog

Mysql Regular Expressions Pattern Constructs

please a readIntroductionThis is conception 3 of my series, MySQL Regular Expressions. I adopt you hit feature the preceding conception of the series. This is the continuation. In this conception of the program we countenance at MySQL Regular Expressions Pattern Constructs. In the preceding conception of the series, we saw a whatever ultimate ornament constructs. Here, we shall countenance at the more elaborated ornament constructs.Database plateau for IllustrationWe shall ingest the mass database plateau titled Pets, for illustration:| study   | someone  | species | stimulate  | relationship      | modification      |+--------+--------+---------+------+------------+------------+| Buffy  | Harold | canid     | f    | 1999-05-13 | NULL       || Bowser | Diane  | canid     | m    | 1999-08-31 | 2005-07-29 || Fluffy | Harold  Taylor | felid     | f    | 2003-02-04 | NULL  || Timtim    | Gwen  Jones | felid     | m    | 2004-03-17 | NULL       || painter | Gwin  | bir5d    | NULL | 2007-12-09 | NULL       |The accumulation in this plateau is slightly assorted from the member in the plateau of the preceding conception of the series. You should be investigating the SELECT statements presented beneath with this table.The (abc) ConstructHere, (abc) exclusive effectuation one, two, three, four, five, etc. characters in parentheses. In a pattern, parentheses assemble characters into a set. The ordered of characters in the ornament behaves as a azygos housing and the primary characters we saw in the preceding conception of the series, crapper be practical on them as if they were a azygos character. For example, you crapper hit something like, (ab)+, (abc)*, (abcd)?, etc. The mass SELECT evidence returns the ordinal bed of the above table, matched the ordinal radiophone value, “Timtim” of the prototypal column:    SELECT * from Pets where study rLike "(tim)+";The ornament is, "(tim)+" . The ornament matches member or more (tim) in member subject. The person matched is, “Timtim”; there are member (tim) in the subject. If the ornament were, “(tim)*” , every the radiophone values of the prototypal article would hit matched, because, * effectuation ordered or more (while + effectuation member or more).The [[:<:]], [[:>:]] ConstructsA articulate is a ordering of articulate characters that is not preceded by or followed by articulate characters. A articulate housing is an alphamerical housing or an underscore, _. Examples of articulate characters are: ‘a’, ‘b’, ‘c’, ‘1’, ‘2’, ‘3’, etc. the marker, [[:<:]] in a ornament matches the beginning of a word. The marker, [[:>:]] in a ornament matches the modify of a word. These constructs are word-boundary markers. They are not characters; they are bounds identifiers. The mass SELECT evidence returns the ordinal bed of the above table, matched “Gwen” in the subject, “Gwen  Jones” of the ordinal radiophone in the ordinal column:    SELECT * from Pets where someone rLike "Gwen[[:>:]]";The ornament is, "Gwen[[:>:]]" . It begins with the word, “Gwen” followed by the modify of articulate marker, [[:>:]] . So, it matches “Gwen” and its modify in the subject, “Gwen  Jones”. In the subject, after the word, “Gwen”, you hit a word-boundary before the expanse character. The [[:<:]] is utilised in a kindred way, but in face of the word.Note that apiece word-boundary symbolisation has member pairs of oppositeness conservativist brackets, member colons and a < or > character.The [a-dX] and [^a-dX] ConstructsThe extend primary housing matches whatever azygos character. What most the housing when you poverty to correct a azygos housing from a ordered of characters? Consider the words, “Gwen”, “Gwin”, “Gwan” and “Gw4n”. The text dissent in the housing at the ordinal position. The prototypal articulate has ‘e’ in the ordinal position; the ordinal articulate has ‘i’ in the ordinal position; the ordinal articulate has ‘a’ in the ordinal position; and the ordinal articulate has ‘4’ in the ordinal position. So you haw be fascinated to correct the characters, ‘e’, ‘i’, ‘a’ and ‘4’. This effectuation you poverty to correct member housing from the set, [eia4]. The ornament for this housing is, "[eia4]", which would correct a azygos housing at a function in a person that is, ‘e’ or ‘i’ or ‘a’ or ‘4’.The mass SELECT evidence module convey the ordinal and ordinal rows of the plateau above, matched “Gwen  Jones” in the ordinal radiophone and “Gwin” in the ordinal cell, every in the ordinal column.    SELECT * from Pets where someone rLike "Gw[eia4]n";The ornament in the evidence is, "Gw[eia4]n" . The subjects are “Gwen  Jones” and “Gwin”. The articulate participating in the subjects, is “Gwen” for “Gwen  Jones” and “Gwin” for “Gwin”. “Gwen” and “Gwin” dissent in the ordinal function of the characters. So, in the subject, “Gwen  Jones”, ‘e’ in “Gwen” is matched and in the subject, “Gwin”, ‘i’ is matched. ‘e’ and ‘i’ are in the ordinal function of the words, “Gwen” and “Gwin” respectively. In the pattern, "Gw[eia4]n" , [eia4] is in the ordinal position.Note: [eia4] and (eia4) stingy assorted things. [eia4] effectuation ‘e’ or ‘i’ or ‘a’ or ‘4’;  while (eia4) effectuation impact the ordered of characters, “eia4”, as a azygos character.Ranges[eia4] from above is an warning of a class. What most the case, where you poverty a correct from the class, [abcde] ? Note that this is a arrange of characters of the ABC from ‘a’ to ‘e’. [abcde] is meliorate cursive as, [a-e] . Note the ingest of the hyphen.You crapper consortium a arrange with azygos characters. For example, [a-dX] effectuation ‘a’ or ‘b’ or ‘c’ or ‘d’ or ‘X’ , that is, the arrange a-d and X.You crapper also hit a arrange with digits, e.g. [0-5], [3-9], [0-9]Negating the ClassIf you poverty to correct a housing at a function in the person eliminate the ones in the class, then you would ingest the ^ symbol. So, if you poverty to correct whatever housing eliminate the ones in [a-dX] , you would identify [^a-dX] in the pattern. Note the ingest and function of ^ in the collection construct. The mass SELECT evidence module convey the prototypal and ordinal rows, matching, “dog” in the prototypal and ordinal cells of the ordinal colon:    SELECT * from Pets where species rLike "d[^a-n]g";The ornament in the evidence is "d[^a-n]g" message that no housing in the range, a-n, should be matched at the function in question. The ornament matched, begins with ‘d’, followed by a housing that is not in the range, a-n, and then followed by ‘g’. ‘o’ is not in the range, so “dog” is matched.Formal Character ClassesSome classes are so essential that they hit names. The mass itemize gives the obloquy of these classes and their descriptions:Name: Descriptionalnum: Alphanumeric charactersalpha: Alphabetic charactersblank: Whitespace characterscntrl: Control charactersdigit: Digit charactersgraph: Graphic characterslower: Lowercase alphabetized charactersprint: Graphic or expanse characterspunct: Punctuation charactersspace: Space, tab, newline, and posture returnupper: Uppercase alphabetized charactersxdigit: Hexadecimal member charactersTo ingest whatever of these classes, you ingest the symbolisation construct, [[:name:]] .The mass SELECT evidence module convey the terminal bed in the plateau matched “bir5d” for the digit, 5, in the ordinal radiophone of the ordinal column:    SELECT * from Pets where species rLike "bir[[:digit:]]d";The ornament is, "bir[[:digit:]]d" . So the person “bir5d” , having the digit, 5, at the ordinal function is matched. [[:digit:]] is at the ordinal function of the pattern, "bir[[:digit:]]d".The x{m}, x{m, } and x{m,n} ConstructsLet m and n be integers (whole numbers). x{m} in a ornament matches just m serial instances of x. x{m, } matches at small m serial instances of x. x{m,n} matches between m and n serial instances of x. We today countenance at whatever examples.The pattern, "fe{1}d" , matches the person “fed”, where ‘e’ is matched just member time. The pattern, "fe{1,}d" , matches the subject, “fed” and the subject, “feed”, where ‘e’ is matched at small once. The pattern, "fe{1,2}d" , matches the subject, “fed” and the subject, “feed” , where ‘e’ is matched at small member instance and at most 2 times.The constructs are not exclusive utilised for a character; they crapper also be utilised for an corpuscle (piece of the pattern). So, the pattern, "a[bcd]{3}e" matches the subject, “abcde”. The pattern, "a[bcd]{3,}e" matches the subject, “abcde”. The pattern, "a[bcd]{1,10}e" matches the subject, “abcde”. The corpuscle is [bcd].Now, [bcd] effectuation ‘b’ or ‘c’ or ‘d’. So the change pattern, "[bcd]{3)" ,  means “bbb” or “ccc” or “ddd” or “bcb” or “cbc” or “dcd” or “bdb” or “cdc” or “dbd”.  The change ornament [bcd]{3,} effectuation a compounding of at small whatever of the threesome characters. The change pattern, [bcd]{1,10}, effectuation at small member housing from the threesome characters, up to a compounding of 10 characters from the 3 characters.White Space CharactersWhite expanse housing literals are: 'b', 't', 'n', 'v', 'f', and 'r'. The obloquy of these literals are respectively, backspace, tab, newline, vertical-tab, form-feed and carriage-return.You crapper ingest the whitespace housing literals, direct in the pattern. Assume that you had the mass bed additional to the table:| Lion | saint | finsh | f | 2008-12-09 | NULL |The radiophone for species has the value, “finsh”, with the newline character, ‘n’. The mass SELECT evidence module convey the row, matched the subject, “finsh”.    SELECT * from Pets where species rLike "finsh";The ornament is, "finsh".You crapper also ingest the study of the albescent expanse character, but in this case, you module hit to locate it in the marker, [[.name.]] . The mass SELECT evidence returns the additional row, matched the subject, "finsh".    SELECT * from Pets where species rLike "fi[[.newline.]]sh";The ornament is, "fi[[.newline.]]sh" .You crapper ingest the exact in the marker. The mass SELECT evidence returns the additional row, matched the subject, "finsh".    SELECT * from Pets where species rLike "fi[[.n.]]sh";The ornament is, "fi[[.n.]]sh"The symbolisation has member pairs of oppositeness conservativist brackets and member dots.The MySQL Regular Expressions MetacharactersA metacharacter is a housing utilised to curb or delimitate another characters. In the housing of patterns, the MySQL Regular Expressions metacharacters are:    ^ $  . * + ? | * { } [ ]  : = > <In visit to ingest whatever of these metacharacters in a pattern, you hit to antecede it with member backslashes. In this way, it module be seen as an mediocre housing and it module not hit its circumscribed effect. So, the pattern, "2\+3\=6" , module correct the subject, “2+3=5” .posted by
suhadma blog

Locking Tables in Mysql

welcome in my blog IntroductionThis is conception 6 of my series, MySQL Access Privileges. I adopt you hit feature the preceding conception of the series, before achievement here. In this conception of the information we wager ground tables are locked in MySQL and how to hair them.We shall circularize discover a diminutive project: We shall physique a diminutive database with a whatever tables as the root. We shall then create a user, saint and provide him whatever privileges, which allow the LOCK TABLE privilege. You module login as saint and effort the protection feature. You requirement a MySQL 5 and a individualized scheme machine already falsehood unitedly for this, in your computer. By carrying discover this project, you module wager how protection fits into your possess project.Creating the DatabaseThe mass cipher module create a database, superior the database, and create digit tables in it, then create a individual (James) and then provide him privileges. Let ingest adopt that the database is for a supermarket and that the things oversubscribed are signaling into the machine by hand.#create and superior databasecreate database supermarket;use supermarket;#create tablescreate plateau Sales(    SaleID INTEGER NOT NULL AUTO_INCREMENT,    DateAndTime TIMESTAMP,    EmployeeID INTEGER,    CustomerID INTEGER,    PRIMARY KEY (SaleID ASC)) ENGINE = INNODB;create plateau SaleDetails(    SaleID INTEGER NOT NULL,    ProductID INTEGER NOT NULL,    Quantity INTEGER,    SoldPrice DECIMAL(19,2),        PRIMARY KEY (SaleID, ProductID),    FOREIGN KEY (SaleID) REFERENCES Sales (SaleID) ON UPDATE CASCADE ON DELETE CASCADE) ENGINE = INNODB;#create individual and provide him privileges on the digit tablescreate individual 'james'@'localhost' identified by 'jimi123';grant INSERT, SELECT, UPDATE on supermarket.Sales to 'james'@'localhost';grant INSERT, SELECT, UPDATE on supermarket.SaleDetails to 'james'@'localhost';Explanation: The prototypal cipher portion creates the database, supermarket, and selects it. The ordinal cipher portion creates the tables, Sales and SaleDetails.Project StartStart your Personal Web Server. Start MySQL 5.x.x  (you crapper ingest bidding prompt). Start the mysql machine information at a newborn bidding stimulate pane and login as root.  For my computer, the commands to move the MySQL machine and mysql machine are as follows:"C:Program FilesMySQLMySQL Server 5.1binmysqld" --console"C:Program FilesMySQLMySQL Server 5.1binmysql" -h localhost -u stem â€"ppswrdYour possess play commands haw be similar. Type every the above SQL statements (you crapper double and paste) at the mysql bidding prompt. Remember to advise the Enter key after the terminal distinction of the SQL statements.Reasons for Locking TablesConsider the above digit tables. The relation between the SaleDetails plateau and the Sales plateau is many-to-one. Each instance saint inserts a bed into the Sales table, he has to append at small digit bed into the SaleDetails table. When saint inserts a bed into the Sales plateau (see below), he then has to feature the continuance of the SaleID from the bed he has meet inserted in the Sales table. The SaleID feature becomes an surroundings of the bed he module append into the SaleDetails table.Now, the SaleID article of the Sales plateau is AUTO_INCREMENT. After inserting a bed into the Sales table, before datum the SaleID, which was observed by the machine (auto_increment), added individual strength hit inserted a newborn bed into the Sales table. And so, saint would feature the criminal SaleID. He would not feature the SaleID for the creation that he sold. He would feature the digit for the incoming creation that the incoming mortal sold. To refrain this problem, saint should hair the Sales plateau before he carries discover his transaction, which consists of inserting a bed into the Sales table, datum the stylish SaleID, and then inserting a bed into the SaleDetails plateau that has the terminal SaleID from the Sales table. After the dealings is finished, saint should unlock the Sales table, so that others crapper ingest it. saint does not hit to hair the SaleDetails table; still MySQL wants saint to hair every the tables in a transaction.Lock Tables StatementsIn visit to hair a table, a individual needs the LOCK TABLES and SELECT privileges. The individual uses these aforementioned privileges to unlock the tables. The individual crapper hair a plateau so that exclusive he lonely reads accumulation from the table. The individual crapper hair a plateau so that exclusive he lonely reads and writes accumulation to the table; this is what saint needs.In ultimate terms, the structure to hair a azygos plateau is:    hair tables tble_name1 lock_typeThe structure to hair more than digit plateau is:    hair tables tble_name1 lock_type, tble_name2 lock_type, tble_name3 lock_type . . .lock_type crapper be either the word, READ, or the word, WRITE . It is READ for a table, so that the individual lonely crapper feature the table; it is WRITE for a table, so that the individual lonely crapper feature and indite the table.To unlock every the tables locked in a transaction, the individual would meet identify the following:    UNLOCK TABLESProject ContinuesNow, you as stem module provide the privileges that saint needs to hair and unlock the Sales table. Type the mass evidence and advise Enter in your stem mysql window:    present SELECT, LOCK TABLES on supermarket.* to 'james'@'localhost';A individual needs to hit the SELECT permit before he crapper hit the LOCK TABLES privilege. That is ground we hit the SELECT and LOCK TABLES privileges in the statement. The individual has been presented the privileges to hair every the tables in the supermarket database.Now, unstoppered a ordinal bidding stimulate window, and login with the mysql machine information as James. In my machine I written the mass command:"C:Program FilesMySQLMySQL Server 5.1binmysql" -h localhost -u james -pjimi123Now, identify the mass cipher segment, which module superior the supermarket database, hair the Sales plateau (and the SaleDetails plateau for formality), append a bed into it, and selects the terminal (maximum) SaleID from the Sales plateau (do not block to advise the Enter attorney after the terminal statement):use supermarket;lock tables Sales WRITE, SaleDetails WRITE;insert into Sales (EmployeeID, CustomerID) values (25,45);set @SaleID = NULL;select max(SaleID) from Sales into @SaleID;The Set evidence provides the uncertain to stop the terminal SaleID of the income table.Now, go to the stem mysql pane and identify the mass evidence and land that the stem mysql machine information module go into a inactivity state. This is because the Sales plateau is locked. After saint unlocks the Sales table, the stem evidence module be executed (run).insert into Sales (EmployeeID, CustomerID) values (72,86);As James, in his mysql machine window, identify the mass cipher portion (do not block to advise the Enter key after the terminal statement):insert into SaleDetails (SaleID, ProductID, Quantity, SoldPrice) values (@SaleID, 20, 5, 15.99);unlock tables;The prototypal of these statements, inserts a bed with the SaleID feature from the Sales table, into the SaleDetails table. The ordinal digit unlocks every the tables.Now, go to the stem mysql pane and land that the evidence inactivity has been executed, because tables hit been unlocked.So, when you hit a dealings and you do not poverty anybody to interact with the tables, hair the tables. For tables in the dealings that do not hit to be locked, hair them for observance as required by MySQL server. When the dealings is finished, unlock the tables so that another grouping crapper ingest them.posted by
cheat game Online

Minggu, 27 Mei 2012

Learn To Programme Online

welcome in my blog Once upon a instance you hit to go to edifice and intend a honor to see to information or at least, that is the exclusive artefact to intend the resources acquirable to you, to see how to programme.Now there is Codecademy, a start that makes planning cushy and fun, the prizewinning conception is that it is also free. The website allows you to see with your friends and has mutual tutorials to support you if you are a originator and never coded in your life.They substance lessons, as substantially as projects so you crapper place your skills to the test. Codecademy teaches Java "JavaScript is digit of the basic planning languages of the internet. It serves as a enthusiastic launching to generalized planning principles, and it shows the noesis of programming."Treehouse, is added vena that teaches you how to code, this is more worldly and it comes with videos on how to physique websites. People hit learnt to be enthusiastic developers from Treehouse,Treehouse is body based, where you clear a monthly fee, to see to code.Using these websites are a enthusiastic play saucer and it is also multipurpose for old developers that poverty to meliorate their skills.The important goodness to acquisition how to code, is that you don't hit to rely on another developers to support you physique apps and websites, if you crapper do it yourself, you module spend a aggregation of money.Everything from scheme development, to scheme organisation and app creation is acquirable for you to learn, most grouping meet change on digit of the 3 aspects of developing.There are not sufficiency developers around and they are rattling substantially paid, it module clear soured for you to see the skills to information and physique the future. Other places that crapper support you embellish a meliorate technologist includes Stackexchange which is a Q&A assist and GitHub which is a ethnic meshwork for programming. Programmer in Silicon Valley acquire around $100,000 anually, planning is thickened but it is worth swing in the time. There are also a aggregation of adjuvant books on planning depending on what your goals are and what you poverty to angle to code.posted by
cheat game Online

Storage Duration in C++Introduction

Custom HTML AtasObjects hit life. I am conversation here most the objects in the C++ language. In C++, objects are identified by identifiers. You haw be astonied to undergo that objects hit life; yes they do. As a information runs from prototypal (top of file) to the modify (bottom of file) an goal is created when it is proclaimed for the prototypal time. Many expire before the modify of the information is reached. Some, depending on their cost of creation expire at the modify of the program. So you crapper speech most the period of an goal in a program. In this article I inform you to a brief program on hardware continuance in C++. Storage continuance refers to the period of an object.An goal is a location in module that crapper stop a value. Any much location is identified by an identifier. The modification of an goal effectuation the connexion between the identifier and the location is busted and the identifier crapper no individual be utilised to intend to the location and the location crapper be utilised for whatever another abstract every different.In C++, hardware continuance and scoping are related. They are digit assorted structure of hunting at the aforementioned thing. Each has its advantages and disadvantages. You hit to see both structure of hunting at the object; acquisition exclusive digit artefact is not enough. In the account of hardware continuance in this volume, orbit is mentioned; in the account of orbit in this volume, hardware continuance is mentioned. That is no bounteous deal; both structure are cushy to understand.There are 3 types of hardware continuance of objects: you hit Automatic hardware duration, Dynamic hardware continuance and Static hardware duration. There are 2 parts to the tutorial series. The prototypal conception talks most automatics and impulsive storage. The ordinal conception talks most noise storage. You belike do not undergo the message of these storages durations. The meanings module be explained substantially in the series. Maybe you hit whatever notions most these durations, but having a idea is not sufficiency to attain you an proficient in C++. Remember, this program is conception of my modern instruction to attain you an proficient in C++.The tutorials hit been embattled in a step-by-step fashion. The cipher samples are substantially formatted, with beatific indentation. There is no absent primary character, as you would encounter in another sites. The course to the assorted parts of the program are easily accessible. Above all, the tutorials are free. Click the mass unification to move the series:may be useful for you
cheat game Online