Home » SQL & PL/SQL » SQL & PL/SQL » How to insert data in Procedure????
How to insert data in Procedure???? [message #218953] Mon, 12 February 2007 03:57 Go to next message
victoryhendry
Messages: 95
Registered: January 2007
Location: Bangalore
Member

How to insert data in Procedure????

Create procedure p_name(parameter)is

Begin

insert into t_name (column_name1,column_name2)

values(&column_name1,&column_name2);--- This Line is wrong what
i will change here... i want to insert more data....???

--- I dont want hard code----


END;
Re: How to insert data in Procedure???? [message #218956 is a reply to message #218953] Mon, 12 February 2007 04:03 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,


proc body

insert into tab_name  values (parm1);

end proc;



regards,



Re: How to insert data in Procedure???? [message #218961 is a reply to message #218953] Mon, 12 February 2007 04:35 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
You can not have user-interaction in pl/sql. PL/SQL runs on the server.
Re: How to insert data in Procedure???? [message #219278 is a reply to message #218953] Tue, 13 February 2007 15:03 Go to previous message
Bill B
Messages: 1482
Registered: December 2004
Senior Member
create procedure INSERT_DATA(X_NUM IN NUMBER,X_STR IN VARCHAR2) IS
BEGIN
INSERT INTO MY_TABLE(COL1,COL2) VALUES(X_NUM,X_STR);
END;
Previous Topic: ORA-00903:Invalid table Name
Next Topic: reference key
Goto Forum:
  


Current Time: Sat Dec 03 18:17:03 CST 2016

Total time taken to generate the page: 0.04983 seconds