사용자 도구

사이트 도구


develop:perl:oracle

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
develop:perl:oracle [2017/05/29 15:12]
starlits [사전작업]
develop:perl:oracle [2017/05/29 17:27]
starlits [DBD::Oracle 설치]
줄 11: 줄 11:
 </code> </code>
  
 +===== DBD::Oracle 설치 =====
 +  - http://cpan.org 에서 DBD::Oracle 모듈을 설치한다. 
 +  - http://search.cpan.org/~pythian/DBD-Oracle-1.74/lib/DBD/Oracle.pm 
 +  - 컴파일해서 설치한다. <code>
 +$ perl Makefile.PL
 +$ make
 +$ sudo make install 
 +</code>
 +
 +===== Oracle Database Instant Client Installation =====
 +  - [[dbms:oracle:admin:instantclient | Oracle Database Instant Client Installation ]] 을 참고한다. 
 ===== sample code test ===== ===== sample code test =====
   - <code perl>   - <code perl>
줄 36: 줄 47:
 #my $dbh = DBI->connect ("DBI:Oracle:host=$hostip;sid=$sid", $username, $password, \%attr); #my $dbh = DBI->connect ("DBI:Oracle:host=$hostip;sid=$sid", $username, $password, \%attr);
  
-my $que = "select itemcode from tb_item where rownum < 5"; +my $que = "select table_name from tabs where rownum < 5"; 
-my $itemcode;+my $table_name;
 # #
 my $sth = $dbh->prepare($que); my $sth = $dbh->prepare($que);
 $sth->execute() || die $sth->errstr; $sth->execute() || die $sth->errstr;
-while( ($itemcode) = $sth->fetchrow() ) { +while( ($table_name) = $sth->fetchrow() ) { 
-    print "select * from tb_studyunit where itemcode=$itemcode ;\n";+    print "$table_name\n";
 } }
 +
 $sth->finish(); $sth->finish();
  
develop/perl/oracle.txt · 마지막으로 수정됨: 2017/05/29 17:27 저자 starlits