Redian新闻
>
help: question on oracle sys_context()
avatar
help: question on oracle sys_context()# Database - 数据库
d*a
1
I had a table and I want to retrieve those rows whose fname
is the same as the user name of the login user. the
following is what i ran in sql+
SQL> select * from e1;
UNAME FNAME LNAME ADDR
avatar
a*i
2
try
select * from e1 where fname like '%'+sys_context('userenv', 'session_user')
+'%';
I suspect the string SYS_CONTEXT returns is not only 'SYSTEM' but with some other
empty spaces.

【在 d**a 的大作中提到】
: I had a table and I want to retrieve those rows whose fname
: is the same as the user name of the login user. the
: following is what i ran in sql+
: SQL> select * from e1;
: UNAME FNAME LNAME ADDR

avatar
d*a
3
thanks for your advice. i think i found the problem. it's
not what sys_context returns contains empty spaces but the
fname in e1 contains empty spaces. i will try more. thanks
again.

【在 a*****i 的大作中提到】
: try
: select * from e1 where fname like '%'+sys_context('userenv', 'session_user')
: +'%';
: I suspect the string SYS_CONTEXT returns is not only 'SYSTEM' but with some other
: empty spaces.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。