This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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 and Relational Databases 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: 3718
    
  61

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: How to create a procedure in oracle 10g to fetch an entire row
 
It's not a secret anymore!