Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle alias case-solution

Shulou Source: shulou.com Published: 2022-06-01 08:29:17 10月03日 Update

To do the treeview of bootstrap today, you are required to input node ID id, parent node ID pid, and text text

But the sql aliases executed are all uppercase, so I looked for the problem of how to lowercase orcl aliases.

The code is as follows:

SELECT T.FUN_ID "pid", T1.FUN_ID id,T1.FUN_NM text,T1.FUN_ID, T1.FUN_CD, T1.FUN_NM FROM T_SM_FUNCTIONS T, T_SM_FUNCTIONS T1 WHERE T.FUN_ID = T1.PAR_FUN_ID AND T.FUN_ID ='5' AND T1.FUN_ID'5'

The alias is displayed in lowercase with double quotation marks

If it is in java, escape is used, as follows

String sql = "SELECT T.FUN_ID\" pid\ ", T1.FUN_ID\" id\ ", T1.FUN_NM\" text\ ", T1.FUN_ID, T1.FUN_CD, T1.FUN_NM" + "FROM T_SM_FUNCTIONS T T_SM_FUNCTIONS T1 "+" WHERE T.FUN_ID = T1.PAR_FUN_ID "+" AND T.FUN_ID ='"+ funid+"'"+" AND T1.FUN_ID'"+ funid+"'" List list = this.queryForList (sql); return list

Tags: Aliases lowercase node code uppercase quotation marks text way is in escape problem input size solution solution Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Linux Redmi Huawei vpn