사용자 도구

사이트 도구


develop:perl:mssql

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
develop:perl:mssql [2011/11/14 10:15]
starlits [Example]
develop:perl:mssql [2011/11/14 10:55] (현재)
starlits [Perl을 이용하여 MS SQL Server 활용하기]
줄 1: 줄 1:
-====== Debian Linux에서 MS SQL Server 접근하기 ======+====== Perl을 이용하여 MS SQL Server 연동하기 ======
  
 ===== Installation ===== ===== Installation =====
줄 42: 줄 42:
  
 ===== Example ===== ===== Example =====
-  * [[develop:perl:oracle| DBI를 이용하여 Oracle 연동하기]] 를 참조한다.+  - 샘플소스를 만들어보자 <code perl> 
 +#!/usr/bin/perl 
 + 
 +use DBI; 
 + 
 +$dsn = 'DBI:Sybase:server=admindb'; 
 + 
 +my $dbh = DBI->connect($dsn, "mssql_username", "mssql_password"); 
 +  die "unable to connect to server $DBI::errstr" unless $dbh; 
 + 
 +$dbh->do("use mssql_database"); 
 + 
 +$query = "SELECT FROM scott"; 
 +$sth = $dbh->prepare ($query) or die "prepare failed\n"; 
 +$sth->execute( ) or die "unable to execute query $query   error $DBI::errstr"; 
 + 
 +while ( @first = $sth->fetchrow_array ) { 
 +   foreach $field (@first) { 
 +      print "field: $field\n"; 
 +   } 
 +
 + 
 +$dbh->disconnect; 
 +</code> 
 +  - [[develop:perl:oracle| DBI를 이용하여 Oracle 연동하기]] 도 참조해 보자.
  
  
줄 54: 줄 78:
 ===== Reference ===== ===== Reference =====
   - http://www.freetds.org/   - http://www.freetds.org/
 +  - http://www.perlmonks.org/?node_id=392385
   - http://www.peppler.org/freeware/dbd-sybase.html   - http://www.peppler.org/freeware/dbd-sybase.html
  
  
  
develop/perl/mssql.1321233316.txt.gz · 마지막으로 수정됨: 2011/11/14 10:15 저자 starlits