How to pass a parameter to a procedure?

Question:

I am a little brain dead today...
How can I pass this parameter p_mainkey to this function

OR do something like

'select * from assortm where mainkey='||"'"||p_mainkey||"'"

INTEGRATION.SQLTOFILE('select * from assortm where mainkey=p_mainkey');

Here is the code:

 create or replace procedure TEST(p_mainkey in varchar2)
 as
 l_rows number;
 begin
 l_rows := INTEGRATION.SQLTOFILE( 'select * from assortm where
mainkey='||"'"||p_mainkey||"'", ';', 'C:\temp\', 'assortm.dat' );
 end;
 /

Answer:

create or replace procedure TEST55(p_mainkey in varchar2) as
   l_rows number;
begin
   l_rows := INTEGRATION.SQLTOFILE( 'select * from assortm where
mainkey='''||p_mainkey||''';', 'C:\temp\','assortm.dat' );
end;
/

Hosted by www.Geocities.ws

1