0

I have a teradata query that is mentioned below

Grant Dump, restore, select on FAD-Data.Practice to Backup_1

It is giving me error that something expected between the word Fad and '-'

The database name is not correctly written but how can I make sure to grant rights from FAD-Data.practice to Backup_1 without changing database name. Also to mention that is sample code, I am using cursor to fetch database names and grant rights on it. I need a way that if the cursor fetches database name that contain database name like I have mentioned above so that it doesnot cause error and rights are granted on it

Let me elaborate it in further details Lets say that the cursor fetched database name like

    For Rights_Grant as GETINDEX Cursor for
    sel database name from dbc.databases

Do
set DB_NAME=Rights_GRANT.DATABASENAME;
set SQL_TEXT='Grant Dump, restore, select on || DB_NAME || to Backup_1;';

If the cursor picks up database name like 'FAD-Data.Practice' it through an error. All want is that if cursor encounter name as mentioned above, it should execute

fahad pirzada
  • 103
  • 10

0 Answers0