View Single Post
  #4 (permalink)  
Old 09-07-10, 10:58
dayneo dayneo is offline
Registered User
 
Join Date: Oct 2002
Location: Cape Town, South Africa
Posts: 161
I think you are asking about bind variables. The @ symbol used in sybase sets up a bind variable for the SQL. Oracle allows for the same thing, but it happens implicitly in PLSQL.
For example:
Code:
create or replace procedure lasttouch(p_user_name in varchar2) as
begin

   UPDATE ADMIN_DATA set time = sysdate where user_name = p_user_name;

end;
/

exec lasttouch('dayneo');
In the code above, the row in ADMIN_DATA that has the user_name of dayneo would be updated with the current system date and time. You will notice that I prefixed my parameter name using p_. This is so that oracle can distinguish between the column called user_name and the parameter. I could just as easily have used param_ as a prefix value, or any other value that I feel like.
Reply With Quote