November
15

Berikut beberapa kutipan yang diambil dari ebook MySQL 5.0 Refernce Manual mengenai Stored Procedure and Function :

Stored routines (procedures and functions) are supported in MySQL 5.0. A stored procedure is a set of SQL statements that can be stored in the server. Once this has been done, clients don’t need to keep reissuing the individual statements but can refer to the stored procedure instead.

Some situations where stored routines can be particularly useful:

  • When multiple client applications are written in different languages or work on different platforms, but need to perform the same database operations.
  • When security is paramount. Banks, for example, use stored procedures and functions for all common operations. This provides a consistent and secure environment, and routines can ensure that each operation is properly logged. In such a setup, applications and users would have no access to the database tables directly, but can only execute specific stored routines.

Stored routines can provide improved performance because less information needs to be sent between the server and the client. The tradeoff is that this does increase the load on the database server because more of the work is done on the server side and less is done on the client (application) side. Consider this if many client machines (such as Web servers) are serviced by only one or a few database servers. (From : MySQL 5.0 Reference Manual)

Sorry, lagi malas terjemahin , semoga dapat dipahami (^-^)

Read More

November
12

Stored Procedure and Function

Posted In: IT-Q, PHP, Programming-Q by kohaci

Function di MySQL

Dimisalkan gw punya database dengan salah satu nama tabelnya adalah “provinsi”, dengan isi tabelnya adalah :

kode_prov nama_prov
11 NANGGROE ACEH DARUSSALAM
12 SUMATERA UTARA
13 SUMATERA BARAT
14 RIAU
15 JAMBI

Dengan dibantu bahasa pemrograman basis web (contoh di artikel ini memakai PHP) , ingin ditampilkan di browser keseluruhan tampilan isi tabel provinsi dari database (contoh di artikel ini memakai MySQL) dengan format tampilan berupa tabel. Dengan header kode_prov diganti dengan KODE PROVINSI dan nama_prov diganti dengan NAMA PROVINSI. Ada beberapa macam cara untuk menampilkannya, secara garis besar gw ambil dengan 2 cara, yaitu : Read More

November
8

PC-Q and Software-Q

Posted In: Experience, IT-Q by kohaci

Gambar di atas adalah screenshot dekstop PC gw yang tIdak terasa udah lebih dari satu tahun menemani gw. Ini adalah PC kedua gw yang mana pertama telah gw ceritakan di postingan sebelumnya.

PC ini dibeli pada akhir Mei 2007 (pas mau UAS kuliah tingkat 2) dengan proses birokrasi yang panjang bersama nyokap gw untuk mendapatkan sebuah PC. Belinya pun rakitan , CPU dan perangkat-perangkat lainnya dibeli d Harco Mangga Dua dengan proses perjalanan yang lumayan singkat bersama Sutanto, kemudia monitor di toko komputer sekitar kosan.

Awalnya, gw mo patungan dengan Hardi __ teman sekosan __ untuk beli PC, karena maklum kami mahasiswa yang pas-pasan. Tapi setelah dipikir-pikir lebih baik jangan patungan, takutnya jika kami pisah (kosan) ntar, urusan PC bisa berabe dan akhirnya gw putusin biar aja gw yang beli.

Permasalahannya adalah gw tidak punya modal yang cukup kuat untuk beli PC. Gw tipikal “orang yang sok gengsi” minta-minta ma ortu (tapi kalo utang ma teman sering :D ). Tapi “kegengsian” itu gw sembunyiin jauh-jauh hingga ga kelihatan sama sekali dan mulai mengais ke nyokap untuk dibeliin PC, beberapa alasanpun terlontarkan , di antaranya :

“Mom, One year ago, I rent a house with my friends, and a lot of my friend have bring a PC, so I could used her PC for finishing my task but now, we seperated each other. No PC, never finishing my task! So, please.. .. “

Yup, alasan yang keren dan akhirnya proposal gw disetujui! Read More