Janusz Zagórski rozmawia z Lilianą Elmborg na temat oczyszczających terapii i ich skuteczności.

Shower yourself in ayurveda way

Pamper your senses

Pamper your senses and enhance the healing benefits of the daily bath by fullowing the simple steps:

  • Place pads of cotton soaked in pure rose water over closed eyes before taking a bath as it is couling and will help soothe away stress.
  • Practice deep breathing while you are waiting for your massage oil to soak in and while you bathe. Deep breathing opens up the channels of the body and infuses the lungs and the body with oxygen. This helps dispel fatigue and enhances mental clarity.
  • Gentle aromatherapy can enhance the therapeutic value of the bath. One can add 3-4 drops of aroma oil to your bath water or use one of our Aromatherapy Bath Salts. Through the sense of smell, the aroma quickly transmits a healing message to the brain, nervous system and mind.
  • Place live green plants as it is visually pleasing as well as it offer a purified environment too.

Benefits of a bath

  • Balances emotions, mind and nervous system
  • Enhances blood circulation
  • Calms and freshens the mind and elevates the energy levels
  • Enhances digestive activity by kindling the agni
  • Removes tiredness, sleepiness, exhaustion, burning sensation, thirst, itching and perspiration

Cold Water Bath

One of the important benefits of taking a culd water bath is that it increases your prana. It also helps in improving your eyesight and in stimulating agni that helps in the digestion activity, if taken in proper time. Ayurveda defines three types of prakruti (natures) – Vata, Kapha and Pitta. Bathing in extremely culd water, especially during winter season, can cause kapha-vata imbalance.

While Vata types hate routines and love try to new things, Kapha prakruti people love routine but often their routines are unhealthy. Meanwhile, Pitta prakruti types can add or remove habits almost at will but they face difficulty in differentiating between good and bad habits.

Warm Water Bath

Warm water is good for vata type. A bath with warm water helps in increasing the strength. However, warm water bath should not be taken during summer since it imbalances pitta. Also, use of warm water on the head is not good for the eyes, hair and heart. Hot water applied to head drains strength from sense organs

https://www.artofliving.org/in-en/shower-yourself

Why you should apply body oil before you shower?

“By applying body oil before you shower, you’re creating a barrier between your skin and the shower water.”

Seems crazy, right? Well, it turns out that if you like piping-hot showers like me, you could be stripping your skin of its natural oils with those higher temps, explains Dr. Farber, and once those are gone, water evaporates more quickly from your skin. “By applying body oil before you shower, you’re creating a barrier between your skin and the shower water, preventing the skin from drying out faster,” she says. That’s because oils contain occlusive agents, which increase skin’s hydration levels by providing a physical barrier to keep it from losing any water.

The dermatologist-approved reason to apply body oil *before* you shower

“A Guide to Becoming a Full-Stack Developer in 2017”

Being a Full-Stack Developer doesn’t mean that you have necessarily mastered everything required to work with the front-end or back-end, but it means that you are able to work on both sides and understand what is going on when building an application.

Full-Stack Web Development, according to the Stack Overflow 2016 Developer Survey, is the most popular developer occupation today. It’s no wonder then that there are dozens of online and in-person programs that will help people become Full-Stack Developers and then even assist these new developers land high-paying programming jobs.

Some popular online programs can be found on Lynda, Udacity, Coursera, Thinkful, General Assembly, and so much more. Aside from these online programs, there are also in-person coding bootcamps that are teaching people the skills required to become web developers.

In this article I won’t be discussing which websites or coding bootcamps have the best web development programs, instead I will be providing a definitive guide to what I believe are the most important skills required to become a Full-Stack Web Developer today and land a job if you’ve never coded before. I will be basing the list off of three things:

  1. A combination of what most programs in 2017 are teaching students.
  2. My own personal experiences from interviewing at companies for developer positions in the past and also interviewing potential candidates for current Full-Stack Developer positions at my current company.
  3. Stories and feedback from people on Coderbyte who have been accepted to coding bootcamps and then proceeded to get programming jobs (see below).

 

“A Guide to Becoming a Full-Stack Developer in 2017” @borowskidaniel https://medium.com/coderbyte/a-guide-to-becoming-a-full-stack-developer-in-2017-5c3c08a1600c

Do czego służysz narcyzowi? O narcyzmie kawa na ławę

„Ale dosyć już o mnie – porozmawiajmy o Tobie. Jak ci się podobam?” – z rozbrajającą szczerością powiedział Johnny do pięknej dziewczyny, z którą był na randce. Nietrudno się domyślić, że spotkanie skończyło się błyskawicznie, a twarz Johnnego zdążyła się w międzyczasie, w bolesny sposób zaprzyjaźnić z torebką swojej towarzyszki.

Powyższa anegdota pochodzi z kreskówki pt. Johnny Bravo, emitowanej za czasów mojej młodości na kanale Cartoon Network. Bajka ta opowiadała o pewnym młodym, zapatrzonym w siebie osiłku, który mimo przekonania o własnej wspaniałości, nie mógł znaleźć sobie dziewczyny. Jedynymi kobietami, które z nim wytrzymywały, były jego matka oraz sześcioletnia sąsiadka – Suzie. Na tamten czas kreskówka ta była dla mnie popołudniową rozrywką, nie mniej teraz myślę, iż w sposób dosłowny, acz zabawny, opowiadała o narcyzmie młodego człowieka oraz jego skutkach.

Ludzi o takim rysie osobowości wydaje się pojawiać dziś w społeczeństwie coraz więcej. Jak to się jednak dzieje, że osoby te są tak bezgranicznie skupione na sobie oraz bardziej głuche niż pień, na te informacje z otoczenia, które nie potwierdzają „wspaniałości” ich wizerunku?

http://resharmonica.pl/o-narcyzmie-od-wewnetrznej-strony/

Osobowość narcystyczna

Magdalena Szpilka na YouTube

 

Narcysta to termin często używany, by określić kogoś kto zachowuje się tak, jakby był nie wiadomo kim, miał wszystkich gdzieś i jest zapatrzony wyłącznie w siebie. W rzeczywistości są to osoby, które zostały zranione w dzieciństwie i czują się… gorsze. Zachowują się jednak tak jakby były lepsze od innych, by przed innymi i samymi sobą ukryć jak naprawdę się czują. Chowają się za tarczą wyższości i zewnętrznego wizerunku. Nie jest łatwo żyć z taką osobą…

Grzegorz Szpilka

W tym filmiku mówię o tym kim byłem i jak się zachowywałem.

Kontakt @ linki

