If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Oracle Store Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #16 (permalink)  
Old 11-22-11, 09:09
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,222
Code:
create or replace procedure newproc
( 
x_primarykey in number
, x_one in varchar2
, x_two in varchar2
, x_three in varchar2
, x_four in varchar2
, x_five in varchar2
) 
as
begin

insert into testtable
(
primarykey, 
one, 
two, 
three,
four, 
five
)

values
(
x_primarykey,
x_one,
x_two,
x_three,
x_four,
x_fifth
);

null;
end newproc;
__________________
Bill
You do not need a parachute to skydive. You only need a parachute to skydive twice.

Last edited by beilstwh; 11-22-11 at 16:31.
Reply With Quote
  #17 (permalink)  
Old 11-22-11, 09:19
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,415
within VALUES clause strings must be enclosed by single quote marks as follows; 'x_one'
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #18 (permalink)  
Old 11-22-11, 16:30
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,222
I am assuming that the parameters is what is going into the table.
__________________
Bill
You do not need a parachute to skydive. You only need a parachute to skydive twice.
Reply With Quote
  #19 (permalink)  
Old 11-23-11, 02:06
stahorse1 stahorse1 is offline
Registered User
 
Join Date: Nov 2011
Posts: 13
reply

Hi

I've been able to resolve this issue, the only challenge I have is on my OUT parameter, I'm inserting INs and expect one OUT back i.e

create or replace
PROCEDURE INSERT_APPELECTRICITY
(
_QuoteType IN VARCHAR2,
p_QuoteDate IN DATE,
p_TotalCablingAmount IN FLOAT,
p_rowID OUT NUMBER
)
AS
BEGIN
INSERT INTO "AppElectricity"
(
"ApplicationID"
,"QuoteType"
,"QuoteDate"
,"TotalCablingAmount"
)
VALUES
(
APPLICATIONIDSEQ.nextval,
p_ExpectedInstallationDetail,
p_QuoteDate,
p_QuoteType
);
RETURNING "ApplicationID" into p_rowID;

END INSERT_APPELECTRICITY;



And I get this error:
Error(413,12): PLS-00103: Encountered the symbol "ApplicationID" when expecting one of the following: := . ( @ % ;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On