File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to create a procedure in oracle 10g to fetch an entire row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to create a procedure in oracle 10g to fetch an entire row" Watch "How to create a procedure in oracle 10g to fetch an entire row" New topic
Forums: JDBC Oracle/OAS
Author

How to create a procedure in oracle 10g to fetch an entire row

gavin sharma
Greenhorn

Joined: Sep 30, 2013
Posts: 12
I am new to Pl/SQL. I want to create a procedure which will take employe id as parameter and fetch entire row with 7 columns. I tried using the below code but it gives error "Invalid Identifier" when i try to execute it. please tel me how to go about it.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3434
    
  47

In PL/SQL, you cannot just select from a table. You need to somehow process the result of the select. In your case, you'll probably want to store it in a variable that can hold the entire row of the MYADMIN table.

Furthermore, there's no need to use dynamic SQL (the execute immediate) in this case. And if you do, you need to process bind variables correctly. The 'Invalid identifier' error is probably caused by including the empid variable in the command text.

So the procedure with the above suggestions incorporated would probably look like this:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create a procedure in oracle 10g to fetch an entire row
 
Similar Threads
using :new in oracle JDBC Query
Oracle Cursor
Problem in getting the data from DB using servlets
Java application Microsoft SQL server
connection to mssql server database