Kamis, 21 Juli 2011
Senin, 25 April 2011
tutorial create add-hoc and share data in windows 7
First we will do before mengeshare data we must first go to control panel and and then we go into network and sharing center and select Manage wirreless network on the left upper.
The second after we choose we will see a screen similar to below
then we select the add and we will see a screen similar to how do you want to manually select the network Next we create a network profile and we'll see the display below. This display is a display where we are before it will make sharing data or the file we will create a network or networks. By the way pulled "click" next meal we will see a different look again
then we select the add and we will see a screen similar to how do you want to manually select the network Next we create a network profile and we'll see the display below. This display is a display where we are before it will make sharing data or the file we will create a network or networks. By the way pulled "click" next meal we will see a different look again
After next we will see the words that will start us create a network or network name so that we can recognize people and unknown.
This network will become a special hallmark to start the transfer of data from one computer to another computer.
After all we are content then we will see a display that is useful as a place to make sure the name we created earlier in accordance with our expectations of what yet. If it is then we just click "close" again.
Next we will see the name "Jojo" we have made with us to check our dijaringan earlier, usually on the left below.
And we click so that we can know how the networks we have made it very was very nice not to check what network, if the full meaning the network is good and can be resumed. But if the network is a bit mean that the network has not connected with the laptop or computer.
Next we check whether the IP that we use is matched with another laptop? If not then we match it with open IPv4 if it's on a laptop with windows 7 tp OS if the OS Windows XP then we will see the Internet protocol / IP.
Previously we click the "use the following IP address" and we fill in the IP address 192.168.0.1 the very back of our content but with the IP freely with each other not to clash or in other words the same, it must be different from a PC with other PC.
10.
Next we check whether the IP of other laptops can already be detected with our laptop by typing ping 192.169.0. ... The point is filled with no other laptops that had been set too. After that then see what would emerge if the RTO not appear then shall mean the connection is good.
Next we check whether the IP of other laptops can already be detected with our laptop by typing ping 192.169.0. ... The point is filled with no other laptops that had been set too. After that then see what would emerge if the RTO not appear then shall mean the connection is good.
Next we check our other laptops using start + R and the result is like this, then we fill it with \ \ 192.168.0. ... That point was filled with other laptops that have been set and connected IP network we had. After that, OK
1Then we will see some files that have been shared to our laptop and one of them is "nikki bokeppe mas broo" the file that we had shared dilaptop corresponding experiments have been successful because the laptop can only detect this laptop.
.But if we want to share let's see how many PCs that can fit within our network.
After that we were looking for some files which we will share our PC dr. If it is found then we click properties then we will find the display below if we choose sharing. After that we select the share and click it.
Furthermore, after we select the share, there will be display as below. Next we choose who can see the files that we share with the click add and choose whether or everyone else.
After that we click share. Then the files in question have been or have us share. And we click "done" then we have done this stage and enjoying the files that we share.
.Now we have the file share it will change color or display like this, and this indicates that the steps to mengeshare data is completely successful.
Minggu, 31 Oktober 2010
Cursor Explisit Implisit in oracle
Example cursor explisit and cursor implisit in oracle
cursor explisit
select [daftar kolom]
into [daftar variabel]
from [daftar tabel]
where [syarat]
------------------------------------------------------------
select first_name, last_name, salary
into nama_depan, nama_belakang, gaji
from employees
where first_name = ‘Susan’;
1. declare
nama_cari varchar(15);
nama_depan varchar(15);
nama_belakang varchar(15);
gaji varchar(10);
------------------------------------------------------------------
declare
nama_cari employees.first_name%type;
nama_depan employees.first_name%type;
nama_belakang employees.last_name%type;
gaji employees.salary%type;
2. declare
nama_cari varchar(15);
nama_depan varchar(15);
nama_belakang varchar(15);
gaji varchar(10);
begin
nama_cari := '&masukkan_nama';
select first_name, last_name, salary
into nama_depan, nama_belakang, gaji
from employees
where first_name = nama_cari;
dbms_output.put_line('pegawai bernama '||nama_depan||’ ‘ ||nama_belakang||' gajinya adalah USD '||gaji);
end;
/
3. declare
nama_cari employees.first_name%type;
nama_depan employees.first_name%type;
nama_belakang employees.last_name%type;
gaji employees.salary%type;
begin
nama_cari := '&masukkan_nama';
select first_name, last_name, salary
into nama_depan, nama_belakang, gaji
from employees
where first_name = nama_cari;
dbms_output.put_line('pegawai bernama '||nama_depan||
' '||nama_belakang||' gajinya adalah USD '||gaji);
end;
/
Jawaban
declare
nama_cari employees.first_name%type;
nama_depan employees.first_name%type;
alamat_email employees.email%type;
telepon employees.phone_number%type;
begin
nama_cari := '&masukkan_nama';
select first_name, email, phone_number
into nama_depan, alamat_email, telepon
from employees
where first_name = nama_cari;
dbms_output.put_line('Nama: '||nama_depan);
dbms_output.put_line('Email: '||alamat_email||'@SemogaJaya.co.id');
dbms_output.put_line('Telepon: '||telepon);
end;
/
Jawaban
declare
nama_cari employees.first_name%type;
nama_depan employees.first_name%type;
nama_job jobs.job_title%type;
gaji employees.salary%type;
begin
nama_cari := '&masukkan_nama';
select first_name, job_title, salary
into nama_depan, nama_job, gaji
from employees, jobs
where employees.job_id = jobs.job_id
and first_name = nama_cari;
dbms_output.put_line('pegawai bernama '||nama_depan||' pekerjaannya sebagai '||nama_job||' dan gajinya adalah USD '||gaji);
end;
/
cursor implisit
DOFC à (DECLARE, OPEN, FETCH, CLOSE)
Declare
cursor [nama_cursor_bebas] is
select [daftar_kolom]
from [daftar_tabel]
where [syarat];
begin
open [nama_cursor_bebas];
loop
fetch [nama_cursor_bebas] into [daftar_variabel];
exit when [nama_cursor_bebas] %notfound;
[aksi_lain]
end loop;
close [nama_cursor_bebas];
end;
/
Contoh
1. declare
nama_cari varchar(15);
nama_depan varchar(15);
nama_belakang varchar(15);
gaji varchar(10);
cursor anu is
select first_name, last_name, salary
from employees
where first_name = nama_cari;
begin
nama_cari := '&masukkan_nama';
open anu;
loop
fetch anu into nama_depan, nama_belakang, gaji;
exit when anu%notfound;
dbms_output.put_line('pegawai bernama '||nama_depan||' ' ||nama_belakang||' gajinya adalah USD '||gaji);
end loop;
close anu;
end;
/
2. declare
nama_cari employees.first_name%type;
nama_depan employees.first_name%type;
nama_belakang employees.last_name%type;
gaji employees.salary%type;
cursor anu is
select first_name, last_name, salary
from employees
where first_name = nama_cari;
begin
nama_cari := '&masukkan_nama';
open anu;
loop
fetch anu into nama_depan, nama_belakang, gaji;
exit when anu%notfound;
dbms_output.put_line('pegawai bernama '||nama_depan||' ' ||nama_belakang||' gajinya adalah USD '||gaji);
end loop;
close anu;
end;
/
Latihan Menulis
Jawaban
declare
nama_cari employees.first_name%type;
nama_depan employees.first_name%type;
alamat_email employees.email%type;
telepon employees.phone_number%type;
cursor anu is
select first_name, email, phone_number
from employees
where first_name = nama_cari;
begin
nama_cari := '&masukkan_nama';
open anu;
loop
fetch anu into nama_depan, alamat_email, telepon;
exit when anu%notfound;
dbms_output.put_line('Nama: '||nama_depan);
dbms_output.put_line('Email: '||alamat_email||'@SemogaJaya.co.id');
dbms_output.put_line('Telepon: '||telepon);
dbms_output.put_line(‘-----------------------------------------------------------’);
end loop;
close anu;
end;
/
Latihan Menulis
Jawaban
declare
nama_cari employees.first_name%type;
nama_depan employees.first_name%type;
nama_job jobs.job_title%type;
gaji employees.salary%type;
cursor anu is
select first_name, job_title, salary
from employees, jobs
where employees.job_id = jobs.job_id
and first_name = nama_cari;
begin
nama_cari := '&masukkan_nama';
open anu;
loop
fetch anu into nama_depan, nama_job, gaji;
exit when anu%notfound;
dbms_output.put_line('pegawai bernama '||nama_depan||' pekerjaannya sebagai '||nama_job||' dan gajinya adalah USD '||gaji);
end loop;
close anu;
end;
/
LOOPING IN ORACLE
Example Looping
1. Declare
i number(3);
BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE('Ini angka ' || i );
END LOOP;
END;
/
2. Declare
BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE('Ini angka ' || i );
END LOOP;
END;
/
3. Declare
X number(3);
BEGIN
X:=&berapa;
FOR i IN 1..x LOOP
DBMS_OUTPUT.PUT_LINE('Ini angka ' || i );
END LOOP;
END;
/
4. Declare
x number(3);
BEGIN
X:=&berapa;
FOR i IN 1..x LOOP
if mod(i,2) = 1 then
DBMS_OUTPUT.PUT_LINE('Ini angka ' || i );
else
DBMS_OUTPUT.PUT_LINE('Ini angka ' || ‘i’ );
end if;
END LOOP;
END;
/
5. Declare
X number(3);
BEGIN
X:=&berapa;
FOR i IN 1..x LOOP
if mod(x,2) = 1 then
DBMS_OUTPUT.PUT_LINE('proses' );
else
DBMS_OUTPUT.PUT_LINE('lewat' );
end if;
END LOOP;
END;
/
6. Declare
X number(3);
BEGIN
X:=&berapa;
FOR i IN 1..x LOOP
if mod(i,2) = 1 then
for a in 1..i loop
DBMS_OUTPUT.PUT_LINE(a);
end loop;
else
DBMS_OUTPUT.PUT_LINE('lewat');
end if;
END LOOP;
END;
/
7. Declare
X number(3);
BEGIN
X:=&berapa;
FOR i IN 1..x LOOP
for a in 1..i
if mod(i,2) = 1 then
DBMS_OUTPUT.PUT_LINE(a);
else
DBMS_OUTPUT.PUT_LINE('lewat');
end if;
end loop;
END LOOP;
END;
/
8. Declare
X number(3);
BEGIN
X:=&berapa;
FOR i IN 1..x LOOP
if mod(i,2) = 1 then
for a in 1..i loop
DBMS_OUTPUT.PUT_LINE(a);
end loop;
end if;
END LOOP;
END;
/
9. DECLARE
i NUMBER(3);
hasil NUMBER(5);
BEGIN
i:=1;
WHILE i <= 10 LOOP
hasil := i**3;
DBMS_OUTPUT.PUT_LINE(i ||' pangkat 3 = '|| hasil );
i := i + 1;
END LOOP;
END;
/
10. DECLARE
hasil NUMBER(5);
BEGIN
i:=1;
WHILE i <= 10 LOOP
hasil := i**3;
DBMS_OUTPUT.PUT_LINE(i ||' pangkat 3 = '|| hasil );
i := i + 1;
END LOOP;
END;
/
11. DECLARE
i NUMBER(3);
hasil NUMBER(5);
BEGIN
i:=10;
WHILE i <= 10 LOOP
hasil := i**3;
DBMS_OUTPUT.PUT_LINE(i ||' pangkat 3 = '|| hasil );
i := i + 1;
END LOOP;
END;
/
12. DECLARE
i NUMBER(3);
hasil NUMBER(5);
BEGIN
i:=10;
WHILE i <= 10 LOOP
i := i + 1;
hasil := i**3;
DBMS_OUTPUT.PUT_LINE(i ||' pangkat 3 = '|| hasil );
END LOOP;
END;
/
13. DECLARE
i NUMBER(3);
hasil NUMBER(5);
BEGIN
i:=10;
WHILE i <= 10 LOOP
hasil := i**3;
DBMS_OUTPUT.PUT_LINE(i ||' pangkat 3 = '|| hasil );
END LOOP;
END;
/
14. DECLARE
i NUMBER(3);
hasil NUMBER(5);
BEGIN
i:=10;
WHILE i <= 10 LOOP
hasil := i**3;
i := i + 1;
DBMS_OUTPUT.PUT_LINE(i ||' pangkat 3 = '|| hasil );
END LOOP;
END;
/
15. DECLARE
total NUMBER(9);
counter NUMBER(6);
BEGIN
total := 0;
counter := 10;
LOOP
total := total + counter;
EXIT WHEN total > 50;
END LOOP;
DBMS_OUTPUT.PUT_LINE('Counter: ' || counter);
DBMS_OUTPUT.PUT_LINE(' Total: ' || total);
END;
/
16. DECLARE
total NUMBER(9);
counter NUMBER(6);
BEGIN
total := 0;
counter := 10;
LOOP
total := total + counter;
DBMS_OUTPUT.PUT_LINE(' Total: ' || total);
EXIT WHEN total > 50;
END LOOP;
DBMS_OUTPUT.PUT_LINE('Counter: ' || counter);
END;
/
17. DECLARE
total NUMBER(9);
counter NUMBER(6);
BEGIN
total := 0;
counter := 10;
LOOP
total := total + counter;
EXIT WHEN total > 50;
DBMS_OUTPUT.PUT_LINE(' Total: ' || total);
END LOOP;
DBMS_OUTPUT.PUT_LINE('Counter: ' || counter);
END;
/
INPUT, OUTPUT, And IF
Example input output dan IF
1. declare
B number(2);
begin
B:=101+4;
dbms_output.put_line(‘Bismillah, ini angka’ || B);
end;
/
2. declare
A varchar(3);
begin
A := ‘tes’;
dbms_output.put_line(a||’duh’);
dbms_output.put_line(A);
dbms_output.put_line(‘Bismillah’);
end;
3. declare
a number(5);
b number(5);
c number(9);
begin
a:=&nilai_a_berapa_sih;
b:=&nilai_b;
c:=a-b;
dbms_output.put_line(c);
end;
/
4. declare
a number(5);
b number(5);
c number(9);
d varchar(5);
begin
a:=&nilai_a;
b:=&nilai_b;
d:=‘&nilai_d’;
c:=a+b;
dbms_output.put_line(a|| ‘ditambah’ || b || ‘sama dengan’ || c);
end;
/
5. declare
x varchar(10);
y number(5);
begin
x:= ‘tes';
Y:= 15;
dbms_output.put_line('Selamat Datang '||x);
if y < 25 then
dbms_output.put_line(‘tes lagi ah’);
end if;
end;
/
6. declare
x varchar(10);
y number(5);
begin
dbms_output.put_line('Selamat Datang '||x);
if (y < 25) then
dbms_output.put_line(‘tes lagi ah’);
end if;
x:= ‘tes';
Y:= 15;
end;
/
7. declare
x varchar(10);
y number(5);
begin
dbms_output.put_line('Selamat Datang '||x);
if y < 25 then
dbms_output.put_line('tes lagi ah');
end if;
x:= 'tes';
Y:= 15;
dbms_output.put_line('Selamat Datang '||x);
if y < 25 then
dbms_output.put_line('tes lagi ah');
end if;
end;
/
8. declare
x varchar(10);
y number(5);
begin
x := 'abc';
y := 25;
dbms_output.put_line('Selamat Datang '||x);
if (x = 'Abc') then
dbms_output.put_line('tes lagi ah');
end if;
end;
/
9. declare
x varchar(10); y number(5); z varchar(10);
Begin
Z := ‘x’;
x := ‘x';
y := 25;
dbms_output.put_line('Selamat Datang '||z);
if (z = x) then
dbms_output.put_line('tes lagi ah');
end if;
if (z = ‘x’) then
dbms_output.put_line('tes beda');
end if;
end;
/
10. declare
jk varchar(10);
umur number(5);
begin
jk := '&jenis_kelamin';
umur := &umur;
if (umur > 60) then
dbms_output.put_line('inget mati...');
elsif (jk = 'L' and umur >= 25) or (jk='P' and umur >= 20) then
dbms_output.put_line('buruan nikah bisi expired');
elsif (jk = 'L' and umur < 25) or (jk='P' and umur < 20) then
dbms_output.put_line('belajar dulu yg bener');
end if;
end;
/
Insert,Update, Delete in oracle
Standard operation of a database is to insert, delete and update. All three are commonly called DML stands for Data Manipulation Language. SQL is a standard language for database processing. Of course, any use Oracle-SQL, just that there are some characteristics that are different from standard SQL.
Once we started discussing the "Try-try" Oracle, then we have a user that is a separate user called TEST. Please you enter the page or go to the Oracle XE SQL + (if you install another version of the oracle, for example: 8i, 9i, 10g, and you also have to include the value hostring / TNSNAMES your database) and login with the user, namely:
User | TEST |
Password | test |
INSERT
Insert is used to enter data into a table in a user (schema) specific.
Insert syntax can be written as follows:
Insert syntax can be written as follows:
INSERT INTO [nama_user].[nama_table] ([nama_kolom1], [nama_kolom2], . . .) VALUES ([nilai1], [nilai2], . . .); |
Keterangan :
nama_user | : | Nama user atau nama schema ketika login |
nama_tabel | : | Nama tabel yang terdapat pada user (schema) tersebut |
nama_kolom | : | Nama kolom yang akan diisi data pada [nama_tabel] |
nilai | : | Nilai yang akan diisikan pada [nama_kolom], mis : [nilai1] akan diisikan ke dalam [nama_kolom1], [nilai2] akan diisikan ke dalam [nama_kolom2] |
UPDATE
Update is used to change the data in a table in a user (schema) on the basis of certain specific conditions. SyntaxUpdate can be written as follows:
UPDATE [nama_user].[nama_table]SET [nama_kolom1] = [nilai1], [nama_kolom2] = [nilai2], [nama_kolom3] = [nilai3], . . . WHERE [kondisi_update]; |
Keterangan :
nama_user | : | Nama user atau nama schema ketika login |
nama_tabel | : | Nama tabel yang terdapat pada user (schema) tersebut |
nama_kolom | : | Nama kolom yang akan diisi data pada [nama_tabel] |
nilai | : | Nilai yang akan diisikan pada [nama_kolom] |
kondisi_update | : | Sebuah kondisi yang yang menyaring (filter) record-record mana saja yang akan di update |
DELETE
Delete is used to erase data on a table in a user (schema) under certain specific conditions. SyntaxDelete can be written as follows:
DELETE [nama_user].[nama_table]WHERE [kondisi_delete]; |
Keterangan :
nama_user | : | Nama user atau nama schema ketika login |
nama_tabel | : | Nama tabel yang terdapat pada user (schema) tersebut |
kondisi_delete | : | Sebuah kondisi yang yang menyaring (filter) record-record mana saja yang akan di delete |
Before reading the example below, a good idea to first read the article Create Table-Teaching and Learning System - (Analysis & Design). The article will help you to understand the examples given, because the tables used are based on case studies.
Insert :
INSERT INTO TEST.MURID ( NIS, NAMA, TGL_LAHIR, JENIS_KELAMIN, ALAMAT, ORTU) VALUES ( ’000001′, ‘MUKHTARUL UMAM’, TO_DATE(’23-04-1993′,‘DD-MM-YYYY’), ‘L’, ‘JL. P. DIPENOGORO, TEGAL’, ‘SULAIMAN’); |
Update :
UPDATE TEST.MURID SET NAMA = ‘MUKHTARUL UMAM SHOLEH’, TGL_LAHIR = TO_DATE(’25-04-1993′,‘DD-MM-YYYY’) WHERE NIS = ’000001′; |
Delete :
DELETE TEST.MURID WHERE NIS = ’000001′; |
NB :
· If you want to change a database kept by the end of each DML syntax to execute COMMIT;
· If companies do not want to keep the alias want restored then end with the execution ROLLBACK;
Langganan:
Postingan (Atom)
Diberdayakan oleh Blogger.