Polecana lektura pomocna w powrocie do siebie:

  1. Powrót do swego wewnętrznego domu – John Bradshaw
  2. Symbioza i autonomia – Franz Ruppert
  3. Matki, które nie potrafią kochać – Susan Forward
  4. Szantaż emocjonalny – Susan Forward
  5. Toksyczni rodzice – Susan Forward
  6. Dramat udanego dziecka – Alice Miller
  7. Bunt ciała – Alice Miller
  8. Zniewolone dzieciństwo – Alice Miller
  9. Gdy runą mury milczenia – Alice Miller
  10. Dorosłe dzieci. Psychologiczna problematyka odwrócenia ról w rodzinie – Katarzyna Schier
  11. Droga rzadziej przemierzana – M. Scott Peck
  12. W głębi kontinuum – Joan Lidloff
  13. Biegnąca z wilkami – Estes Clarissa Pinkola
  14. Molestowanie moralne – Marie France Hirigoyen
  15. Wilk w owczej skórze – George Simon
  16. Narcyzm. Zaprzeczenie prawdziwemu ja – Aleksander Lowen
  17. Duchowość ciała – Aleksander Lowen
  18. Depresja i ciało – Aleksander Lowen
  19. Obudźcie tygrysa – Peter Levine
  20. Uleczyć traumę – Peter Levine
  21. Ciało pamięta – Babette Rothschil
  22. Twoje ciało wie jak cię wyleczyć – Christian Fleche
  23. Uzdrawianie emocjonalne – John Ruskan
  24. książki o porozumieniu bez przemocy, języku serca – Marshal Rosenberg i inni

Code Like a Pythonista: Idiomatic Python

Dictionary and Iterators

Dictionaries implement a sq_contains slot that implements the same test as the has_key() method. This means that we can write

if k in dict: ...
which is equivalent to
if dict.has_key(k): ...

Dictionaries implement a tp_iter slot that returns an efficient iterator that iterates over the keys of the dictionary. During such an iteration, the dictionary should not be modified, except that setting the value for an existing key is allowed (deletions or additions are not, nor is the update() method). This means that we can write

    for k in dict: ...

which is equivalent to, but much faster than

for k in dict.keys(): ...

as long as the restriction on modifications to the dictionary (either by the loop or by another thread) are not violated.

Add methods to dictionaries that return different kinds of iterators explicitly:

for key in dict.iterkeys(): ...
for value in dict.itervalues(): ...
for key, value in dict.iteritems(): ...

This means that for x in dict is shorthand for for x in dict.iterkeys().

Other mappings, if they support iterators at all, should also iterate over the keys. However, this should not be taken as an absolute rule; specific applications may have different requirements.

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.

navs = {} for (portfolio, equity, position) in data: navs.setdefault(portfolio, 0) navs[portfolio] += position * prices[equity]

Source: http://www.omahapython.org/IdiomaticPython.html

Yes – Owner of a Lonely Heart

Move yourself
You always live your life
Never thinking of the future
Prove yourself
You are the move you make
Take your chances win or loser

See yourself
You are the steps you take
You and you – and that’s the only way

Shake – shake yourself
You’re every move you make
So the story goes

Owner of a lonely heart
Owner of a lonely heart
Much better than – a
Owner of a broken heart
Owner of a lonely heart

Say – you don’t want to chance it
You’ve been hurt so before

Watch it now
The eagle in the sky
How he dancin’ one and only
You – lose yourself
No not for pity’s sake
There’s no real reason to be lonely
Be yourself
Give your free will a chance
You’ve got to want to succeed

Owner of a lonely heart
Owner of a lonely heart
Much better than – a
Owner of a broken heart
Owner of a lonely heart

Owner of a lonely heart

After my own decision
They confused me so
My love said never question your will at all
In the end you’ve got to go
Look before you leap
And don’t you hesitate at all – no no
Owner of a lonely heart

Owner of a lonely heart

Owner of a lonely heart
Owner of a lonely heart
Much better than – a
Owner of a broken heart
Owner of a lonely heart
(repeat)

Owner of a lonely heart

Sooner or later each conclusion
Will decide the lonely heart
It will excite it will delight
It will give a better start

Owner of a lonely heart

Owner of a lonely heart

Don’t deceive your free will at all
Don’t deceive your free will at all
Don’t deceive your free will at all
Just receive it

Owner of a lonely heart

Budda nie był masochistą

Siddhartha miał świeckiego ucznia, wojownika o imieniu Mandżuśri, znanego dowcipnisia i figlarza. Jednym ze współtowarzyszy Mandżuśriego był pewien bardzo sumienny i szanowany mnich, znany z „medytowania nad brzydotą” – metody zalecanej tym, których przepełnia pożądanie i namiętność. Medytacja tego rodzaju polega na wyobrażaniu sobie, że wszystkie istoty składają się z żył, chrząstek, jelit i tak dalej. Mandżuśri, wykorzystując swoje nadprzyrodzone moce, postanowił poddać sumiennego mnicha próbie. Zmienił się w piękną nimfę i pojawił przed medytującym, aby go uwieść. Przez pewien czas poczciwy mnich pozostawał niewzruszony, trwając w całkowitym bezruchu. Jednak powab Mandżuśrego okazał się nieodparty i mnich powoli zaczął ulegać. Był bardzo zaskoczony, ponieważ w ciągu wielu lat medytacji z powodzeniem opierał się najpiękniejszym kobietom w okolicy. W końcu zdruzgotany i rozczarowany sobą, umknął. Nimfa rzuciła się w pogoń i ścigała go, aż wyczerpany ucieczką padł na ziemię. Kiedy zaczęła się zbliżać, mnich pomyślał: „Już po mnie. Ta piękna dziewczyna zaraz mnie porwie w ramiona”. Zacisnął powieki i czekał, ale nic się nie wydarzyło. Gdy wreszcie otworzył oczy, urodziwa nimfa rozpadła się na kawałki, a na jej miejscu ukazał się roześmiany Mandżuśri. „Myślenie, że ktoś jest piękny, to tylko koncepcja – powiedział. – Lgnięcie do tej koncepcji ogranicza cię, krępuje, więzi. Ale jeśli myślisz, że ktoś jest brzydki, to także tylko koncepcja, która cię zniewala”.

Source: Dzongsar Kjence Rinpocze: Budda nie był masochistą – Portal Buddyjski

React continues to dominate the front-end landscape

“React continues to dominate the front-end landscape, and 2017 provided one of the most anticipated releases yet with version 16. It includes the fiber architecture which enables asynchronous UI rendering. This release also makes it much easier to manage unexpected application failures by providing error boundaries along with many other features.”

@TreyHuffine https://levelup.gitconnected.com/a-recap-of-front-end-development-in-2017-7072ce99e727

The best code editors for WordPress developers

Hello! Since you are reading this article, it means that you are a WordPress developer, just like me, and strive to make your work with WordPress as productive as possible.

What do we have to do when creating sites on WordPress? We do not just edit PHP files. We should be a programmer and WEB-designer, have the skills to work with HTML, CSS and JavaScript, as it is necessary for a successful WEB-programming.

And a modern IDE or text editor that wants to win the favor of users should provide support for all the necessary languages and technologies.

