develop:perl:mssql
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판 |
develop:perl:mssql [2011/11/14 10:15] – [Example] starlits | develop:perl:mssql [2025/10/03 22:30] (현재) – 바깥 편집 127.0.0.1 |
---|
====== Debian Linux에서 MS SQL Server 접근하기 ====== | ====== Perl을 이용하여 MS SQL Server 연동하기 ====== |
| |
===== Installation ===== | ===== Installation ===== |
| |
===== 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 연동하기]] 도 참조해 보자. |
| |
| |
===== 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 · 마지막으로 수정됨: (바깥 편집)