# SQL Portability - SQL Dialects

- ## Most people are familiar with how to portably quote a string literal:

  $dbh->quote($value)

- ## It’s now also possible to portably quote identifiers like table names:

  $dbh->quote_identifier($name1, $name2, $name3, \%attr)
  For example:
  $dbh->quote_identifier( undef, 'Her schema', 'My table' );
  using DBD::Oracle: "Her schema"."My table”
  using DBD::mysql: `Her schema`.`My table`

- ##

- ## If three names are supplied then the first is assumed to be a catalog name and special rules may be applied based on what get_info() returns for SQL_CATALOG_NAME_SEPARATOR and SQL_CATALOG_LOCATION. For example:

  $dbh->quote_identifier( ’link’, ’schema’, ’table’ );
  using DBD::Oracle: "schema"."table"@"link"

Previous slide | Next slide | Back to first slide | View graphic version