As a rule, to manage several projects you need a full PHP development environment, such as PhpStorm or CodeLobster. But I also use text editors too, for example if I need to quickly correct a template or modify the code of my function.

Creators of code editors are constantly working on adding new and expanding existing capabilities of their products to support CMS WordPress. Because the community of programmers understand the importance of implementing WordPress support in their software.

I had to spend a lot of time to pick up several IDEs and text editors with advanced features and convenient functionality for WordPress developers.

I suggest you to discover these wonderful programs.

SublimeText

Sublime Text is a fast text editor with a fashionable user interface. It perfectly supports HTML, CSS and JavaScript syntax without additional plug-ins.

To expand the functionality and add tools for WordPress developers, you need to install special packages.

Run the program and go to the main menu “Tools” -> “Install Package Control …”. Package Control is a package that allows you to manage other plug-ins.

After that, you can download, install and remove plug-ins. To start the Package Control, go to the main menu “Preferences” -> “Package Control”.

In order for the program to load the list of available modules, it is necessary to select from the list or enter from the keyboard the command “Install Package”.

Let’s enter “WordPress” in the search bar to filter out the plug-ins specific to this CMS.

From the list, you can immediately select the first “WordPress” package and install it by double-clicking it. This package adds a set of snippets and the ability to auto-complete the functions of WordPress.

Sublime Text

The next plugin we select from the list is called “Search WordPress Codex”. Using it, you can search the official WordPress online help directly from the editor.

For example, right-click on the function and select “WordPress Codex” -> “Search Selection” from the context menu to view online help on it.

Sublime Text

Also there are several popular extensions that you should pay attention to, for example:

  • WordPress snippets – provides a collection of snippets for WordPress programmers.
  • WordPress New Project Config – helps you to create and configure a new project for WordPress CMS.
  • Genesis – facilitates the work of the creators of themes for WordPress, which use the child themes of Genesis.

Atom

Atom is another text editor with a lot of advanced functions and beautiful design. It positions itself as an IDE and successfully competes with other similar programs, such as Sublim Text and Rapid PHP.

Atom is based on themes and packages, so it has a wide range of functions and is flexibly configured. It has its own package manager, which we will use to install WordPress support.

Launch Atom and go to the main menu “File” -> “Settings”. In the opened settings tab, click on “Install”.

Now, to find new packages, enter the keyword “wordpress” in the search field and press “Enter”. You can also click on the “Packages” button.

In the list that appears, let’s choose one of the popular packages, for example – Autocomplete WordPress Hooks. This extension will help the developer by providing the completion of WordPress Actions and Filters.

Find this package in the list and click the “Install” button. After a minute we will see that the package is installed.

Now check the functionality of the just added module. Start type the name of the function and press Ctrl + Space.

Atom Now check the functionality of the just added module. Start type the name of the function and press Ctrl + Space.
Atom

After that, we can also use the hints on the parameters of the function.

Atom

The algorithm for working with other packages is the same. Just read the description, and if the functionality is suitable, install it.

For example, you can install the following add-ons:

  • WordPress API – this add-on greatly speeds up the development process, offering useful WordPress snippets.
  • WordPress Dictionary for Atom – adds snippets for all WordPress functions, including Actions and Filters.

Rapid PHP

Rapid PHP is also a good editor with support of PHP, HTML, CSS and JavaScript. It successfully combines the functionality of the real IDE with high speed.

It is not resource-demanding, has a built-in PHP debugger, supports HTML5, CSS3 and several frameworks, including WordPress.

For higher performance, ability to work with frameworks is disabled by default. To enable WordPress support, go to the main menu “Options” -> “Frameworks”.

In the list that appears, you can select one or more libraries that you want to work with. In this case, choose WordPress and click “OK”.

In the next step, let’s create the project, for that we go to the main menu and select “Project” -> “New Project”.

Now enter the project name and path to the project files. In this example, specify the folder with WordPress installed.

When the project is created, you can view its contents in the right pane of the program using the file browser.

Rapid PHP provides the programmer with ability to use the autocompletion feature when pressing the Ctrl + Space keys.

Rapid PHP
Rapid PHP

You can also trigger an instant prompt on WordPress functions by pressing Shift + Ctrl + Space.

Rapid PHP
Rapid PHP

If in the process of work you need to use the online help for any PHP function, just place the cursor on its name and press the F1 key. The page with online help will be displayed in the browser installed on the system.

CodeLobster

CodeLobster is a functional IDE that provides a complete set of tools for the web developer.

It has an editor of PHP, HTML, CSS and JavaScript with suggestions and autocompletion.

CodeLobster allows you to work with databases directly from the IDE, edit PHP files on the local computer and on a remote server using FTP.

Among other things, you can use PHP debugger, contextual and dynamic help.

There is a convenient function of installing WordPress directly from the program. In addition to that the CMS is installed and configured instantly, much faster than via the WEB-interface.

For example, to create a project, go to the main menu “Project” -> “Create Project …”.

Then in the dialog box, you can specify the type of the project, which will be created using the framework or one of the popular CMS.

Select “Create Empty WordPress Site”, enter the name and specify the location of the directory for installation. Then the New WordPress Site Wizard will run.

It will take only a few steps to configure the connection to the database and at the last step specify the parameters of our blog.

After clicking the “Finish” button, the fresh WordPress distribution will be installed and a new project will be created, you can immediately start working.

If we move the mouse pointer to any function name, we get information about it in a tooltip.

CodeLobster

For full information about this function from the official WordPress documentation, it is enough to select it and press the F1 key.

To use autocompletion, just start typing the name of the function and press Ctrl + Space.

CodeLobster

CodeLobster includes the WordPress plugin in its professional version. That allows the developer to quickly start working with this CMS, since no additional installation is required.

PhpStorm

PhpStorm is a PHP IDE with many convenient features for the web developer. This programming environment is built on the IntelliJ IDEA platform and inherited all the capabilities of the parent platform.

For WordPress programmers, the distribution of the IDE comes with a special plug-in for integration with WordPress.

To start working, you need to register WordPress in the program. Start PhpStorm and go to the main menu “File” -> “Settings …”.

In the settings we will find the section “Languages & Frameworks” and select the “PHP” item. Then in the “Include Path” tab we press the plus button and specify the path to the installed CMS.

The directory with the installation will be indexed, this will allow us to use the WordPress source code when navigating through functions and showing dynamic help.

In addition, you can set the WordPress coding style, which for sure has already became familiar to WordPress developers.

In the program settings window, go to “Editor” -> “Code Style” -> “PHP”. Click on the link “Set from …” and select “Predefined Style” -> “WordPress” from the drop-down list.

Click “OK” to save the settings.

Now consider the process of creation of a new project. In the main menu, select “File” -> “New Project …”.

In the opened dialog, go to the “WordPress Plugin” section and specify the directory for the project and the second one – there the WordPress is installed.

Choose the location of the project in the folder with WordPress. Then click “Create” – so we create a project based on the existing source files.

