Sample Header Ad - 728x90

Create View giving SQL7029

0 votes
1 answer
495 views
If relevant, I'm using IBM i V7R1M0. I have some code in C#:
#
var generateSqlSql = $@"
CALL QSYS2.GENERATE_SQL(
    '{obj.Name}',
    '{obj.Library}',
    'VIEW',
    CREATE_OR_REPLACE_OPTION => '1',
    HEADER_OPTION => '0',
    COMMENT_OPTION => '1',
    PRIVILEGES_OPTION => '0',
    LABEL_OPTION => '0'
)";
...
//get results
//split on semicolon
//change library
//write back to database
The sql that it's then trying to write is:
CREATE OR REPLACE VIEW AMMLIBC.BBI_USER_MY_VIEW FOR SYSTEM NAME         BBIU_00001 ( 
/* view columns */ ) 
AS 
/*view definition */
RCDFMT BBIU_00001
When I try to run it, it gives the following error:
iDB2SQLErrorException: SQL7029 New name BBIU_00001 is not valid.
...Why? What's causing this, and how do I make it work?
Asked by Sarov (281 rep)
Sep 10, 2019, 02:49 PM
Last activity: Oct 17, 2020, 03:03 AM