Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

[an error occurred while processing this directive]

Identifiers & Qualifiers

                         

In this section you will learn about describing the allowable syntax for identifiers in MySQL. The identifiers are Database, table, index, column and alias name. The following table describes the maximum length for each type of identifier.
      
Identifier Maximum length 
Database 64
table 64
column 64
Index  64
Alias 255

Some restriction on the character, which may appear in identifier are given below :

  • No identifier can contain ASCII 0 or byte with a value of 255.
  • Use of identifier quote character is permitted in identifiers. But avoidance of doing so if possible then it is best.
  • The MySQL identifiers table, column and database should not end with space character.
  • Database names cannot contain characters that are not allowed in directory name or  ' / ', ' \ ', ' - ',.
  • Table name cannot contain  '/ ', ' \ ', ' - ', or character are not allowed in a filename.
  • The identifier length is in bytes not in characters. But if you use multi-byte characters in identifier names then the maximum length will depend on the byte count of all the characters used.

MySQL allows names that have single identifier or multiple identifiers. The multiple part name of components can be separated by period ‘.’ Characters and initial parts of multiple-part name work as qualifiers that affect the context within which the final identifier is interpreted

You can refer to a column any of the following form in MySQL.  

  • col_name: The column col_name that is used from which table in statement have a column of that name.
  • tbl_name.col_name:- The column col_name from table tbl_name of the default database.
  • db_name.tbl_name.col_name:-The column col_name from table tbl_name of the database db_name.

If a multiple-part name of any component need the quoting then quote them individually rather than the name as a whole. For example, you have to write ‘Emp-table’.’Emp-column’ rather than ‘Emp-table.Emp-column’. You should not specify tbl-name or db_name.tbl_name prefix to a column reference in a statement until the reference would be ambiguous. For example – Table1 and Table2 both have column age and we retrieve the column age by a SELECT statement that used by both table. In this situation, column age is ambiguous because it is not unique and both tables used it in the statement. That’s why we have to qualify the column age with a table name as table1.age or table2.age for indicating which table you mean.

 

                         

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

0 comments so far (post your own) View All Comments Latest 10 Comments:

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.