SURESHKUMAR.NET FORUMS
Registered Member Login:
Not a member? Register today!



Welcome to the SURESHKUMAR.NET FORUMS.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.




Oracle Queries

        

Reply
 
LinkBack Thread Tools Display Modes
Old 18-10-06, 08:35 PM   #1 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 4 Mrs Chepeni is on a distinguished road
Exclamation Oracle Queries

1.What is the fastest query u can execute for just checking to c if a value exists in a certain column on a certain table?
2.Can a foreign key reference a field which is not a UNIQUE or a PRIMARY KEY?
3.Can v call atored function in the contraint of a table?

Mrs Chepeni is offline Offline   Reply With Quote
Old 23-10-06, 11:38 PM   #2 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 4 Mrs Chepeni is on a distinguished road
Re: Oracle Queries

The third question is
Can v call stored function in the constraint of a table?
Few more Questions...
can a named notation be used while passing parameters to a stored function called in a SQL stmt?
Mrs Chepeni is offline Offline   Reply With Quote
Old 26-10-06, 11:36 PM   #3 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 4 Mrs Chepeni is on a distinguished road
Re: Oracle Queries

Answer to 2nd question

NO

If v try to add a foreign key constraint which references a field that is neither unique nor primary key then v get the following error.

SQL> alter table emp1 add constraint dname_fk foreign key(dname) references dept(dname);
alter table emp1 add constraint dname_fk foreign key(dname) references dept(dname)
*
ERROR at line 1:
ORA-02270: no matching unique or primary key for this column-list

can a named notation be used while passing parameters to a stored function called in a SQL stmt?
NO...When calling stored functions from SQL, named notation is not supported.

Answer to First Question

1.What is the fastest query u can execute for just checking to c if a value exists in a certain column on a certain table?
If there is no value then
SQL> select 'X' from dual where exists (select 'X' from emp where deptno=40);
no rows selected
If there is atleast one value then
1* select 'X' from dual where exists (select 'X' from emp where deptno=30)
SQL> /
'
-
X

Answer to third question
Can v call stored function in the constraint of a table?
NO..it will not recognise function and it will give invalid identifier.
I wrote one function and tried to use it in check constraint and it gave invalid identifier error.
Mrs Chepeni is offline Offline   Reply With Quote
The Following User Says Thank You to Mrs Chepeni For This Useful Post:
sk_kireeti (27-10-06)
Old 29-10-06, 09:16 PM   #4 (permalink)
Junior Member
 
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 4 talamanchi2000 is on a distinguished road
Re: Oracle Queries

Hi sir this is sabarinath i want to join the course oracle pl/sql plz suggest me which books are preferable.and also send me material and faqs on pl/sql

Thank u sir
your's
Sabarinathbabu
talamanchi2000 is offline Offline   Reply With Quote
Reply

Tags
oracle , queries


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
which course is better in oracle linas ORACLE , SQL SERVER , SYBASE & Others 7 24-08-08 01:04 PM
Hi frs this is venki-some oracle Queries venkishankar DATA STRUCTURES, C, C++, VC ++ 1 20-09-06 01:52 PM
oracle apps hrms queries msandeemi@gmail.com ORACLE , SQL SERVER , SYBASE & Others 1 20-09-06 03:49 AM
ORACLE INDIA - CHENNAI - 20 AUG sridhar Walk-ins 4 23-08-06 10:03 AM
Sonata software calls Oracle app Techno-functional consultants sridhar Experienced Jobs 0 27-07-06 07:18 PM


All times are GMT +6.5. The time now is 01:41 AM.

More Interview Questions Here...

Content Relevant URLs by vBSEO 3.3.2