문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
| develop:perl:oracle [2007/08/18 20:27] – 새로 만듬 59.9.215.67 | develop:perl:oracle [2025/10/03 22:30] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== Perl + Oracle 연동 ====== | ====== Perl + Oracle 연동 ====== | ||
| - | <code perl> | + | |
| + | ===== 사전작업 ===== | ||
| + | - apt-get 을 이용하여 패키지 설치 < | ||
| + | # apt-get install libdbi-test-perl libdbix-abstract-perl make | ||
| + | </ | ||
| + | # apt-get install python3 python-dev python3-dev \ | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ===== DBD::Oracle 설치 ===== | ||
| + | - http:// | ||
| + | - http:// | ||
| + | - 컴파일해서 설치한다. < | ||
| + | $ perl Makefile.PL | ||
| + | $ make | ||
| + | $ sudo make install | ||
| + | </ | ||
| + | |||
| + | ===== Oracle Database Instant Client Installation ===== | ||
| + | - [[dbms: | ||
| + | ===== sample code test ===== | ||
| + | - <code perl> | ||
| # | # | ||
| # | # | ||
| 줄 13: | 줄 36: | ||
| ##################### | ##################### | ||
| my $hostip | my $hostip | ||
| - | my $username = "beflydba"; | + | my $username = "adminuser"; |
| - | my $password = "ahdEkd"; | + | my $password = "password"; |
| - | my $sid = "SOAF1"; | + | my $sid = "SOA01"; |
| my $dsn = " | my $dsn = " | ||
| my %attr = ( RaiseError => 1, AutoCommit => 0 ); | my %attr = ( RaiseError => 1, AutoCommit => 0 ); | ||
| 줄 24: | 줄 47: | ||
| #my $dbh = DBI-> | #my $dbh = DBI-> | ||
| - | my $que = " | + | my $que = " |
| - | my $itemcode; | + | my $table_name; |
| # | # | ||
| my $sth = $dbh-> | my $sth = $dbh-> | ||
| $sth-> | $sth-> | ||
| - | while( ($itemcode) = $sth-> | + | while( ($table_name) = $sth-> |
| - | print "select * from tb_studyunit where itemcode=$itemcode ;\n"; | + | print "$table_name\n"; |
| } | } | ||
| + | |||
| $sth-> | $sth-> | ||