htcilt
04-26-2009, 10:22 PM
I have a table containing many rows of usernames. I want to say:
if current user's username is found in the usernames table, then do something
else do nothing
I use upper(PORTAL.wwctx_api.get_user) to get the username of whoever is logged in.
This is my code so far
select 'some html' from domain.table where upper(PORTAL.wwctx_api.get_user) not like upper(username)
This doesn't seem to work. I tried using != <> and not like, but they all return 'some html'. I've tried = and although its the wrong way around (I want it to return 'some html' if current user is NOT found in usernames) it does seem to work better, but I get "no rows returned" if the username isn't found.
I've tried doing case statements, but I get an output for every row in the table.
Hope I've explained this clearly? Can anyone help?
if current user's username is found in the usernames table, then do something
else do nothing
I use upper(PORTAL.wwctx_api.get_user) to get the username of whoever is logged in.
This is my code so far
select 'some html' from domain.table where upper(PORTAL.wwctx_api.get_user) not like upper(username)
This doesn't seem to work. I tried using != <> and not like, but they all return 'some html'. I've tried = and although its the wrong way around (I want it to return 'some html' if current user is NOT found in usernames) it does seem to work better, but I get "no rows returned" if the username isn't found.
I've tried doing case statements, but I get an output for every row in the table.
Hope I've explained this clearly? Can anyone help?