Langsung ke konten utama

Postingan

BATCH FILE PROGRAMMING

Batch File Programing   merupakan perintah dasar yang ada pada sistem operasi Windows. Dengan mempelajari beberapa perintah batch pada komputer, nantinya anda akan bisa membuat sebuah program penolong ataupun program penghancur (red=Virus) yang tidak kalah dengan VBscript. Saya disini mencoba belajar membuat batch file menggunakan perintah dasar "echo", pertama coba anda ketikkan perintah seperti ini : Echo belajar dan berbagi... Perintah Echo ini berfungsi untuk menampilkan pesan, komentar atau keterangan dan lain-lain yang diberikan oleh user ketika berada dalam kondisi tertentu. Yang kedua, anda simpan perintah tadi yang sudah diketik dengan nama Coba1.bat. Ketiga, coba anda jalankan file Coba1.bat... jreng...jreng ada hasilnya kan?? Pasti ada dong, jendela command prompt muncul sebentar terus hilang lagi deh ya kan?? Bingung tidak bisa melihat apa isi dari command prompt tadi, nah saya akan sedikit berbagi tips nya agar jendela command prompt...

SQL Server – Update From Table with INNER JOIN

Often we may need to update a column in a table based of another column in another table. In SQL Server you can do this using UPDATE statement by joining tables together. To understand this better let’s take a look at below contrived example. USE [SqlAndMe] GO SELECT CustomerID , Name , OrderAmount FROM    dbo . Customers GO SELECT OrderID , CustomerID , Amount FROM    dbo . Orders GO Result Set: CustomerID     Name           OrderAmount 3              Curtis         NULL 4              Lanna          NULL 5              Marlin         NULL 6       ...

MEMPERSIAPKAN PENTAHO DATA INTEGRATION

https://help.pentaho.com/Documentation/5.2/0F0/0G0/020 Prepare Environment To prepare the computer on which you plan to install the BA design tool and plugins, complete these tasks. Install Java JRE or JDK . Set environment variables . Install Java JRE or JDK Make sure that the version of the Java Runtime Environment (JRE) or the Java Development Kit (JDK) that Pentaho needs to run is installed on your system. You do not need to uninstall other versions of Java if you already have them running on your system. These instructions explain how to check for your default version of Java that is running on your computer and where to get the required version if you need one. Check the supported technologies list to see which version of the JRE or JDK is needed for the software. If you have not done so already, log into the computer on which you plan to install the software. Ensure t...

Menghitung Sub Total Menggunakan WITH ROLLUP Pada Query MySQL

Pada MySQL, klausa  WITH ROLLUP  digunakan bersamaan dengan klausa  GROUP BY ,   WITH ROLLUP  dapat digunakan baik untuk menghitung total maupun sub total sesuai dengan kolom yang kita gunakan dalam klausa  GROUP BY . Kelebihan klausa ini adalah simpel dan dapat menghasilkan total dan subtotal hanya dalam satu query, sehingga membuat pekerjaan kita jauh lebih mudah dan sederhana. Misal, untuk menyelesaikan pembuatan total dan subtotal sebagaimana contoh sebelumnya, kita hanya perlu menambahkan WITH ROLLUP  pada akhir query, sehingga querynya menjadi seperti ini: SELECT thn_byr , id_pelanggan , id_produk , SUM ( jml_byr ) AS jml_byr FROM ` sales ` GROUP BY thn_byr , id_pelanggan , id_produk WITH ROLLUP ketika kita jalankan query tersebut (menggunakan HEIDI SQL), hasil yang kita peroleh adalah:   jika kita perhatikan, MySQL melakukan tiga fungsi penjumlahan berdasarkan kolom yang ada di group b...

PENTAHO Set JAVA environment variables

The JAVA_HOME and JRE_HOME environment variables The BI Server is written on the Java platform, and for the BI Server to work properly, you need to make sure that the JAVA_HOME or JRE_HOME environment variable has been set up properly. Follow the given steps: Set the JAVA_HOME variable pointing to your JDK installation folder, for example, C:\Program Files\Java\jdk1.6.0_45 . Set the JRE_HOME variable pointing to your JRE installation folder, for example, C:\Program Files\Java\jre6 . For example, if you set the JAVA_HOME variable in the Windows 7 environment, the Environment Variables dialog will look like the following screenshot:

Resolve absolute path from relative path and/or file name

In batch files, as in standard C programs, argument 0 contains the path to the currently executing script. You can use %~dp0 to get only the path portion of the 0th argument (which is the current script) - this path is always a fully qualified path. You can also get the fully qualified path of your first argument by using %~f1 , but this gives a path according to the current working directory, which is obviously not what you want. Personally, I often use the %~dp0%~1 idiom in my batch file, which interpret the first argument relative to the path of the executing batch. It does have a shortcoming though: it miserably fails if the first argument is fully-qualified. If you need to support both relative and absolute paths, you can make use of Frédéric Ménez's solution : temporarily change the current working directory. Here's an example that'll demonstrate each of these techniques: @echo off echo %%~dp0 is "%~dp0" echo %%0 is "%0" ec...

Adding the new MySQL user

Connect to your database as root, then add your new user like so: CREATE USER 'tester' @ '%' IDENTIFIED BY 'password' ; The % here means  the user 'tester' connecting from any host , you can place a network hostname here instead if you want to restrict access further. Naturally you will also want to substitute  password  with something a little stronger ;-) Now run the following to grant the SELECT privilage to the new user on all databases: GRANT SELECT ON *.* TO 'tester' @ '%' ; Or if you want to restrict access to only one database: GRANT SELECT ON DATABASE .* TO 'tester' @ '%' ; Confirming that it worked Connect as the new user: mysql -u tester -p And now see if you can update a record: mysql > USE alpha; mysql > UPDATE Person SET version_num = 5 WHERE OID = 1 ; ERROR 1142 ( 42000 ) : UPDATE command denied TO USER 'tester' @ 'localhost' FOR TABLE ...

Solution: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

Solution: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine Today, after I uploaded one of my ETL data integration components (written in C#) from local 32-bit Windows System to our server environment which is running on Windows 2008 R2 64-bit system, my application blew up with the following error message: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine. The reason for this error is, I used Jet database engine in my ETL component to read Excel file, but the Jet library was not designed for 64-bit system. The community has been suggesting to compile the code to target to x86 platform in order to cope with this issue, which is something I was reluctant to do for the obvious reasons. It's also the primary motivation that I am blogging about this issue. Further Google search indicates that Microsoft has released a 64-bit compatible Jet database engine last year. The following is the procedure that you may...

Mysql Import data from CSV File

  Microsoft Windows [Version 10.0.15063] (c) 2017 Microsoft Corporation. All rights reserved. C:\Users\PSI011>cd C:\xampp\mysql\bin C:\xampp\mysql\bin> mysqld 2017-08-22 14:24:49 15428 [Note] mysqld (mysqld 10.1.25-MariaDB) starting as process 16352 ... C:\xampp\mysql\bin> mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.1.25-MariaDB mariadb.org binary distribution Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use pkh; Database changed MariaDB [pkh]> LOAD DATA LOCAL INFILE 'D:/2017/PKH_FOR_BPKP/PKH_FOR_BPKP_01.csv' -> INTO TABLE pkh_bpkp -> FIELDS TERMINATED BY ',' -> OPTIONALLY ENCLOSED BY '"' -> ESCAPED BY '"' -> LINES TERMINATED BY '\n...