<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Oracle (PL/SQL) fuction won&#8217;t work</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/oracle-plsql-fuction-wont-work/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/oracle-plsql-fuction-wont-work/</link>
	<description></description>
	<lastBuildDate>Thu, 20 Jun 2013 01:19:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: pforos</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/oracle-plsql-fuction-wont-work/#comment-92942</link>
		<dc:creator>pforos</dc:creator>
		<pubDate>Sat, 04 Jun 2011 00:46:33 +0000</pubDate>
		<guid isPermaLink="false">#comment-92942</guid>
		<description><![CDATA[Sry this is the code I last used, there&#039;s same silly mistakes into the previous post.... 
&lt;pre&gt;

create or replace package body create_email
as

function password_hashing (p_username in varchar2, p_password in varchar2)
return varchar2
as
l_password varchar2(4000);
l_salt varchar2(4000) := &#039;AA8V33PFKQHFZJ4T54HOATVML024FM&#039;;

begin

l_password := utl_raw.cast_to_raw(
dbms_obfuscation_toolkit.md5(
input_string =&gt; p_password &#124;&#124; 
substr(l_salt, 10, 13) &#124;&#124; 
p_username &#124;&#124; 
substr(l_salt, 4, 10)
)
);
return l_password;
end password_hashing;

function create_new_password (p_email in varchar2)
return varchar2
as
l_password varchar2(12);
l_encrypted_password varchar2(32);
begin
select dbms_random.string(&#039;A&#039;, 8)
into l_password
from dual;
l_encrypted_password := password_hashing(p_username =&gt; upper(p_email), p_password =&gt; l_password);
update customer
set encrypted_password=l_encrypted_password
where upper(customer.email)=upper(p_email);
return l_password;
end create_new_password;


procedure email_new_password (
p_email in varchar2,
p_customer_service_email in varchar2,
p_password in varchar2)
as
email_subject varchar(50);
email_body varchar(200);
begin
email_subject := &#039;Your new password for Online Store&#039;;
email_body := &#039;Dear Customer, &#039;&#124;&#124; chr(10) &#124;&#124; 
&#039;Your new password for Online Store is &#039;&#124;&#124;
p_password&#124;&#124;chr(10)&#124;&#124;
&#039;Sincerely, &#039;&#124;&#124;chr(10)&#124;&#124;&#039; Online Store&#039;;
APEX_MAIL.SEND (
p_to =&gt; p_email,
p_from =&gt; p_customer_service_mail,
p_body =&gt; email_body,
p_subj =&gt; email_subject
);
commit; 
end email_new_password;

end create_email;
/

&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Sry this is the code I last used, there&#8217;s same silly mistakes into the previous post&#8230;. </p>
<pre>

create or replace package body create_email
as

function password_hashing (p_username in varchar2, p_password in varchar2)
return varchar2
as
l_password varchar2(4000);
l_salt varchar2(4000) := 'AA8V33PFKQHFZJ4T54HOATVML024FM';

begin

l_password := utl_raw.cast_to_raw(
dbms_obfuscation_toolkit.md5(
input_string =&gt; p_password || 
substr(l_salt, 10, 13) || 
p_username || 
substr(l_salt, 4, 10)
)
);
return l_password;
end password_hashing;

function create_new_password (p_email in varchar2)
return varchar2
as
l_password varchar2(12);
l_encrypted_password varchar2(32);
begin
select dbms_random.string('A', 8)
into l_password
from dual;
l_encrypted_password := password_hashing(p_username =&gt; upper(p_email), p_password =&gt; l_password);
update customer
set encrypted_password=l_encrypted_password
where upper(customer.email)=upper(p_email);
return l_password;
end create_new_password;


procedure email_new_password (
p_email in varchar2,
p_customer_service_email in varchar2,
p_password in varchar2)
as
email_subject varchar(50);
email_body varchar(200);
begin
email_subject := 'Your new password for Online Store';
email_body := 'Dear Customer, '|| chr(10) || 
'Your new password for Online Store is '||
p_password||chr(10)||
'Sincerely, '||chr(10)||' Online Store';
APEX_MAIL.SEND (
p_to =&gt; p_email,
p_from =&gt; p_customer_service_mail,
p_body =&gt; email_body,
p_subj =&gt; email_subject
);
commit; 
end email_new_password;

end create_email;
/

</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: pforos</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/oracle-plsql-fuction-wont-work/#comment-92941</link>
		<dc:creator>pforos</dc:creator>
		<pubDate>Sat, 04 Jun 2011 00:44:50 +0000</pubDate>
		<guid isPermaLink="false">#comment-92941</guid>
		<description><![CDATA[I used that syntax and it still didn&#039;t work!! I don&#039;t understand why... 
I also tried to insert the function and the procedure that follows into the package!!
I created this package:
&lt;pre&gt;
create or replace package create_email
as

function create_new_password (p_email in varchar2)
return varchar2;

procedure email_new_password (
p_email in varchar2,
p_customer_service_email in varchar2,
p_password in varchar2);

end create_and_email_new_password;
/

create or replace package body create_email
as

function create_new_password (p_email in varchar2)
return varchar2
as
l_password varchar2(12);
l_encrypted_password varchar2(32);
begin
select dbms_random.string(&#039;A&#039;, 8)
into l_password
from dual;
l_encrypted_password := password_hashing(p_username =&gt; upper(p_email), p_password =&gt; l_password);
update customer
set encrypted_password=l_encrypted_password
where upper(customer.email)=upper(p_email);
return l_password;
end create_new_password;

procedure email_new_password (
p_email in varchar2,
p_customer_service_email in varchar2,
p_password in varchar2)
as
email_subject varchar(50);
email_body varchar(200);
begin
email_subject := &#039;Your new password for Online Store&#039;;
email_body := &#039;Dear Customer, &#039;&#124;&#124; chr(10) &#124;&#124; 
&#039;Your new password for Online Store is &#039;&#124;&#124;
p_password&#124;&#124;chr(10)&#124;&#124;
&#039;Sincerely, &#039;&#124;&#124;chr(10)&#124;&#124;&#039; Online Store&#039;;
APEX_MAIL.SEND (              &lt;==== LINE 53
p_to =&gt; p_email,
p_from =&gt; p_customer_service_mail,
p_body =&gt; email_body,
p_subj =&gt; email_subject
);
commit; 
end create_new_password;

end create_email;
/
&lt;/pre&gt;

but i had an error at line 53: PL/SQL: Statement ignored !!
What&#039;s wrong this time??? The syntax seems to be correct!!
I start to get the feeling that Oracle doesn&#039;t like me..... :P]]></description>
		<content:encoded><![CDATA[<p>I used that syntax and it still didn&#8217;t work!! I don&#8217;t understand why&#8230;<br />
I also tried to insert the function and the procedure that follows into the package!!<br />
I created this package:</p>
<pre>
create or replace package create_email
as

function create_new_password (p_email in varchar2)
return varchar2;

procedure email_new_password (
p_email in varchar2,
p_customer_service_email in varchar2,
p_password in varchar2);

end create_and_email_new_password;
/

create or replace package body create_email
as

function create_new_password (p_email in varchar2)
return varchar2
as
l_password varchar2(12);
l_encrypted_password varchar2(32);
begin
select dbms_random.string('A', 8)
into l_password
from dual;
l_encrypted_password := password_hashing(p_username =&gt; upper(p_email), p_password =&gt; l_password);
update customer
set encrypted_password=l_encrypted_password
where upper(customer.email)=upper(p_email);
return l_password;
end create_new_password;

procedure email_new_password (
p_email in varchar2,
p_customer_service_email in varchar2,
p_password in varchar2)
as
email_subject varchar(50);
email_body varchar(200);
begin
email_subject := 'Your new password for Online Store';
email_body := 'Dear Customer, '|| chr(10) || 
'Your new password for Online Store is '||
p_password||chr(10)||
'Sincerely, '||chr(10)||' Online Store';
APEX_MAIL.SEND (              &lt;==== LINE 53
p_to =&gt; p_email,
p_from =&gt; p_customer_service_mail,
p_body =&gt; email_body,
p_subj =&gt; email_subject
);
commit; 
end create_new_password;

end create_email;
/
</pre>
<p>but i had an error at line 53: PL/SQL: Statement ignored !!<br />
What&#8217;s wrong this time??? The syntax seems to be correct!!<br />
I start to get the feeling that Oracle doesn&#8217;t like me&#8230;.. <img src='http://itknowledgeexchange.techtarget.com/itanswers/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/oracle-plsql-fuction-wont-work/#comment-92934</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Fri, 03 Jun 2011 21:57:13 +0000</pubDate>
		<guid isPermaLink="false">#comment-92934</guid>
		<description><![CDATA[Chances are that the password_hashing function has errors.

Make sure it is compiled and &#039;valid&#039;, and make sure you have the proper permissions to see it and execute it.

And yes, you have to use the  &lt;package&gt;.&lt;function&gt; syntax.]]></description>
		<content:encoded><![CDATA[<p>Chances are that the password_hashing function has errors.</p>
<p>Make sure it is compiled and &#8216;valid&#8217;, and make sure you have the proper permissions to see it and execute it.</p>
<p>And yes, you have to use the  &lt;package&gt;.&lt;function&gt; syntax.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/8 queries in 0.044 seconds using memcached
Object Caching 301/302 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-20 02:46:41 -->