Home » SQL & PL/SQL » SQL & PL/SQL » How to Save password in **** format in tables (merged)
How to Save password in **** format in tables (merged) [message #273896] Fri, 12 October 2007 02:52 Go to next message
admurthi
Messages: 7
Registered: September 2007
Junior Member

Hi all,

I would like to know the query by which we can store password as ****.
and if we give the select query, **** shld be dispalyed..

and another query

if we give a decode query in this way its working,

SELECT ename AS name, DECODE(sal,(800),'exec')AS position FROM emp;

if we want to select the ename who gets sal>800 as manager...
not working..

brainies help me..

regards
Murthi.a

[Updated on: Fri, 12 October 2007 07:50] by Moderator

Report message to a moderator

Re: How to store the password in the user table as ***** [message #273900 is a reply to message #273896] Fri, 12 October 2007 02:59 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ insert *****
2/ search same question has been asked yesterday.

Regards
Michel
Re: How to store the password in the user table as ***** [message #273901 is a reply to message #273896] Fri, 12 October 2007 03:00 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You can create a view on the table, and display **** instead of a single column.
I believe if you create a Virtual Private Daabase then you can configure things to restrict access to individual columns on tables.

Other than that, you can't do it.

Why would you want to store a non-hashed, non-encrypted password in the database anyway.
Re: How to store the password in the user table as ***** [message #273915 is a reply to message #273901] Fri, 12 October 2007 04:12 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

Quote:

if we want to select the ename who gets sal>800 as manager...itz not working..


add a where clause.what's not working?.can you explain more.


regards,
Re: How to store the password in the user table as ***** [message #273925 is a reply to message #273915] Fri, 12 October 2007 04:42 Go to previous messageGo to next message
admurthi
Messages: 7
Registered: September 2007
Junior Member

hi,

if we give a decode query in this way its working,

SELECT ename AS name, DECODE(sal,(800),'exec')AS position FROM emp;

but if i want to categrise the ename who gets more than (sal>800) as manager means it showng some error...

SELECT ename AS name, DECODE(sal,sal>800,'manager')AS position FROM emp;

i tried in CASE function then also i cld not get the solution

SELECT ename, CASE WHEN sal BETWEEN 800 AND 1000 THEN 'executive'
WHEN sal BETWEEN 1000 AND 3000 THEN 'manager'
ELSE 'sample' END AS SAM FROM EMP

regards
murthi
Re: How to store the password in the user table as ***** [message #273927 is a reply to message #273925] Fri, 12 October 2007 04:46 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
WHAT is not working.
We can't see your screen.
We don't know what you're trying to do.
We don't know what your tables look like

Does it give the wrong results?
Does it error?
Does it cause pink Moon Mice to descend from the sky in neon yellow dirigibles?

Give us something to work with!!!
icon5.gif  Re: How to store the password in the user table as ***** [message #273933 is a reply to message #273925] Fri, 12 October 2007 04:57 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

it works for me.
SELECT ename, CASE WHEN sal BETWEEN 800 AND 1000 THEN 'executive'
WHEN sal BETWEEN 1000 AND 3000 THEN 'manager'
ELSE 'sample' END AS SAM FROM EMP


ENAME      SAM       
---------- --------- 
SMITH      executive 
ALLEN      manager   
WARD       manager   
JONES      manager   
MARTIN     manager   
BLAKE      manager   
CLARK      manager   
SCOTT      manager   
KING       sample    
TURNER     manager   
ADAMS      manager   
JAMES      executive 
FORD       manager   
MILLER     manager   

14 rows selected


Quote:

i tried in CASE function then also i cld not get the solution


what actually is your desired output? i am still not able to understand.


regards,
Re: How to store the password in the user table as ***** [message #273935 is a reply to message #273925] Fri, 12 October 2007 05:01 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
A statement must end with a ; or been followed by a / if you want it to be executed (in SQL*Plus which is the default tool).

(And it also works for me)

Regards
Michel
Re: How to store the password in the user table as ***** [message #273956 is a reply to message #273896] Fri, 12 October 2007 06:20 Go to previous messageGo to next message
admurthi
Messages: 7
Registered: September 2007
Junior Member

hi all

i end with a error i execute this Query in my system

SQL> SELECT ename, CASE WHEN sal BETWEEN 800 AND 1000 THEN 'executive'
  2  WHEN sal BETWEEN 1000 AND 3000 THEN 'manager'
  3  ELSE 'sample' END AS SAM FROM EMP;
SELECT ename, CASE WHEN sal BETWEEN 800 AND 1000 THEN 'executive'
                        *
ERROR at line 1:
ORA-00923: FROM keyword not found where expected


tell me the reason..

regards


[mod-edit] removed illiterate IM speak

[Updated on: Fri, 12 October 2007 07:52] by Moderator

Report message to a moderator

Re: How to store the password in the user table as ***** [message #273961 is a reply to message #273956] Fri, 12 October 2007 06:36 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,


i fail to understand why do you get that error.its working fine with me.by the way what is your oracle version?


regards,
Re: How to store the password in the user table as ***** [message #273962 is a reply to message #273961] Fri, 12 October 2007 06:52 Go to previous messageGo to next message
admurthi
Messages: 7
Registered: September 2007
Junior Member

hi,

my version of oracle

Connected to:
Oracle8i Release 8.1.5.0.0 - Production
With the Java option
PL/SQL Release 8.1.5.0.0 - Production

regrds
Re: How to store the password in the user table as ***** [message #273963 is a reply to message #273962] Fri, 12 October 2007 06:59 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
And this is EXACTLY why the guidelines ask that you supply your db version with your query!
Re: How to store the password in the user table as ***** [message #273964 is a reply to message #273962] Fri, 12 October 2007 06:59 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,


@pablolee didn't see your reply.

i doubt case statement was introduced in that version of oracle.not sure.


regards,

[Updated on: Fri, 12 October 2007 07:01]

Report message to a moderator

Re: How to store the password in the user table as ***** [message #273966 is a reply to message #273962] Fri, 12 October 2007 07:13 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Well, there you go.
If you use obsolete and unsupported software, it's generally best to tell people.

You will need to either:
1) Write a function that takes the salary and returns Executive, Manager, etc based on the value of the salary,
or
2) Use nested Decode statements, comparing the sign of (SAL-800), (SAL-1000) and (SAL-3000)
How to Save password in **** format in tables [message #274819 is a reply to message #273896] Wed, 17 October 2007 05:25 Go to previous messageGo to next message
swarupsmishra
Messages: 1
Registered: October 2007
Location: MUMBAI
Junior Member

Hi

I want to save the password in **** format in a table.

Please help me in how to do this
Re: How to Save password in **** format in tables [message #274823 is a reply to message #274819] Wed, 17 October 2007 05:41 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Attack of the clones?

Please, read the OraFAQ Forum Guide (especially a section about how to quickly find answer to your questions).
Re: How to Save password in **** format in tables [message #274840 is a reply to message #274823] Wed, 17 October 2007 06:47 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

why not use DBMS_CRYPTO? available in oracle 10g.



regards,
Re: How to Save password in **** format in tables [message #274848 is a reply to message #274823] Wed, 17 October 2007 07:05 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I suspect Attack of the Homework Assignent
Re: How to Save password in **** format in tables (merged) [message #274921 is a reply to message #273896] Wed, 17 October 2007 13:04 Go to previous message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
An easy way to do you task in oracle 8 is to use the decode statement

SELECT ename,decode(least(sal,800),800,
                    decode(greatest(sal,1000),1000,'executive',
decode(least(3000,sal),sal,'manager','sample'),'sample'),'sample')  sam
   FROM emp;

[Updated on: Wed, 17 October 2007 13:04]

Report message to a moderator

Previous Topic: select using rownum
Next Topic: Database link
Goto Forum:
  


Current Time: Tue Dec 06 16:20:35 CST 2016

Total time taken to generate the page: 0.06325 seconds