OCI8 table alias - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: OCI8 table alias (/showthread.php?tid=81886) |
OCI8 table alias - iRedds - 05-15-2022 Hi. Can anyone with Oracle knowledge audit the BaseBuilder::buildSubquery() method? And possibly add tests for the case. I'm having doubts about the use of the "AS" keyword to specify an alias. For most DBMSs, using "AS" is fine, but according to the link, Oracle doesn't use "AS" for tables. PHP Code: protected function buildSubquery($builder, bool $wrapped = false, string $alias = ''): string RE: OCI8 table alias - JustJohnQ - 05-15-2022 (05-15-2022, 06:14 AM)iRedds Wrote: Hi. You can discard the 'AS' to specify an alias This gives an error (ORA-00933: SQL command not properly ended): Code: select myUsers.Name from users as myUsers This works just fine: Code: select myUsers.Name from users myUsers Code: SELECT PRN_SHIFTS.STARTED, machines.LOCAL_ID FROM PRN_SHIFTS And this gives an error (ORA-00904: "PRN_MACHINES"."ID": invalid identifier): Code: SELECT PRN_SHIFTS.STARTED, machines.LOCAL_ID FROM PRN_SHIFTS |