baur b.

2 Followers
2 Blog Followers
Following:
Following Blogs: 2

Latest Activity

TO_CHAR(…, 'D')

baur b. posted an article on - Aug 23, 2011, 12:55 am
How do I get than MONDAY=1, TUESDAY=2, WEDNESDAY=3 … ? solution1 With to_char() solution2 With decode() The abbrivation of a day’s name (such as SUN, MON … can be retrieved with the format specifier DY. As to_char is sensitive to the actual nls setting, I use nls_date_language=english to make ...
Comment - Like

Extraction of consecutive periods (without regard to the OverLap)

baur b. posted an article on - Aug 18, 2011, 5:30 am
kikanT ID StaD EndD -- ---------- ---------- 10 2010-06-01 2010-06-12 10 2010-06-13 2010-06-14 10 2010-06-15 null 20 2010-06-01 2010-06-11 20 2010-06-13 2010-06-15 50 2010-11-11 2010-11-13 50 2010-11-14 2010-11-20 50 2010-12-22 2010-12-30 Summarized in consecutive periods every ID. ID StaD EndD -- -...
Comment - Like

Summarizes the start and end dates (or how to eleminate overlaps in dates)

baur b. posted an article on - Aug 18, 2011, 2:54 am
TimeSheet table StartDate EndDate ---------- ---------- 2005-01-01 2005-01-03 2005-01-02 2005-01-04 2005-01-04 2005-01-05 2005-01-06 2005-01-09 2005-01-09 2005-01-09 2005-01-12 2005-01-15 2005-01-13 2005-01-14 2005-01-14 2005-01-14 2005-01-17 2005-01-17 result StartDate EndDate ---------- ----------...
Comment - Like

How does one get the time difference between two date columns?

baur b. posted an article on - Aug 12, 2011, 7:25 am
Oracle allows two date values to be subtracted from each other returning a numeric value indicating the number of days between the two dates (may be a fraction). This example will show how to relate it back to a time value. Let’s investigate some solutions. Test data: Solution 1 An enhancement to ...
Comment - Like

Concatenate sets of intervals

baur b. posted an article on - May 5, 2011, 1:44 am

Comment - Like

Getting a Request Parameter Using JSTL in a JSP Page

baur b. posted an article on - Feb 17, 2011, 5:26 am
When using the JSTL’s expression language (see Enabling the JSTL Expression Language in a JSP Page), the request parameters are made available in the implicit object param. This example demonstrates how to include the value of a request parameter from the query string or posted data in the generat...
Comment - Like

Getting a Request Parameter in a Servlet

baur b. posted an article on - Jan 31, 2011, 4:21 am
In a GET request, the request parameters are taken from the query string (the data following the question mark on the URL). For example, the URL http://hostname.com?p1=v1&p2=v2 contains two request parameters – – p1 and p2. In a POST request, the request parameters are taken from both query stri...
Comment - Like

How to get information about user using Servlet

baur b. posted an article on - Jan 21, 2011, 4:33 am
The method getRemoteUser() of the HttpServletRequest gives the username of the client. With the remote user’s name, a servlet can save information about each client. Over the long term, it can remember each individual’s preferences. For the short term, it can remember the series of pages, viewed...
Comment - Like

Oracle PL/SQL – Merge table

baur b. posted an article on - Jan 20, 2011, 4:46 am

Comment - Like

Autoincrement primary key for Oracle

baur b. posted an article on - Jan 20, 2011, 3:50 am
Suppose you have a database and you want each entry to be identified by a unique number. You can do this easily in mysql by specifying “auto_increment” for your number, but Oracle makes you work a little more to get it done. Here is one way to do it by creating two database objects, a
Comment - Like

Protected: post133

baur b. posted an article on - Dec 21, 2010, 1:49 pm
There is no excerpt because this is a protected post.
Comment - Like

Protected: post122

baur b. posted an article on - Dec 21, 2010, 1:47 pm
There is no excerpt because this is a protected post.
Comment - Like

Oracle DBMS_JOB – Session Killer

baur b. posted an article on - Nov 11, 2010, 1:14 am
Note This package is deprecated and has been supplanted by DBMS_SCHEDULER. Source {ORACLE_HOME}/rdbms/admin/dbmsjob.sql Dependencies job$, dba_jobs, all_jobs, user_jobs, dba_jobs_running, all_jobs_running, user_jobs_running Job Intervals Execute daily 'SYSDATE + 1' Execute once per week 'SYSDATE + 7...
Comment - Like

Protected: mark

baur b. posted an article on - May 2, 2010, 1:30 pm
There is no excerpt because this is a protected post.
Comment - Like

Protected: ke

baur b. posted an article on - May 2, 2010, 1:10 pm
There is no excerpt because this is a protected post.
Comment - Like

Till New Year

baur b. posted an article on - Jul 2, 2009, 5:37 am
SELECT 'Till the New Year ' || to_char(extract(YEAR FROM SYSDATE) + 1) || ' - ' || trunc(months_between(to_date('01.01.' || to_char(extract(YEAR FROM SYSDATE) + 1), 'dd.mm.yyyy'), SYSDATE)) || ' months ' || to_char(LAST_DAY(SYSDATE) - SYSDATE) || ' day ' || to_char(23 - to_number(substr(to_char(SYSD...
Comment - Like

[PL\SQL] Convert seconds to Day hour : min : sec

baur b. posted an article on - Jul 2, 2009, 5:30 am
variable vSec number; exec :vSec := 68400; SELECT to_char(trunc(:vSec / 60 / 60 / 24), '09') || '' FROM dual;
Comment - Like

(PL\SQL) How to parse a full name into first, middle and last names?

baur b. posted an article on - Dec 31, 1969, 7:00 pm
1st Method CLEAR; with t as ( select 'fabc iabc oabcd' fio from dual union all select ' fabc iabc oabcd' fio from dual union all select 'fabc iabc oabcd ' fio from dual union ALL select ' Baimendinov Salimjan Danauly ' fio from dual union ALL select ' fabc iabc oabcd ' fio from
Comment - Like

[PL\SQL] Select a random row from a database table

baur b. posted an article on - Dec 31, 1969, 7:00 pm
There is some way to select a random record or row from a database table.
Comment - Like

[PL\SQL] Increasing results

baur b. posted an article on - Dec 31, 1969, 7:00 pm
data MNTH SM 1 10 2 20 3 30 4 40 result MNTH SM TOTAL 1 10 10 2 20 30 3 30 60 4 40 100
Comment - Like

[PL\SQL] Pivot Query

baur b. posted an article on - Dec 31, 1969, 7:00 pm
data mnth CITY SUMMA 1 11 1 1 22 25 1 33 1 2 11 52 2 22 3 2 33 3 3 11 3 3 22 65 3 33 6 result / mnth mnth mnth … mnth12 city 1 2 3 … 12 11 1 52 3 … x 22 25 3 65 …
Comment - Like

[PL\SQL] How to Join on top (First) row

baur b. posted an article on - Dec 31, 1969, 7:00 pm
SELECT * FROM (SELECT ROWNUM t FROM DUAL CONNECT BY LEVEL
Comment - Like

Search table

baur b. posted an article on - Dec 31, 1969, 7:00 pm
SELECT * FROM user_all_tables WHERE TABLE_NAME LIKE UPPER('%ISSCR%') AND TABLE_NAME NOT IN (SELECT TABLE_NAME FROM user_all_tables WHERE TABLE_NAME LIKE '%$%' OR TABLE_NAME LIKE '%REP%');
Comment - Like

performance

baur b. posted an article on - Dec 31, 1969, 7:00 pm
DECLARE l_start NUMBER; l_end NUMBER; BEGIN ... l_start := dbms_utility.get_time; ... l_end := round((dbms_utility.get_time - l_start) / 100, 2); dbms_output.put_line(l_end || ' seconds...'); END;
Comment - Like

(PL\SQL) How to get MAX(num)+DISTINCT str

baur b. posted an article on - Dec 31, 1969, 7:00 pm
CLEAR; with t as ( select '11' num, 'string1' str, '1' DATA from dual union all select '12' num, 'string1' str, '3' DATA from dual union all select '15' num, 'string1' str, '3' DATA from dual union all select '25' num, 'string2' str, '10' DATA from dual union all select '26' num, 'string2' str, '2'
Comment - Like

baur b.'s Blogs:

baur b.'s Followers

baur b. is Following

Invite Your Friends

Invite your contacts to blogged from:
gmail yahoo