{"id":1240,"date":"2011-10-12T02:42:23","date_gmt":"2011-10-12T07:42:23","guid":{"rendered":"http:\/\/www.dpriver.com\/blog\/?page_id=1240"},"modified":"2011-10-12T02:42:23","modified_gmt":"2011-10-12T07:42:23","slug":"how-to-access-view-alias-in-create-view-statement-via-sql-parser","status":"publish","type":"page","link":"https:\/\/www.dpriver.com\/blog\/list-of-demos-illustrate-how-to-use-general-sql-parser\/how-to-access-view-alias-in-create-view-statement-via-sql-parser\/","title":{"rendered":"How to access view alias in create view statement via SQL parser"},"content":{"rendered":"

Access view alias in create view SQL statement is very easily after SQL script was parsed successfully by General SQL Parser.<\/p>\n

Take this SQL for example:<\/p>\n

    \r\nCREATE OR replace VIEW test1\r\n(account_name_alias, account_number_alias)\r\nAS\r\n  SELECT account_name,\r\n         account_number\r\n  FROM   AP10_BANK_ACCOUNTS t; \r\n<\/pre>\nThe parse result generated by SQL parser is something like this:<\/p>\n\r\ncreate view statement:\r\nView name: test1\r\nView alias: account_name_alias\r\nView alias: account_number_alias\r\n\r\nSubquery:\r\n\r\nColumns\r\n\tFullname:account_name\r\n\tFullname:account_number\r\n\r\nfrom clause:\r\n\tAP10_BANK_ACCOUNTS t\r\n\ttablename:AP10_BANK_ACCOUNTS\r\n\ttablealias:t\r\n<\/pre>\nDownload source code of this demo: C# version<\/a>, Java version<\/a>, <\/p>\n","protected":false},"excerpt":{"rendered":"Access view alias in create view SQL statement is very easily after SQL script was parsed successfully by General SQL Parser. Take this SQL for example: CREATE OR replace VIEW test1 (account_name_alias, account_number_alias) AS SELECT account_name, account_number FROM AP10_BANK_ACCOUNTS t; The parse result generated by SQL parser is something like this: create view statement: View name: test1 View alias: account_name_alias View alias: account_number_alias Subquery: Columns Fullname:account_name Fullname:account_number from clause: AP10_BANK_ACCOUNTS t tablename:AP10_BANK_ACCOUNTS tablealias:t Download source code of this demo: C# version, Java version,<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":235,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"gsp_feature_page_tt.php","meta":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"yoast_head":"\nHelp you to make better use of General SQL Parser<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\t\n