사용자 도구

사이트 도구


develop:perl:mssql

차이

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

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
develop:perl:mssql [2011/11/14 10:19] – [Example] starlitsdevelop:perl:mssql [2025/10/03 22:30] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
-====== Debian Linux에서 MS SQL Server 접근하기 ======+====== Perl을 이용하여 MS SQL Server 연동하기 ======
  
 ===== Installation ===== ===== Installation =====
줄 50: 줄 50:
  
 my $dbh = DBI->connect($dsn, "mssql_username", "mssql_password"); my $dbh = DBI->connect($dsn, "mssql_username", "mssql_password");
-die "unable to connect to server $DBI::errstr" unless $dbh;+  die "unable to connect to server $DBI::errstr" unless $dbh;
  
 $dbh->do("use mssql_database"); $dbh->do("use mssql_database");
줄 57: 줄 57:
 $sth = $dbh->prepare ($query) or die "prepare failed\n"; $sth = $dbh->prepare ($query) or die "prepare failed\n";
 $sth->execute( ) or die "unable to execute query $query   error $DBI::errstr"; $sth->execute( ) or die "unable to execute query $query   error $DBI::errstr";
- 
-$rows = $sth->rows ; 
-print "$row rows returned by query\n"; 
  
 while ( @first = $sth->fetchrow_array ) { while ( @first = $sth->fetchrow_array ) {
줄 66: 줄 63:
    }    }
 } }
 +
 +$dbh->disconnect;
 </code> </code>
   - [[develop:perl:oracle| DBI를 이용하여 Oracle 연동하기]] 도 참조해 보자.   - [[develop:perl:oracle| DBI를 이용하여 Oracle 연동하기]] 도 참조해 보자.
develop/perl/mssql.1321233587.txt.gz · 마지막으로 수정됨: (바깥 편집)