- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: "select ... into" does not work
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 01:05 AM
тАО06-17-2004 01:05 AM
SELECT hypo_uid INTO v_hypo_uid FROM hypocenter
WHERE primehypo = 'y' AND ev_id = 2446;
It produces the 'no data found' exception.
But: Within SQL+, the following statement gives exactly one result (as expected):
SQL> SELECT hypo_uid FROM hypocenter
2 WHERE primehypo = 'y' AND ev_id = 2446;
HYPO_UID
----------
4424
SQL>
So, what is the problem???
I'm using Oracle 8.1.7.4.0, HP-UX 11.00.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 01:24 AM
тАО06-17-2004 01:24 AM
Re: "select ... into" does not work
First of all, make sure that you are using the same user in both cases.
Is it on the same sqlplus session?
If yes, try the sql and the plsql in the same sqlplus session:
try the following:
set serveroutput on size 10000;
declare
v_hypo_uid varchar2(20);
begin
select hypo_uid
into v_hypo_uid
from hypocenter
where primehypo = 'y'
and ev_id = 2446;
dbms_output.put_line(v_hypo_uid);
end;
/
hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 01:44 AM
тАО06-17-2004 01:44 AM
Re: "select ... into" does not work
It is the same user in both cases, because it is on the same sql+ session (tried both within the same sql+ session).
Your code sequence executed within sql+ succeeds (except that type of v_hypo_uid must be number).
But still, it does not run within pl/sql.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 12:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 03:31 PM
тАО06-17-2004 03:31 PM
Re: "select ... into" does not work
One thing to check,
Is your PL/SQL program 'connecting as another user' before executing the SQL command?
HTH
Dilip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 04:57 PM
тАО06-17-2004 04:57 PM
Re: "select ... into" does not work
the code that i posted above is PLSQL as Brian mentioned above. So if it worked, it should work anywhere. You need to check you coding. If possible, post the PLSQL you are trying to execute and the structure of the 2 tables (desc hupocenter)
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 06:03 PM
тАО06-17-2004 06:03 PM
Re: "select ... into" does not work
set serveroutput on ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 07:44 PM
тАО06-17-2004 07:44 PM
Re: "select ... into" does not work
without the the "set serveroutput on" command, dbms_output.put_line procedure will be executed without printing the desired message from a plsql block to the sqlplus session.
e.g. DBMS_OUTPUT.put_line('my text');
Note that it is the DBMS_OUTPUT package which collects the queue of messages in the PLSQL block..
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2004 09:02 PM
тАО06-17-2004 09:02 PM
Re: "select ... into" does not work
it was my fault. The above code is part of a more complicated one. I did a logical mistake there, that had confused me. I did not take into account the rollback mechanism after an exception has raised. I'm correcting my source code, now.
Thank you and sorry.