Archive

Archive for the ‘Programming’ Category

Stored Procedure: Good or Evil


Isenk-isenk googling.. ternyata banyak juga perdebatan mengenai Stored Procedure..

Berikut ini beberapa link yang membahas tentang hal itu:

SIlahkan bagi ada yang mau menambahkannya, untuk berbagi pengetahuan..

Categories: Programming Tags:

FIRST_VALUE


FIRST_VALUE merupakan fungsi Oracle untuk mendapatkan nilai pertama dari sebuah pengelompokkan yang urut, berikut merupakan definisi dari Oracle:

Definition:

The Oracle PL/SQL FIRST_VALUE function is an analytic function which selects the first record from the partitioned and ordered set of rows. You can specify the IGNORE NULLS parameter to ignore the NULL values of the operand column and force consideration of NOT NULL values.

If the first value in the result set is NULL then the function returns NULL unless you specify IGNORE NULLS.
If you use the IGNORE NULLS parameter then FIRST_VALUE will return the first non-null value found in the result set. (If all values are null then it will return NULL.)

Example Syntax:

FIRST_VALUE(expression [INGORE NULLS]) OVER (analytic_clause)

Note that you cannot nest analytic functions by using FIRST_VALUE for expression.

Example Usage:

The SQL query below shows the ‘Highest Salary’ of employees who are reporting to the same manager.

SELECT EMPNO, ENAME, SAL,
FIRST_VALUE (SAL IGNORE NULLS) OVER (PARTITION BY MGRNO ORDER BY SAL DESC) "Highest Salary"
FROM EMPLOYEES
Categories: Programming Tags:

WM_CONCAT


WM_CONCAT merupakan fungsi Oracle untuk menggabungkan nilai dari banyak baris menjadi satu baris dengan koma sebagai pemisah datanya, berikut merupakan definisi dari Oracle:

Definition:

The Oracle PL/SQL WM_CONCAT function is used to aggregate data from a number of rows into a single row, giving a list of data associated with a specific value. In effect, it cross-tabulates a comma delimited list.

Note that WM_CONCAT is undocumented and unsupported by Oracle, meaning it should not be used in production systems. The LISTAGG function, which can produce the same output as WM_CONCAT is both documented and supported by Oracle.

Berikut ini merupakan contoh penggunaannya:

SELECT WM_CONCAT(CAST(DSCP AS VARCHAR2(50)))
FROM EBMAINT.TBL_MT_STATE
WHERE DSCP LIKE '%JA%';

Yang akan menghasilkan:

Jambi,Jakarta,West Java,Central Java,East Java
Categories: Programming Tags:

PL/SQL


PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation’s procedural extension language for SQL and the Oracle relational database. PL/SQL’s general syntax resembles that of Ada or Pascal.
PL/SQL is one of three key programming languages embedded in the Oracle Database, along with SQL itself and Java.
PL/SQL is available in Oracle Database (since version 7), TimesTen in-memory database (since version 11.2.1), and IBM DB2 (since version 9.7).[1]

Read more…

Categories: Programming Tags:

Stored Procedure


A stored procedure is a subroutine available to applications that access a relational database system. A stored procedure (sometimes called a proc, sproc, StoPro, StoredProc, sp or SP) is actually stored in the database data dictionary.
Typical use for stored procedures include data validation (integrated into the database) or access control mechanisms. Furthermore, stored procedures can consolidate and centralize logic that was originally implemented in applications. Extensive or complex processing that requires execution of several SQL statements is moved into stored procedures, and all applications call the procedures. One can use nested stored procedures, by executing one stored procedure from within another.
Stored procedures are similar to user-defined functions (UDFs). The major difference is that UDFs can be used like any other expression within SQL statements, whereas stored procedures must be invoked using the CALL statement.[1]

CALL procedure(...)

or

EXECUTE procedure(...)

Stored procedures may return result sets, i.e. the results of a SELECT statement. Such result sets can be processed using cursors, by other stored procedures, by associating a result set locator, or by applications. Stored procedures may also contain declared variables for processing data and cursors that allow it to loop through multiple rows in a table. Stored procedure languages typically include IF, WHILE, LOOP, REPEAT, and CASE statements, and more. Stored procedures can receive variables, return results or modify variables and return them, depending on how and where the variable is declared.

Read more…

Categories: Programming Tags:

Create a Responsive Web Design with Media Queries


If you’ve yet to get your hands dirty with media queries, now is your chance to create your first responsive website design. In this tutorial we’ll look at converting one of my previous WordPress theme designs into a responsive layout, while taking into consideration the design’s original grid structure.

View the responsive layout demo

Read more…

Categories: ASP, CSS, HTML, PHP Tags:
%d bloggers like this: