[확장저장프로시저] 컴파일 시 에러

  • Post author:
  • Post category:
  • Post comments:0 Comments
  • Post last modified:September 22, 2004

MSSQL 까페에 내가 자문자답한 글이다. 확장저장프로시저 개발에서 맞부딪칠 수 있는 문제다. 어서 빨리 유콘이 나와서 이런 귀찮은 작업을 쉽게 할 수 있으면 좋겠다.

MSSQL2000 설치시 코드 예제를 포함해서 설치했습니다.

C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Samples\ods\xp_hello

에 보면 몇가지 예제가 깔립니다. 그중 xp_hello의 경우만 예를 들어보면,

#include

ULONG __GetXpVersion()

{
return ODS_VERSION;
}

// Use srv_paraminfo to get data type and length information.
  if (srv_paraminfo(pSrvProc, 1, &bType, &cbMaxLen, &cbActualLen,
      NULL, &fNull) == FAIL)
      {
printError (pSrvProc, “srv_paraminfo failed…”);
return (XP_ERROR);
}

등의 코드가 있습니다.

이것을 Build하려고 하면 다음과 같은 에러가 뜹니다.

‘srv_paraminfo’ undefined; assuming extern returning int

‘SRVBIGVARCHAR’ : undeclared identifier
‘SRVBIGCHAR’ : undeclared identifier
‘srv_paramsetoutput’ undefined; assuming extern returning int

src.h에 보면 확실히 위의 함수나 변수가 정의되어 있지 않습니다. 그런데 확장저장프로시저를 다룬 문서나 예제 어떤 것을 봐도 이들을 사용합니다. 도대체 어떻게 해야 되나요?

ㅠ.ㅠ

자문자답입니다.
온라인 설명서에 다음과 같이 되어 있습니다.

Set the directory for include files and library files to C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include and C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Lib, respectively.

그런데 대부분의 경우, 해당 디렉토리가 없거나 파일이 하나씩밖에 없습니다. SQL CD에 보면 x86Lib,include 디렉토리가 있는데, 이 곳에 들어있는 파일을 몽땅 위의 디렉토리에 복사해주니 문제가 해결됐습니다.

 

Author Details
Kubernetes, DevSecOps, AWS, 클라우드 보안, 클라우드 비용관리, SaaS 의 활용과 내재화 등 소프트웨어 개발 전반에 도움이 필요하다면 도움을 요청하세요. 지인이라면 가볍게 도와드리겠습니다. 전문적인 도움이 필요하다면 저의 현업에 방해가 되지 않는 선에서 협의가능합니다.
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments