<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7214143998849152676</id><updated>2024-08-28T16:49:23.291-07:00</updated><title type='text'>IMPORTANTPLSQL FUNCTION</title><subtitle type='html'>سكتب جميع اكواد البرامج التى ابتكرتها  من اول عملى حتى الان وان شاء الله سيكون بها حل لجميع المشاكل</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7214143998849152676.post-9188303483454279319</id><published>2011-02-17T00:46:00.000-08:00</published><updated>2011-02-17T00:46:34.120-08:00</updated><title type='text'>كيفيه عمل TREE</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;اولا دى ال Select اللى تجيب لى ال TREE فى شكل query&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
select 0,empno,empname, decode(empno,1,&#39;save&#39;,2,&#39;exit&#39;,null)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from emp&lt;br /&gt;
&lt;br /&gt;
connect by prior empno=mgr&lt;br /&gt;
&lt;br /&gt;
start with mgr is null &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
هنا فى الفورم &lt;br /&gt;
when form instance &lt;br /&gt;
اكتب الاتى &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
DECLARe &lt;br /&gt;
node_value varchar2(50);&lt;br /&gt;
BEGIn&lt;br /&gt;
node_value := Ftree.Get_Tree_Node_Property(&#39;rec.tree&#39;, :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE);&lt;br /&gt;
go_block(&#39;emp&#39;); &lt;br /&gt;
set_block_property(&#39;emp&#39;,DEFAULT_WHERE,&#39;empno=&#39;&lt;br /&gt;
node_value); &lt;br /&gt;
execute_query&lt;br /&gt;
end ;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/9188303483454279319/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://codingtodoeverything.blogspot.com/2011/02/tree.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/9188303483454279319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/9188303483454279319'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/2011/02/tree.html' title='كيفيه عمل TREE'/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7214143998849152676.post-1662816006019784713</id><published>2010-12-28T06:49:00.000-08:00</published><updated>2010-12-28T06:49:05.844-08:00</updated><title type='text'>مشكله منتشره فى التكرار و حلها</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;المشكله هى انى لو عندى جدول مثلا بيسجل حركات تنقل موظف من وظيفه لوظيفه و يوجد فى الجدول 2 field &lt;br /&gt;
from_date ,&amp;nbsp; to_date &lt;br /&gt;
&lt;br /&gt;
و عاوز اطبع تقرير يجيب اخر وظيفه للموظف &lt;br /&gt;
فالسهل انى بكتب&lt;br /&gt;
select * from table where to_date is null&lt;br /&gt;
&lt;br /&gt;
طيب لو الجدول مثلا مفهوش to_date و محتاج تحل المشكله دى تعمل ايه&lt;br /&gt;
تكتب الاتى&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;select * from table pp&lt;br /&gt;
where from_date in &lt;br /&gt;
(select &amp;nbsp;max(p.from_date )&lt;br /&gt;
from table&amp;nbsp; p&lt;br /&gt;
where p.person_id = pp.person_id&lt;br /&gt;
group by p.person_id)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/1662816006019784713/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/12/blog-post.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/1662816006019784713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/1662816006019784713'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/12/blog-post.html' title='مشكله منتشره فى التكرار و حلها'/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7214143998849152676.post-323232537183165134</id><published>2010-12-16T01:21:00.000-08:00</published><updated>2010-12-16T01:21:09.128-08:00</updated><title type='text'>طريقه تعريف ال cursor</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;فى اوراكل يوجد طريقتين لتعريف cursor&lt;br /&gt;
الطريقه الاولى&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
cursor emp_cur is select empno,empname from employee;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;end loop ;&lt;br /&gt;
&lt;br /&gt;
و بداخل loop اقدر اعمل اللى انا عايزه &lt;br /&gt;
مثلا insert or update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt; rec &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt; emp_cur &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-size: x-small;&quot;&gt;loop&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/323232537183165134/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/12/cursor.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/323232537183165134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/323232537183165134'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/12/cursor.html' title='طريقه تعريف ال cursor'/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7214143998849152676.post-7519088004627414810</id><published>2010-08-31T06:06:00.000-07:00</published><updated>2010-08-31T06:06:06.611-07:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;الان ساكتب داله جميع المبرمجين يحتجونها و هى التفقيط فكره الداله هى عباره عن اخذ الرقم و تحويله لرقم نصى &lt;br /&gt;
عن طريق &lt;br /&gt;
if condition &lt;br /&gt;
فى المقال القادم ساكتب الداله &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/7519088004627414810/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/if-condition.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/7519088004627414810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/7519088004627414810'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/if-condition.html' title=''/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7214143998849152676.post-4754373544480879738</id><published>2010-08-19T05:06:00.000-07:00</published><updated>2010-08-19T05:06:16.442-07:00</updated><title type='text'>function get week number</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;الان ساكتب مثال ل &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;function تجيب رقم الاسبوع فى مده معينه المثال مكتوب باوراكل pl/sql&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;create or replace function week_number until_date in date ,interval_date in date return number is&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;no_week number&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;until_date_v1 date &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;until_date_v2 date &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;until_date_v3 date &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;begin&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;no_week := 1 &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;until_date_v1 := add_months (until_date,-1 )+1&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;until_date_v2 := add_months(until_date,-2 )+1&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;until_date_v3 := add_months(until_date,-3 )+1&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;if (interval_date&amp;gt;=until_date_v1) and (interval_date&amp;lt;=&quot;&quot; p=&quot;&quot;&amp;gt; &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;select to_char(interval_date,&#39;w&#39;) into no_week from dual &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;no_week := 4 - no_week + 1 &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;end if &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;if (interval_date&amp;gt;=until_date_v2) and (interval_date&amp;lt;=&quot;&quot; p=&quot;&quot;&amp;gt; &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;select to_char(interval_date,&#39;w&#39;) into no_week from dual &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;no_week := 8 - no_week + 1 &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;end if &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;if (interval_date&amp;gt;=until_date_v3) and (interval_date&amp;lt;=&quot;&quot; p=&quot;&quot;&amp;gt; &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;select to_char(interval_date,&#39;w&#39;) into no_week from dual &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;no_week := 12 - no_week + 1 &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;end if &lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;return(no_week)&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;end week_number&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/4754373544480879738/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/function-get-week-number.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/4754373544480879738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/4754373544480879738'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/function-get-week-number.html' title='function get week number'/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7214143998849152676.post-8250823420846452161</id><published>2010-08-19T04:51:00.000-07:00</published><updated>2010-08-19T04:51:08.143-07:00</updated><title type='text'>جمله update معقده</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;CREATE TABLE test AS&lt;br /&gt;
SELECT table_name, CAST(&#39;&#39; AS VARCHAR2(30)) AS lower_name&lt;br /&gt;
FROM user_tables;&lt;br /&gt;
desc test&lt;br /&gt;
SELECT *&lt;br /&gt;
FROM test&lt;br /&gt;
WHERE table_name LIKE &#39;%A%&#39;;&lt;br /&gt;
SELECT *FROM testWHERE table_name NOT LIKE &#39;%A%&#39;;&lt;br /&gt;
-- this is not a good thing ...&lt;br /&gt;
UPDATE test t SET lower_name = (SELECT DISTINCT LOWER(table_name)&lt;br /&gt;
FROM user_tables u&lt;br /&gt;
WHERE u.table_name = t.table_name&lt;br /&gt;
AND u.table_name LIKE &#39;%A%&#39;);&lt;br /&gt;
-- look at the number of rows updated&lt;br /&gt;
SELECT * FROM test;-- neither is this &lt;br /&gt;
UPDATE test t SET lower_name = (&lt;br /&gt;
SELECT DISTINCT LOWER(table_name)&lt;br /&gt;
FROM user_tables u&lt;br /&gt;
WHERE u.table_name = t.table_name&lt;br /&gt;
AND u.table_name NOT LIKE &#39;%A%&#39;);&lt;br /&gt;
SELECT * FROM test; UPDATE testt&lt;br /&gt;
SET lower_nam = (SELECT DISTINCT LOWER(table_name)&lt;br /&gt;
FROM user_tables u WHERE u.table_name = t.table_name&lt;br /&gt;
AND u.table_name LIKE &#39;%A%&#39;)WHERE t.table_name LIKE &#39;%A%&#39;;&lt;br /&gt;
SELECT * FROM test;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/8250823420846452161/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/update_19.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/8250823420846452161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/8250823420846452161'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/update_19.html' title='جمله update معقده'/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7214143998849152676.post-7922569838541897514</id><published>2010-08-09T04:25:00.001-07:00</published><updated>2019-02-06T03:16:02.332-08:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;هذ المدونه بها جميع الاكواد الهامه فى جميع اكواد البرمجه&lt;br /&gt;
&lt;/div&gt;
&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: &quot;ca-pub-6758357048638513&quot;,
          enable_page_level_ads: true
     });
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingtodoeverything.blogspot.com/feeds/7922569838541897514/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/blog-post.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/7922569838541897514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7214143998849152676/posts/default/7922569838541897514'/><link rel='alternate' type='text/html' href='http://codingtodoeverything.blogspot.com/2010/08/blog-post.html' title=''/><author><name>Lotfy</name><uri>http://www.blogger.com/profile/16874171473260322082</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>