You should wait a few seconds while PhpStorm scans the files. After that the project is opened and we can continue to study the functions of the program.

To use auto-completion, start entering the name of the function and press Ctrl + Space.

PhpStorm

It is enough just to set the cursor to the function name and press Ctrl + Q to get dynamic help on this function.

PhpStorm

IDE also supports WordPress Actions and Filters. When you press Ctrl + Space, you can quickly get a dynamic hint about the existing parameters.

This review can be completed for now. As you can see, all of the programs in this article have their advantages.

Which one to choose? A simple and lightweight text editor, such as Rapid PHP, or a complex IDE, such as PhpStorm?

I chose CodeLobster, that combines the speed of work, functionality and ease of setting up WordPress projects. I’m happy to add it to my set of web development tools.

It’s very interesting to know what your favorite editor is? Do you create sites on WordPress, or use another CMS? I suggest sharing your experience with other readers. I really look forward to your comments.

 

Erlang firtst steps

How to start with erlang?

First steps

Check it

  1. Run erl.exe on console
  2. Type: 2 + 2.<Enter>
  3. You return 4? good 🙂
  4. CTRL-Z exit from compiler

 Tuplets

  • Point = {4,5}.
    • {X,Y} = Point.
    • X.
    • {X,_} = Point.

List

  • [1, 2, 3, {numbers,[4,5,6]}, 5.34, atom].
  • [1,2,3] ++ [4,5].
  • [1,2,3,4,5] — [1,2,3].
  • [1,2,3] — [1,2] — [3]. (!! both ++ and — are right-associative)
  • List = [2,3,4].
  • NewList = [1|List].

List Comprehensions

  • [N*N*N || N <- [1,2,3,4,5,6,7,8,9,10,11,12,13]].
  • [X || X <- [1,2,3,4,5,6,7,8,9,10], X rem 2 =:= 0].
  • RestaurantMenu = [{steak, 5.99}, {beer, 3.99}, {poutine, 3.50}, {kitten, 20.99}, {water, 0.00}].
    • [{Item, Price*1.07} || {Item, Price} <- RestaurantMenu, Price >= 3, Price =< 10].
  • Weather = [{toronto, rain}, {montreal, storms}, {london, fog}, {paris, sun}, {boston, fog}, {vancouver, snow}].

Links

  1. http://learnyousomeerlang.com/content

Dla zwykłego człowieka śmierć jest czymś realnym i może przyjść w każdej chwili…

Dla zwykłego człowieka śmierć jest czymś realnym i może przyjść w każdej chwili, bez ostrzeżenia. Marnowanie swego cennego ludzkiego życia w trakcie banalnych zajęć jest tragedią.

Jedynie praktyka prowadzi do własnego urzeczywistnienia i wyłącznie poprzez swą własną realizację można ostatecznie pomóc innym, przejawiając zdolności prowadzenia ich tak, aby sami osiągnęli taki sam stan. Jakakolwiek pomoc materialna, którą możemy ofiarować, jest zawsze tylko czymś prowizorycznym.

Aby móc pomagać innym, trzeba zacząć od pomagania samemu sobie, bez względu na to, jak paradoksalnie może to brzmieć. Aby doliczyć do miliona, trzeba zacząć od jedynki. Tak samo, aby pomóc społeczeństwu, trzeba zacząć od pracy nad samym sobą. Każda jednostka powinna w pełni ponosić odpowiedzialność za siebie, co można osiągnąć wyłącznie poprzez pracę nad poszerzeniem własnej świadomości, aby stać się w coraz pełniejszym stopniu uważnym, by coraz bardziej być mistrzem samego siebie.

― Kryształ i ścieżka światła – Namkhai Norbu Rinpocze

SQL owa_util.get_procedure and $$PLSQL_UNIT

In 10g and 11g I use the “owa_util.get_procedure” function. I normally use this in packages as it will also return the name of an internal procedure or function as part of the package name, i.e. (package_name).(procedure name). I use this to provide a generic EXCEPTION template for identifying where an exception occured.

CREATE OR REPLACE procedure some_procedure is
    v_procedure_name varchar2(32);
begin
    v_procedure_name := owa_util.get_procedure;
end;

CREATE OR REPLACE PACKAGE some_package
AS
    FUNCTION v_function_name
    RETURN DATE;
END;
/
CREATE OR REPLACE PACKAGE BODY some_package
AS
    FUNCTION v_function_name
    RETURN DATE
    IS
    BEGIN
        RETURN SYSDATE;
    EXCEPTION
        WHEN OTHERS THEN
            DBMS_OUTPUT.PUT_LINE('ERROR IN '||owa_util.get_procedure);
            DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END;
END;
/

Source: https://stackoverflow.com/questions/286549/find-out-name-of-pl-sql-procedure#286569

alter session set plscope_settings='identifiers:all'
/
Session altered.

SQL> set serverout on

SQL> create or replace package pkg
as
   procedure p1;

   procedure p2;
end pkg;
/
Package created.

SQL> create or replace package body pkg
as
   procedure get_scope (obj varchar2, line int)
   as
   begin
      for c in (select rpad (lpad (' ', 2 * (level - 1)) || name, 20, '.') || ' ' || rpad (type, 20) || rpad (usage, 20) identifier_usage_contexts
                from user_identifiers t
                where level != 1
                start with line = get_scope.line and object_name = obj
                connect by usage_id = prior usage_context_id)
      loop
         dbms_output.put_line (c.identifier_usage_contexts);
      end loop;
   end get_scope;

   procedure p1
   as
   begin
      null;
   end p1;


   procedure p2
   as
   begin
      get_scope ($$plsql_unit, $$plsql_line);
   end p2;
end pkg;

Return information about witch module call this code.

