Oracle Procedure Print 찍기…

Oracle Procedure 를 테스트할 때, 내부 변수들에 할당된 값을 확인해야할 때가 있다.

이럴 때, 다음의 구문을 사용하면 확인이 가능하다.

SQL> set serveroutput on format wrap
SQL> declare
  2      x varchar2(30) := 'My name is neo.';
  3  begin
  4      dbms_output.enable(1000000);
  5      dbms_output.put_line ('The value of variable "x" is: ['||x||']');
  6* end;
SQL> 
/The value of variable "x" is: [My name is neo.]
참조 : www.dbforums.com/oracle/1644155-how-print-value-variable-used-oracle-procedure.html
참조 : http://stackoverflow.com/questions/9519510/how-to-printf-in-oracle-stored-procedure-for-debugging-purposes
참조 : http://dscythe.tistory.com/69
참조 : http://stackoverflow.com/questions/7352366/oracle-stored-procedure-printing-varchar2-output-variable

밤 늦게 엎드려서 컴질하는 재미..

잠 들기 전, 이불쓰고 베게을 턱에 괴고, 엎드려서 넷북으로 이리저리 돌려보는 재미에 빠졌다!!!
컴퓨터 하다가 피곤하면 그대로 화면을 탁! 덮고 그대로 잠자기!!

ㅎㅎㅎㅎㅎ

매일매일 뭔가 재밌는 것들을 해보자!

엎드려서 궁리하고! 코딩하고! 고민하고! ㅋㅋ

신난다~~~ ㅎㅎ

 

unixodbc 설정…

기존에 Windows 환경에서만 적용되던 모듈을 Unix로 컨버팅해야하는 경우가 생겼다.

대부분의 소스는 이미 Unix 환경에서 사용이 가능하도록 컨버팅이 되어 있었지만, 단하나… ODBC와 관련된 부분이 있었다.

이걸 어떻게 해야하나…

시간은 없었고..

결론은 unixodbc를 사용하고 소스는 원본을 최대한 손을 안대는 방향으로 하기로 했다.

아래의 환경에서 작업을 구성했다.

작업 환경

OS : HP-UX B.11.31 U ia64

Compiler : HP C/aC++ B3910B A/06.27

unixodbc : unixODBC-2.3.1

freetds : freetds-0.91

unixodbc 컴파일

unixodbc 사이트에 들어가서 최신의 odbc package(unixODBC-2.3.1)을 내려받아 설치한다.

http://www.unixodbc.org/

freetds 컴파일

freetds 사이트에 들어가서 최신의 freetds package(stable 버전..)을 내려받아 설치한다.

http://freetds.schemamania.org/index.html

완성된 설정 내용

/etc/odbc.ini

[TEST]

Driver = FreeTDS

Description = MSSQL Setting..

Servername = ODBC_TEST

Trace = No

Database = 4.2

Port = 1433

/etc/odbcinst.ini

[FreeTDS]

Description = MSSQL Setting..

Driver = /usr/local/freetds/lib/libtdsodbc.so

UsageCount = 1

참고 사이트들..

참고 : http://dirk.net/2010/09/18/sql-server-with-freetds-unicode-data-error/

참고 : http://stackoverflow.com/questions/2922829/freetds-and-unixodbc-character-converting

참고 : http://blog.naver.com/PostView.nhn?blogId=bebas&logNo=80118437810

참고 : http://stackoverflow.com/questions/3261909/build-32bit-on-64-bit-linux-using-a-configure-script

참고 : http://h30499.www3.hp.com/t5/Languages-and-Scripting/freeTDS-on-HP-UX-11-31/td-p/4671681

참고 : http://www.freetds.org/userguide/odbcdiagnose.htm

참고 : http://kldp.org/node/51717