Welcome to the SAP BPC and HANA blog

Welcome to the SAP BPC and HANA blog On this site, I will publish the contents of my book on Implementing SAP BPC and HANA. It is a compr...

Identifiers

Identifiers identify anything in a sql statement with a name, for example, table names, views, procedures, users and so on. Identifiers can be delimited or unlimited. Delimited identifiers are enclosed in either a single quote ‘ or double quote “.

Undelimited identifier names

Must start with a letter or even an underscore. The following table names are legal (Using the CREATE statement which is covered in more detail later);

CREATE table TAB1 …
CREATE table _TAB1 …
CREATE table _1TAB …
CREATE table TAB1# …

But the following are not legal table names;

CREATE table 1TAB …
CREATE table @TAB …
CREATE table _TAB@ …

Delimited identifier names

Enclosed in double quotes “ and can contain any character as well as special characters. For example, the following are allowed:

CREATE TABLE "TAB1" LIKE _ty_test;
CREATE TABLE "_TAB1" LIKE _ty_test;
CREATE TABLE "_1TAB" LIKE _ty_test;
CREATE TABLE "TAB1#" LIKE _ty_test;
CREATE TABLE "1TAB" LIKE _ty_test;
CREATE TABLE "@TAB" LIKE _ty_test;
CREATE TABLE "_TAB@" LIKE _ty_test;

These statements will create the following objects in the repository:


By following the rules specified above, the tables can be deleted using the following syntax. The table name will only be delimited in instances where it is required:

DROP TABLE TAB1;
DROP TABLE _TAB1;
DROP TABLE _1TAB;
DROP TABLE TAB1#;
DROP TABLE "1TAB";
DROP TABLE "@TAB";
DROP TABLE "_TAB@";











No comments:

Post a Comment