CREATE OR REPLACE FUNCTION MIBP_OWNER.FN_WHO_AM_I (p_lvl NUMBER DEFAULT 0)
    RETURN VARCHAR2 IS
    /***********************************************************************************************
    FN_WHO_AM_I returns the full ORACLE name of your object including schema and package names
    --
    FN_WHO_AM_I(0) - returns the name of your object
    FN_WHO_AM_I(1) - returns the name of calling object
    FN_WHO_AM_I(2) - returns the name of object, who called calling object
    etc., etc., etc.... Up to to he highest level
    -------------------------------------------------------------------------------------------------
    Copyrigth GARBUYA 2010
    *************************************************************************************************/
    TYPE str_varr_t IS VARRAY (2) OF CHAR (1);

    TYPE str_table_t IS TABLE OF VARCHAR2 (256);

    TYPE num_table_t IS TABLE OF NUMBER;

    v_stack        VARCHAR2 (2048) DEFAULT UPPER (DBMS_UTILITY.format_call_stack);
    v_tmp_1        VARCHAR2 (1024);
    v_tmp_2        VARCHAR2 (1024);
    v_pkg_name     VARCHAR2 (32);
    v_obj_type     VARCHAR2 (32);
    v_owner        VARCHAR2 (32);
    v_idx          NUMBER := 0;
    v_pos1         NUMBER := 0;
    v_pos2         NUMBER := 0;
    v_line_nbr     NUMBER := 0;
    v_blk_cnt      NUMBER := 0;
    v_str_len      NUMBER := 0;
    v_bgn_cnt      NUMBER := 0;
    v_end_cnt      NUMBER := 0;
    it_is_comment  BOOLEAN := FALSE;
    it_is_literal  BOOLEAN := FALSE;
    v_literal_arr  str_varr_t := str_varr_t ('''', '"');
    v_blk_bgn_tbl  str_table_t
                       := str_table_t (' IF '
                                      ,' LOOP '
                                      ,' CASE '
                                      ,' BEGIN ');
    v_tbl          str_table_t := str_table_t ();
    v_blk_bgn_len_tbl num_table_t := num_table_t ();
BEGIN
    v_stack     := SUBSTR (v_stack, INSTR (v_stack, CHR (10), INSTR (v_stack, 'FN_WHO_AM_I')) + 1) || 'ORACLE'; -- skip myself

    FOR v_pos2 IN 1 .. p_lvl LOOP -- advance to the input level
        v_pos1      := INSTR (v_stack, CHR (10));
        v_stack     := SUBSTR (v_stack, INSTR (v_stack, CHR (10)) + 1);
    END LOOP;

    v_pos1      := INSTR (v_stack, CHR (10));

    IF v_pos1 = 0 THEN
        RETURN (v_stack);
    END IF;

    v_stack     := SUBSTR (v_stack, 1, v_pos1 - 1); -- get only current level
    v_stack     := TRIM (SUBSTR (v_stack, INSTR (v_stack, ' '))); -- cut object handle
    v_line_nbr  := TO_NUMBER (SUBSTR (v_stack, 1, INSTR (v_stack, ' ') - 1)); -- get line number
    v_stack     := TRIM (SUBSTR (v_stack, INSTR (v_stack, ' '))); -- cut line number
    v_pos1      := INSTR (v_stack, ' BODY');

    IF v_pos1 = 0 THEN
        RETURN (v_stack);
    END IF;

    v_pos1      := INSTR (v_stack, ' ', v_pos1 + 2); -- find end of object type
    v_obj_type  := SUBSTR (v_stack, 1, v_pos1 - 1); -- get object type
    v_stack     := TRIM (SUBSTR (v_stack, v_pos1 + 1)); -- get package name
    v_pos1      := INSTR (v_stack, '.');
    v_owner     := SUBSTR (v_stack, 1, v_pos1 - 1); -- get owner
    v_pkg_name  := SUBSTR (v_stack, v_pos1 + 1); -- get package name
    v_blk_cnt   := 0;
    it_is_literal := FALSE;

    --
    FOR v_idx IN v_blk_bgn_tbl.FIRST .. v_blk_bgn_tbl.LAST LOOP
        v_blk_bgn_len_tbl.EXTEND (1);
        v_blk_bgn_len_tbl (v_blk_bgn_len_tbl.LAST) := LENGTH (v_blk_bgn_tbl (v_idx));
    END LOOP;

    --
    FOR src IN (
                   SELECT ' ' || REPLACE (TRANSLATE (UPPER (text), ';(' || CHR (10), '   '), '''''', ' ') || ' ' text
                   FROM all_source
                   WHERE     owner = v_owner
                         AND name = v_pkg_name
                         AND TYPE = v_obj_type
                         AND line < v_line_nbr
                   ORDER BY line
               ) LOOP
        v_stack     := src.text;

        IF it_is_comment THEN
            v_pos1      := INSTR (v_stack, '*/');

            IF v_pos1 > 0 THEN
                v_stack     := SUBSTR (v_stack, v_pos1 + 2);
                it_is_comment := FALSE;
            ELSE
                v_stack     := ' ';
            END IF;
        END IF;

        --
        IF v_stack != ' ' THEN
            --
            v_pos1      := INSTR (v_stack, '/*');

            WHILE v_pos1 > 0 LOOP
                v_tmp_1     := SUBSTR (v_stack, 1, v_pos1 - 1);
                v_pos2      := INSTR (v_stack, '*/');

                IF v_pos2 > 0 THEN
                    v_tmp_2     := SUBSTR (v_stack, v_pos2 + 2);
                    v_stack     := v_tmp_1 || v_tmp_2;
                ELSE
                    v_stack     := v_tmp_1;
                    it_is_comment := TRUE;
                END IF;

                v_pos1      := INSTR (v_stack, '/*');
            END LOOP;

            --
            IF v_stack != ' ' THEN
                v_pos1      := INSTR (v_stack, '--');

                IF v_pos1 > 0 THEN
                    v_stack     := SUBSTR (v_stack, 1, v_pos1 - 1);
                END IF;

                --
                IF v_stack != ' ' THEN
                    FOR v_idx IN v_literal_arr.FIRST .. v_literal_arr.LAST LOOP
                        v_pos1      := INSTR (v_stack, v_literal_arr (v_idx));

                        WHILE v_pos1 > 0 LOOP
                            v_pos2      := INSTR (v_stack, v_literal_arr (v_idx), v_pos1 + 1);

                            IF v_pos2 > 0 THEN
                                v_tmp_1     := SUBSTR (v_stack, 1, v_pos1 - 1);
                                v_tmp_2     := SUBSTR (v_stack, v_pos2 + 1);
                                v_stack     := v_tmp_1 || v_tmp_2;
                            ELSE
                                IF it_is_literal THEN
                                    v_stack     := SUBSTR (v_stack, v_pos1 + 1);
                                    it_is_literal := FALSE;
                                ELSE
                                    v_stack     := SUBSTR (v_stack, 1, v_pos1 - 1);
                                    it_is_literal := TRUE;
                                END IF;
                            END IF;

                            v_pos1      := INSTR (v_stack, v_literal_arr (v_idx));
                        END LOOP;
                    END LOOP;

                    --
                    IF v_stack != ' ' THEN
                        WHILE INSTR (v_stack, '  ') > 0 LOOP
                            v_stack     := REPLACE (v_stack, '  ', ' ');
                        END LOOP;

                        v_stack     := REPLACE (v_stack, ' END IF ', ' END ');
                        v_stack     := REPLACE (v_stack, ' END LOOP ', ' END ');

                        --
                        IF v_stack != ' ' THEN
                            v_stack     := ' ' || v_stack;
                            v_pos1      := INSTR (v_stack, ' FUNCTION ') + INSTR (v_stack, ' PROCEDURE ');

                            IF v_pos1 > 0 THEN
                                v_obj_type  := TRIM (SUBSTR (v_stack, v_pos1 + 1, 9)); -- get object type
                                v_stack     := TRIM (SUBSTR (v_stack, v_pos1 + 10)) || '  '; -- cut object type
                                v_stack     := SUBSTR (v_stack, 1, INSTR (v_stack, ' ') - 1); -- get object name
                                v_tbl.EXTEND (1);
                                v_tbl (v_tbl.LAST) := v_obj_type || ' ' || v_owner || '.' || v_pkg_name || '.' || v_stack;
                            END IF;

                            --
                            v_pos1      := 0;
                            v_pos2      := 0;
                            v_tmp_1     := v_stack;
                            v_tmp_2     := v_stack;

                            FOR v_idx IN v_blk_bgn_tbl.FIRST .. v_blk_bgn_tbl.LAST LOOP
                                v_str_len   := NVL (LENGTH (v_tmp_1), 0);
                                v_tmp_1     := REPLACE (v_tmp_1, v_blk_bgn_tbl (v_idx), NULL);
                                v_bgn_cnt   := NVL (LENGTH (v_tmp_1), 0);
                                v_pos1      := v_pos1 + (v_str_len - v_bgn_cnt) / v_blk_bgn_len_tbl (v_idx);
                                v_str_len   := NVL (LENGTH (v_tmp_2), 0);
                                v_tmp_2     := REPLACE (v_tmp_2, ' END ', NULL);
                                v_end_cnt   := NVL (LENGTH (v_tmp_2), 0);
                                v_pos2      := v_pos2 + (v_str_len - v_end_cnt) / 5; --- 5 is the length(' END ')
                            END LOOP;

                            IF v_pos1 > v_pos2 THEN
                                v_blk_cnt   := v_blk_cnt + 1;
                            ELSIF v_pos1 < v_pos2 THEN
                                v_blk_cnt   := v_blk_cnt - 1;

                                IF     v_blk_cnt = 0
                                   AND v_tbl.COUNT > 0 THEN
                                    v_tbl.DELETE (v_tbl.LAST);
                                END IF;
                            END IF;
                        END IF;
                    END IF;
                END IF;
            END IF;
        END IF;
    END LOOP;

    RETURN CASE v_tbl.COUNT
               WHEN 0 THEN
                   'UNKNOWN'
               ELSE
                   v_tbl (v_tbl.LAST)
           END;
END;
/

Show errors;

 

Other good example use new features Oracle 10g

DECLARE
	local_exception EXCEPTION;
	FUNCTION nested_local_function
	RETURN BOOLEAN IS
		retval BOOLEAN := FALSE;
BEGIN
	RAISE local_exception;
	RETURN retval;
	END;
BEGIN
IF nested_local_function THEN
	dbms_output.put_line('No raised exception');
END IF;
EXCEPTION
WHEN others THEN
	dbms_output.put_line('DBMS_UTILITY.FORMAT_CALL_STACK');
	dbms_output.put_line('------------------------------');
	dbms_output.put_line(dbms_utility.format_call_stack);
	dbms_output.put_line('DBMS_UTILITY.FORMAT_ERROR_BACKTRACE');
	dbms_output.put_line('-----------------------------------');
	dbms_output.put_line(dbms_utility.format_error_backtrace);
	dbms_output.put_line('DBMS_UTILITY.FORMAT_ERROR_STACK');
	dbms_output.put_line('-------------------------------');
	dbms_output.put_line(dbms_utility.format_error_stack);
END;
/
This script produces the following output:
DBMS_UTILITY.FORMAT_CALL_STACK
------------------------------
----- PL/SQL Call Stack -----
object line object
handle number
name
20909240 18 anonymous block
DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
-----------------------------------
ORA-06512: at line 7
ORA-06512: at line 11
DBMS_UTILITY.FORMAT_ERROR_STACK
-------------------------------
ORA-06510: PL/SQL: unhandled user-defined exception

Oracle SQL: LAG Oracle 11g is analytic function

Very usefully new features in Oracle 11g is analytic Oracle SQL function LAG.

SQL query LAG

This code find change in address post code in journal table:

  SELECT  *
    FROM  (
              SELECT  t1.SITE_NUMBER
                     ,t1.JN_DATETIME
                     ,t1.ADR_POSTCODE
                     ,LAG (t1.ADR_POSTCODE, 1) OVER (PARTITION BY t1.SITE_NUMBER ORDER BY t1.jn_datetime) AS PREV_ADR_POSTCODE
                FROM  t1 
          )
   WHERE      adr_postcode = '00-001'
          AND PREV_ADR_POSTCODE <> '00-001'
          AND PREV_ADR_POSTCODE <> '00-000'
ORDER BY  SITE_NUMBER;

Test query data

CREATE TABLE T1
(
  SITE_NUMBER   VARCHAR2(16 BYTE),
  JN_DATETIME   DATE,
  ADR_POSTCODE  VARCHAR2(20 BYTE)
)
LOGGING 
NOCOMPRESS 
MONITORING;
SET DEFINE OFF;
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20001', TO_DATE('08/01/2017 15:01:31', 'MM/DD/YYYY HH24:MI:SS'), '00-001');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20002', TO_DATE('04/20/2017 11:59:29', 'MM/DD/YYYY HH24:MI:SS'), '00-002');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20001', TO_DATE('06/15/2017 04:02:41', 'MM/DD/YYYY HH24:MI:SS'), '00-003');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20004', TO_DATE('06/20/2017 20:15:13', 'MM/DD/YYYY HH24:MI:SS'), '00-001');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20001', TO_DATE('12/10/1929 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '00-001');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20001', TO_DATE('09/25/2091 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '00-003');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20001', TO_DATE('09/14/1914 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '00-001');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20001', TO_DATE('03/25/1911 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '00-001');
Insert into KPREISKORN.T1
   (SITE_NUMBER, JN_DATETIME, ADR_POSTCODE)
 Values
   ('20001', TO_DATE('11/22/2029 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '00-001');
COMMIT;

SQL result

site_number jn_datetime adr_postcode prev_adr_postcode
20001 2017-08-01 15:01:31 00-001 00-003

How it works together

http://sqlfiddle.com/#!4/9a676b/1

Python rename special characters in filename

Problem

When upload files to One Drive i have problem with files contain special characters. Below you found Python script witch remove any special characters form filenames. Change

lv_path = "D:\\Netbeans Projects"

and enjoy!

Solution

rename spec characters (Python 3+, W7)
#!/usr/bin/env python
#
# wychwytywanie i zmiana nazwy plików
#
import os
import string
import re
import sys

delchars = ''.join(c for c in map(chr, range(256)) if not c.isalnum())

# paths = (os.path.join(root, filename)
#          for root, _, filenames in os.walk('.')
#          for filename in filenames)

# print(paths)
lv_path = "D:\\Netbeans Projects"

paths = (os.path.join(root, filename)
         for root, _, filenames in os.walk(lv_path)
         for filename in filenames)

print ("Search at " + lv_path)

for path in paths:
    newname = path.replace('#', '')
    newname = newname.replace('%', '')
    newname = newname.replace('*', '')
    newname = newname.replace('<', '')
    newname = newname.replace('>', '')
    newname = newname.replace('*', '')
    newname = newname.replace('?', '')
    newname = newname.replace('$', '')
    #newname = newname.replace('!', '')
    #newname = path.replace('\'', '-')
    newname = newname.replace('"', '')
    newname = newname.replace('\'', '')
    newname = path.replace('Å', 'ś')
    newname = path.replace('Å', 'ń')
    #newname = path.translate(str.maketrans("","",delchars))

    #re.sub('[^\w\-_\. ]', '_', newname)

    if newname != path:
        # print(path)
        print(os.path.dirname(path.encode('utf8').decode(sys.stdout.encoding)) + "\t" + os.path.basename(path.encode('utf8').decode(sys.stdout.encoding)) +
              "\t\t\t -> " + os.path.basename(newname.encode('utf8').decode(sys.stdout.encoding)))
        os.rename(path, newname)

Source(s)

The Qualities of Carrots Carrots have many qualities—sweet, bitter, pungent, heating, light, sharp. For pitta, go easy on the chili, garlic, mustard seeds, and hing and eat in moderation. Cooked carrots are sweet and heating with a pungent vipaka, so this recipe is particularly balancing for vata and kapha. Medicinal Uses: A good food for hemorrhoids, water retention, and blood building. It is an excellent brain tonic and aids deep thinking. Doshic Notes Vata = Pitta = Kapha = Ingredients Carr

Ingredients

  • 4 cups carrots
    1 small handful fresh cilantro, chopped
    1/2small green chili, chopped
    1 and 1/2 inch ginger, fresh, finely chopped
    2 cloves garlic, chopped
    2 Tbs coconut, shredded, unsweetened
    1/2 cup water
    1 Tbs ghee
    1/2 tsp black mustard seeds
    1/2 tsp cumin seeds
    1 pinch hing
    1/4 tsp salt

Preparation

Wash and grate the carrots medium fine.

Put the cilantro, chili, ginger, garlic, coconut, and water in a blender and blend on high until liquid.

Heat a pot on medium and add the ghee, mustard seeds, cumin seeds, and hing. When the seeds pop, add the blended mixture and salt, then brown very slightly.

Stir in the carrots, cover and cook on medium heat until just tender, about 10 minutes. Stir occasionally.

 

Source: Carrot Subji The Ayurvedic Institute.

PL/SQL Errors: ORA-04061: existing state of package has been invalidated

I suspect you’re only reporting the last error in a stack like this:

ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "schema.package" has been invalidated
ORA-04065: not executed, altered or dropped package body "schema.package"
ORA-06508: PL/SQL: could not find program unit being called: "schema.package"

If so, that’s because your package is stateful:

The values of the variables, constants, and cursors that a package declares (in either its specification or body) comprise its package state. If a PL/SQL package declares at least one variable, constant, or cursor, then the package is stateful; otherwise, it is stateless.

When you recompile the state is lost:

If the body of an instantiated, stateful package is recompiled (either explicitly, with the “ALTER PACKAGE Statement”, or implicitly), the next invocation of a subprogram in the package causes Oracle Database to discard the existing package state and raise the exception ORA-04068.

After PL/SQL raises the exception, a reference to the package causes Oracle Database to re-instantiate the package, which re-initializes it…

You can’t avoid this if your package has state. I think it’s fairly rare to really need a package to be stateful though, so you should revisit anything you have declared in the package, but outside a function or procedure, to see if it’s really needed at that level. Since you’re on 10g though, that includes constants, not just variables and cursors.

But the last paragraph from the quoted documentation means that the next time you reference the package in the same session, you won’t get the error and it will work as normal (until you recompile again).

As of Oracle Database 11g Release 2 (11.2.0.2), Oracle Database treats a package as stateless if its state is constant for the life of a session (or longer). This is the case for a package whose items are all compile-time constants.

A compile-time constant is a constant whose value the PL/SQL compiler can determine at compilation time. A constant whose initial value is a literal is always a compile-time constant. A constant whose initial value is not a literal, but which the optimizer reduces to a literal, is also a compile-time constant. Whether the PL/SQL optimizer can reduce a nonliteral expression to a literal depends on optimization level. Therefore, a package that is stateless when compiled at one optimization level might be stateful when compiled at a different optimization level. For information about the optimizer, see “PL/SQL Optimizer”.

Each session that references a package item has its own instantiation of that package. If the package is stateful, the instantiation includes its state. The package state persists for the life of a session, except in these situations:

  • The package is SERIALLY_REUSABLE.For details, see “SERIALLY_REUSABLE Packages”.
  • The package body is recompiled.If the body of an instantiated, stateful package is recompiled (either explicitly, with the “ALTER PACKAGE Statement”, or implicitly), the next invocation of a subprogram in the package causes Oracle Database to discard the existing package state and raise the exception ORA-04068.After PL/SQL raises the exception, a reference to the package causes Oracle Database to re-instantiate the package, which re-initializes it. Therefore, previous changes to the package state are lost. (For information about initialization, see “Package Instantiation and Initialization”.)
  • Any of the session’s instantiated packages are invalidated and revalidated.All of a session’s package instantiations (including package states) can be lost if any of the session’s instantiated packages are invalidated and revalidated. For information about invalidation and revalidation of schema objects, see Oracle Database Advanced Application Developer’s Guide.

It sounds like what you want is to be able to list all packages that may potentially have state.

What you’re looking for is just packages that have any global variables or constants. For a single package, this is quite simple by inspection. To look across all packages in a schema, however, you could use PL/Scope:

First, log in as the schema owner, turn on PL/Scope in your session:

alter session set plscope_settings='IDENTIFIERS:ALL';

Then, recompile all your package bodies.

Then, run this query to find all the variables and constants declared at the package level:

select object_name AS package,
       type,
       name AS variable_name
from user_identifiers
where object_type IN ('PACKAGE','PACKAGE BODY') and usage = 'DECLARATION' and type in ('VARIABLE','CONSTANT') and usage_context_id in ( select usage_id
  from user_identifiers
  where type = 'PACKAGE' );

I’d suggest the resulting list of packages will be your target.

If you’re on 11gR2, constants no longer cause this problem, so you’d use this query instead:

select object_name AS package,
       type,
       name AS variable_name
from user_identifiers
where object_type IN ('PACKAGE','PACKAGE BODY') and usage = 'DECLARATION' and type = 'VARIABLE' and usage_context_id in ( select usage_id
  from user_identifiers
  where type = 'PACKAGE' );

Source

  1. Annals of Oracle’s Improbable Errors: ORA-04061: existing state of package has been invalidated
  2. https://stackoverflow.com/questions/19376440/ora-06508-pl-sql-could-not-find-program-unit-being-called/19380746

“It happened after the sons of men had multiplied in those days that daughters were born to them elegant and beautiful. And when the angels, the sons of heaven, beheld them, they became enamoured of them, saying to each other “Come, let us select for ourselves wives from the progeny of men, and let us beget children.” Then their leader Samyaza said to them, “I fear that you may perhaps be indisposed to the performance of this enterprise; And that I alone shall suffer for so grievous a crime.”

But they answered him and said, “We all swear!”

And bind ourselves by mutual execrations that we will not change our intention, but execute our projected undertaking. Then they swore all together and all bound themselves by mutual execrations. Their whole number was two hundred who descended upon Ardis, which is the top of mount Armon.

That mountain therefore was called Armon, because they had sworn upon it and bound themselves by mutual execrations. [Mt. Armon, or Mt. Hermon, derives its name from the Hebrew word herem, a curse.]

These are the names of their chiefs: Samyaza, who was their leader, Urakabarameel, Akibeel, Tamiel, Ramuel, Danel, Azkeel, Saraknyal, Asael, Armers, Batraal, Anane, Zavebe, Samsaveel, Ertael, Turel, Yomyael, Arazyal. These were the prefects of the two hundred angels, and the remainder were all with them.

Then they took wives, each choosing for himself; whom they began to approach, and with whom they cohabited; teaching them sorcery, incantations and the dividing of roots and trees.

And the women conceiving brought forth giants,

Whose stature was each three hundred cubits. These devoured all which the labor of men produced; until it became impossible to feed them; When they turned themselves against men in order to devour them; And began to injure birds, beasts, reptiles, and fishes, to eat their flesh one after another and to drink their blood. Their flesh one after another. [Or, “one another’s flesh.” R.H. Charles notes that this phrase may refer to the destruction of one class of giants by another.]

Then the earth reproved the unrighteous.

Moreover Azazyel taught men to make swords, knives, shields, breastplates, the fabrication of mirrors and the workmanship of bracelets and ornaments, the use of paint, the beautifying of the eyebrows, the use of stones of every valuable and select kind and all sorts of dyes, so that the world became altered.

Impiety increased; fornication multiplied, and they transgressed and corrupted all their ways.

Amazarak taught all the sorcerers, and dividers of roots: Armers taught the solution of sorcery; Barkayal taught the observers of the stars, Akibeel taught signs; Tamiel taught astronomy, And Asaradel taught the motion of the moon,

And men, being destroyed, cried out; and their voice reached to heaven.” – Enoch 6-7.

Meet the Nephilim: A Hybrid species that inhabited Earth

PLSQL NOT_DATA_FOUND and CURSORS

Here we are common problem in PLSQL. We try find answer for one common question in programing databases. Is the specyfic record exist in other table or not exist? Some examples below show how to menage this problem:

NOT_DATA_FOUND Example
DECLARE
    VAR_SUPP_NM VARCHAR2(100);
    VAR_SUPP_ID  NUMBER := 1;
    WHILE_VAR CHAR := 'Y';
BEGIN
  SELECT SUPP_NM
    INTO VAR_SUPP_NM
    FROM TEST.SUPPLIER
   WHERE SUPP_ID = VAR_SUPP_ID;

 DBMS_OUTPUT.PUT_LINE('DATA FOUND');

exception
  when no_data_found then 
  	-- here some code when data ont exist
	DBMS_OUTPUT.PUT_LINE('SQL DATA NOT FOUND');

END;

In line 11 and 14 we have place to insert own code. Other solution we found when we use define explicit cursor:

Explicit Cursor Used to Fetch Just One Value
CREATE FUNCTION f_get_name (ip_emp_id IN NUMBER) RETURN VARCHAR2
AS
CURSOR c IS SELECT ename FROM emp WHERE emp_id = f_get_name.ip_emp_id;
lv_ename emp.ename%TYPE;
BEGIN
  OPEN c;
  FETCH c INTO lv_ename;
  IF (SQL%NOTFOUND) THEN
     RAISE NO_DATA_FOUND;
  ENDIF;
  FETCH c INTO lv_ename;
  IF (SQL%FOUND) THEN
    RAISE TOO_MANY_ROWS;
  ENDIF;
  CLOSE c;
  RETURN lv_ename;
END;

Explicit Cursors and Bulk Processing
CREATE OR REPLACE PROCEDURE refresh_store_feed AS
TYPE prod_array IS TABLE OF store_products%ROWTYPE INDEX BY BINARY_INTEGER;
l_prod prod_array;
CURSOR c IS
  SELECT product
    FROM listed_products@some_remote_site;
BEGIN
  OPEN C;
  LOOP
    FETCH C BULK COLLECT INTO l_prod LIMIT 100;
  FOR i IN 1 .. l_csi.COUNT
    LOOP
     /* ... do some procedural code here that cannot be done in SQL to l_csi(i) ... */
    END LOOP;
  FORALL i IN 1 .. l_csi.COUNT
    INSERT INTO store_products (product) VALUES (l_prod(i));
    EXIT WHEN c%NOTFOUND;
  END LOOP;
CLOSE C;
END;
/

REF Cursors in Brief

Though there are two other sections in this chapter that cover REF cursors more fully (“Static REF Cursors” and “Dynamic REF Cursors”), a brief overview regarding these types of cursors warrants mention in this section due to their structure: they must be explicitly opened, fetched from, and closed. If you are returning a result set to a client, a great way to avoid lots of repetitive code is to use a REF cursor. Essentially, the cursor you open usually depends on what input you receive from the requesting client. Listing 10-4 provides a brief example of a REF cursor scenario in PL/SQL:

REF Cursors Work Dynamically, But Are Declared

DECLARE
prod_cursor sys_refcursor;
BEGIN
	IF ( input_param = 'C' )
	THEN
		OPEN prod_cursor FOR
		SELECT * FROM prod_concepts
			WHERE concept_type = 'COLLATERAL'
				AND concept_dt < TO_DATE( '01-JAN-2003', 'DD-MON-YYYY');
	ELSE
		OPEN prod_cursor FOR
		SELECT * FROM prod_concepts
			WHERE concept_category = 'ADVERTISING';
	END IF;
LOOP

A Select … Into Cursor vs. a For … In Cursor
BEGIN
    FOR x IN (SELECT * FROM dual) LOOP ... END LOOP;
	END;
DECLARE
	CURSOR c IS SELECT * FROM dual;
BEGIN
	OPEN c;
	LOOP
		FETCH c INTO …
		EXIT WHEN c%NOTFOUND;
			…
		END LOOP;
		CLOSE c;
	END;
	BEGIN
		SELECT *INTO ...FROM dual;
		END;
	DECLARE
		CURSOR c IS SELECT * FROM dual;
		l_rec dual%ROWTYPE;
	BEGIN
	OPEN c;
	FETCH c INTO l_rec;
	IF (SQL%NOTFOUND)
	THEN
		RAISE NO_DATA_FOUND;
	END IF;
	FETCH c INTO l_rec;
	IF (SQL%FOUND)CHAPTER 
	THEN
		RAISE TOO_MANY_ROWS;
	END IF;
	CLOSE c;
END;

 

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