• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 am a man of mystery. Mostly because of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic