12주-proc.PDF

Similar documents
13주-14주proc.PDF

강의10

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

歯sql_tuning2

6주차.key

MySQL-Ch10

10.ppt

MPLAB C18 C

untitled

歯PLSQL10.PDF

초보자를 위한 C++

목차 BUG offline replicator 에서유효하지않은로그를읽을경우비정상종료할수있다... 3 BUG 각 partition 이서로다른 tablespace 를가지고, column type 이 CLOB 이며, 해당 table 을 truncate

Microsoft Word - ProC3.doc

8 장데이터베이스 8.1 기본개념 - 데이터베이스 : 데이터를조직적으로구조화한집합 (cf. 엑셀파일 ) - 테이블 : 데이터의기록형식 (cf. 엑셀시트의첫줄 ) - 필드 : 같은종류의데이터 (cf. 엑셀시트의각칸 ) - 레코드 : 데이터내용 (cf. 엑셀시트의한줄 )

제목을 입력하세요.

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

Sena Technologies, Inc. HelloDevice Super 1.1.0

목차 BUG 문법에맞지않는질의문수행시, 에러메시지에질의문의일부만보여주는문제를수정합니다... 3 BUG ROUND, TRUNC 함수에서 DATE 포맷 IW 를추가지원합니다... 5 BUG ROLLUP/CUBE 절을포함하는질의는 SUBQUE

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

PowerPoint 프레젠테이션

Microsoft PowerPoint - PL_03-04.pptx

CD-RW_Advanced.PDF

10.

untitled

untitled

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

1

MS-SQL SERVER 대비 기능


Chap7.PDF

Interstage5 SOAP서비스 설정 가이드

最即時的Sybase ASE Server資料庫診斷工具

PowerPoint 프레젠테이션

歯815설치1.PDF

PowerPoint 프레젠테이션

목차 BUG DEQUEUE 의 WAIT TIME 이 1 초미만인경우, 설정한시간만큼대기하지않는문제가있습니다... 3 BUG [qp-select-pvo] group by 표현식에있는컬럼을참조하는집합연산이존재하지않으면결괏값오류가발생할수있습니다... 4

RDB개요.ppt

K&R2 Reference Manual 번역본

chapter4

PCServerMgmt7

DocsPin_Korean.pages

슬라이드 제목 없음

untitled



Spring Boot/JDBC JdbcTemplate/CRUD 예제

Microsoft PowerPoint - 10Àå.ppt

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

Microsoft Word - [Unioneinc] 특정컬럼의 통계정보 갱신_ _ldh.doc

02 C h a p t e r Java

PowerPoint Presentation

Microsoft Word - SQL튜닝_실습교재_.doc

LXR 설치 및 사용법.doc

Chap06(Interprocess Communication).PDF

chap7.key

,,,,,, (41) ( e f f e c t ), ( c u r r e n t ) ( p o t e n t i a l difference),, ( r e s i s t a n c e ) 2,,,,,,,, (41), (42) (42) ( 41) (Ohm s law),

90

歯9장.PDF

PowerPoint 프레젠테이션

ETL_project_best_practice1.ppt

Something that can be seen, touched or otherwise sensed

교육2 ? 그림

Orcad Capture 9.x

[ 목차 ] 5.1 데이터베이스프로그래밍개념 5.2 T-SQL T-SQL 문법 5.3 JAVA 프로그래밍 2

untitled

C++-¿Ïº®Çؼ³10Àå

ALTIBASE HDB Patch Notes

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

기타자료.PDF

슬라이드 1

hlogin7

01Àå

MAX+plus II Getting Started - 무작정따라하기

03장.스택.key

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

목 차

Chap04(Signals and Sessions).PDF

sms_SQL.hwp

Solaris Express Developer Edition

untitled

PowerPoint 프레젠테이션

Microsoft PowerPoint APUE(Intro).ppt

hd1300_k_v1r2_Final_.PDF

chap10.PDF

No Slide Title

T100MD+

01-OOPConcepts(2).PDF

untitled

1217 WebTrafMon II

세미나(장애와복구-수강생용).ppt

SRC PLUS 제어기 MANUAL

본 강의에 들어가기 전

DE1-SoC Board

FlashBackt.ppt

歯처리.PDF

untitled

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,.,,,,,,,,,,,,.,...,. U.S. GOVERNMENT END USERS. Oracle programs, including any oper

Microsoft Word - 05_SUBPROGRAM.doc

10주차.key

Transcription:

12 : Pro*C/C++ 1 C/C++, Cobol, Fortran, Ada, Pascal 3GL SQL Pre-Compiler,, SQL PL/SQL C Pro*C Pro*C C++ Oracle 8 ProC/C++ Pro*C/C++ 11 Pro*C, Pro C, C/C++ Pro C / cc gcc, C++ Pro*C SQL ANSI SQL 8, ANSI SQL DBMS 111 Pro *C Pro *C C Pro *C 1 : Pro *C 2 Pro *C : Pro *CSQL C/C++ Pro *C 3 C : C/C++ C Pro*C 1

(library) Pro*C OCI(Oracle Call Interface) Pro*C, Pro*C SQL, C 112 Relink makefile, $ORACLE_HOME/precomp/lib/ins_precompmk Relink make $ make -f ins_precompmk relink EXENAME=executable $ORACLE_HOME/precomp/lib $ORACLE_HOME/bin $ORACLE_HOME/bin, : $ make -f ins_precompmk executable Pro*C/C++ Object Type Translator Proc Ott, Pro*C/C++ relink, : $ cd $ORACLE_HOME/precomp/lib $ make -f ins_precompmk relink EXENAME=proc 113 $ORACLE_HOME/precomp/admin cfg Pro*C/C++ v805 Object Type Translator v805 pcscfgcfg ottcfgcfg 114 C, (subprogram) "No such user exit" iapxtb 2

(debugger) ireclen and oreclen The ireclen oreclen 12 Pro*C/C++ Pro*C/C++ release 805, $ORACLE_HOME/precomp/doc/proc2/readmedoc README 121 Pro*C/C++ $ORACLE_HOME/precomp/admin/pcscfgcfg 122 Pro*C/C++ Pro*C/C++, Oracle8 Installation Guide for LINUX Chapter1 123 Demo (Demonstration Programs) Pro*C/C++ Demo 3 Demo : C, C++ Object Program - Oracle8 Demo $ORACLE_HOME/precomp/demo/proc, TIGER SCOTT $ORACLE_HOME/sqlplus/demo/demobldsql Demo $ORACLE_HOME/precomp/demo/proc/demo_procmk makefile Demo, sample1 Demo, link $ make -f demo_procmk sample1, $ make -f demo_procmk build OBJS=sample1o EXE=sample1 $ORACLE_HOME/lib/libclntshso link Pro*C/C++ C Demo, : $ make -f demo_procmk samples Pro*C/C++ C++ Demo, : $ make -f demo_procmk cppsamples Pro*C/C++ Object Demo, : 3

$ make -f demo_procmk object_samples Demo $ORACLE_HOME/precomp/demo/sql SQL Demo, SQL script make RUNSQL=run, calldemo Demo $ORACLE_HOME/precomp/demo/sql/calldemosql : $ make -f demo_procmk calldemo RUNSQL=run, Object Demo SQL $ make -f demo_procmk object_samples RUNSQL=run SQL 124 (User Programs) $ORACLE_HOME/precomp/demo/proc/demo_procmk makefile demo_procmk link : $ make -f demo_procmk target OBJS="objfile1 objfile2 " \ EXE=exename, Pro*C/C++ myprogpc myprog C link : $ make -f demo_procmk build OBJS=myprogo EXE=myprog C link : $ make -f demo_procmk build_static OBJS=myprogo EXE=myprog C++ client shared library link : $ make -f demo_procmk cppbuild OBJS=myprogo EXE=myprog C++ link : $ make -f demo_procmk cppbuild_static OBJS=myprogo EXE=myprog LINUX 13 131 Oracle Call Interface Oracle Call Interface (OCI), 4

Oracle8 Installation Guide for LINUX Chapter 1 132 Demo OCI Demo Demo C, C++ 2 Demo $ORACLE_HOME/rdbms/demo Demo TIGER SCOTT $ORACLE_HOME/sqlplus/demo/demobldsql Demo $ORACLE_HOME/rdbms/demo/demo_rdbmsmk makefile, cdemo1, link : $ make -f demo_rdbmsmk cdemo1, : $ make -f demo_rdbmsmk build OBJS=cdemo1o EXE=cdemo1 $ORACLE_HOME/lib/libclntshso client shared library link OCI C Demo : $ make -f demo_rdbmsmk demos OCI C++ Demo : $ make -f demo_rdbmsmk c++demos Note: C++ link : ld: fatal: library -lsunmath: not found ld: fatal: library -lc: not found ld: fatal: library -lc_mtstubs: not found ld: fatal: library -lcx: not found LD_LIBRARY_PATH Demo $ORALCE_HOME/rdbms/demo SQL, SQL sql, oci02 SQL oci02sql SQL 133 (User Programs) $ORACLE_HOME/rdbms/demo/demo_rdbmsmk demo_rdbmsmk link : $ make -f demo_rdbmsmk target OBJS="objfile1 objfile2 " \ EXE=exename makefile 5

, myprogc C myprog : C client shared library link : $ make -f demo_rdbmsmk build OBJS=myprogo EXE=myprog C link : $ make -f demo_rdbmsmk build_static OBJS=myprogo EXE=myprog myproccc C++ myprog : C++ client shared library link : $ make -f demo_rdbmsmk buildc++ OBJS=myprogo EXE=myprog C++ link : $ make -f demo_rdbmsmk buildc++_static OBJS=myprogo EXE=myprog 14 Oracle Link Makefile 141 Makefiles(Custom Makefiles) demo_productmk makefiles link makefile makefile : symbol link, sms link line : 1 A B, B A 2 Solaris linker one-pass linker linker link line point link line, link line ddemo_productmk makefile 142 Undefined Symbols link symbol : $ make -f demo_procmk sample1 Undefined first referenced symbol in file sqlcex sample1o 6

sqlglm sample1o ld: fatal: Symbol referencing errors No output written to sample1 linker symbol link line object linker object symfind sqlcex symbol symfind : $ symfind sqlcex SymFind - Find Symbol <sqlcex> in <**>a, o, so ------------------------------------------------------ Command: /u01/app/oracle/product/805/bin/symfind sqlcex Local Directory: /u01/app/oracle/product/805 Output File: Note: (none) I do not traverse symbolic links Use '-v' option to show any symbolic links Locating Archive and Object files [11645] 467572 44 FUNC GLOB 0 8 sqlcex ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /lib/libclntshso [35] 0 44 FUNC GLOB 0 5 sqlcex ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /lib/libsqla 143 Thread Support, (multi-threaded applications) 15 Static Dynamic Linking OCI, link link, object link, link, (run-time) link link link : 1 : 2 : (ie, the in-memory copy) 7

151 (Oracle shared library) $ORACLE_HOME/lib/libclntshso link demo_productmk makefile, (runtime loader) LD_LIBRARY_PATH, LD_LIBRARY_PATH % sample1 ldso1: sample1: fatal: libclntshso10: can't open file: errno=2 Killed LD_LIBRARY_PATH : % setenv LD_LIBRARY_PATH $ORACLE_HOME/lib, SQL*Plus Recovery Manager, oracle % cd $ORACLE_HOME/rdbms/lib % make -f ins_rdbmsmk client_sharedlib 16 Signal Handlers 8 (two-task communication) signal handler 161 Signals Signal 8 (two-task communication) signal : SIGCONT SIGINT SIGPIPE oracle signal(out-of-band breaks) pipe tow-task driver two-task driver SIGINT oracle ; (end-of-file) pipe driver pipe,, SIGPIPE signal (Writing) SIGPIPE oracle 8

SIGCLD SIGTERM SIGIO SIGURG pipe driver SIGCLD SIGPIPE, oracle oracle, LINUX SIGCLD ( wait() signal handler ) SIGCLD oracle, oracle pipe driver [Ctrl]+[c] SIGTERM ; oracle Oracle Net8 protocol adapters oracle signal(out-of-band breaks) Oracle Net8 TCP/IP driver signal signal Pro*C SIGCLD ( SIGCHLD) SIGPIPE signal handler osnsui() SIGINT multiple signal handler signal signal the oracle process, multiple signal handler 162 Signal signal catching SIGINT signalcatching osnsui() osncui() /* */ word osnsui( /*_ word *handlp, void (*astp), char * ctx, _*/) /* ** osnsui: ** handling procedure astp ** (^C ) ctx astp ** handler *handlp osncui ** handler ** osncui ** */ /* */ word osncui( /*_ word handle _*/ ); /* ** osncui : ** handler osnsui handle ** aksdir */ osnsui() osncui() : 9

/* ** handler */ void sig_handler() { main(argc, argv) int arc; char **argv; { int handle, err; /* */ if (err = osnsui(&handle, sig_handler, (char *) 0)) { /* 0, */ /* */ if (err = osncui(handle)) { /* 0, */ 17 XA Functionality XA TP- link line TP- (ax_reg ax_unreg symbol ) link XA (Oracle XA switch xaoswd) Oracle8 Oracle7 716 XA ( 73 XA ) 716 XA TP- XA Oracle8 XA link Oracle8 XA $ORACLE_HOME/lib/libclntshso $ORACLE_HOME/lib/libclienta 10

2 Embeded SQL Pro*C C/C++ Embedded SQL, SQL INSERT, DELETE, UPDATE SQL C 21 Pro*C SQL Pro*C SQL SQL SQL SQL*Plus Pro*C SQL DDL(Data Definition Language) : ALTER, ANALYZE, AUDIT, COMMENT, CREATE, DROP, GRANT, NOAUDIT, RENAME, REVOKE, TRUNCATE DML(Data Manipulation Language) : DELETE, INSERT, SELECT, UPDATE, EXPLAIN PLAN, LOCK TABLE : ALTER SESSION, SET ROLE : ALTER SYSTEM : COMMIT, ROLLBACK, SAVEPOINT, SET TRANSACTION SQL Pro*C EXEC SQL, (:) / *EXEC SQL */ EXEC SQL COMMIT WORK RELEASE; EXEC SQL Pro*C SQLLIB C 22 Embeded SQL Embeded SQL,, SQL,, Pro*C, emp emp empno,ename,sal deptno #include<stdioh> /* */ 11

EXEC SQL BEGIN DECLARE SECTION; VARCHAR user_id[20]; VARCHAR passwd[20]; int emp_number; VARCHAR emp_name[20]; int emp_dept; float emp_salary; EXEC SQL END DECLARE SECTION; /* */ EXEC SQL INCLUDE SQLCA; /* */ main() { printf("\n Enter User ID :"); scanf("%s", iser_idarr); printf("\n Enter Passward :"); scanf("%s", passwdarr); iuser_idlen = strln(user_isarr); passwdlen = strln(passwdarr); /* */ EXEC SQL CONNECT :user_id IDENTIFIED BY :passwd; if (sqlcasqlcode < 0) { printf("\n@s", sqlcasqlerrmsqlerrmc); EXEC SQL ROLLBACK WORK RELEASE; exit(1); else { printf("\nconnected to Oracle"); EXEC SQL COMMIT WORK RELEASE; getdata(); exit(0); void getdata() { 12

printf("\n Enter Employee Number to Query:"); scanf("%d\n", emp_number); /* */ EXEC SQL SELECT ename INTO :emp_name FROM emp WHERE emp_no =: emp_number; EXEC SQL SELECT deptno INTO :emp_dept FROM emp WHERE dept_no =: emp_number; EXEC SQL SELECT sql INTO :emp_salary FROM emp WHERE sal =: emp_number; printf("\n Emplyoee %d :", emp_number); printf("\n Name : %s", emp_namearr); printf("\n Salary : %f", emp_salary); printf("\n Dept : %d", emp_dept); C C SQL SQL C/C++ SQL EXEC SQL, SQL SQL PL/SQL 221 SQL, BEGIN DECLARE SECTION END DECLARE SECTION, VARCHAR Pro*C struct { short len; char arr[len]; Pro*C VARCHAR VARCHAR // EXEC SQL BEGIN DECLARE SECTION; VARCHAR user_id[20]; VARCHAR passwd[20]; int emp_number; VRCHAR emp_name[20]; int emp_dept; real emp_salary; 13

EXEC SQL END DECLARE SECTION; 222 SQLCA // EXEC SQL INCLUDE SQLCA; 223 CONNECT Pro*C SQL, CONNECT :' VACHAR arr len scanf arr len // printf("\n Enter User ID :"); scanf("%s", iser_idarr); printf("\n Enter Passward :"); scanf("%s", passwdarr); iuser_idlen = strln(user_isarr); passwdlen = strln(passwdarr); EXEC SQL CONNECT :user_id IDENTIFIED BY :passwd; 224 Pro*C EXEC SQL 0, sqlerrm sqlcasqlerrmsqlerrmc, ROOBACK WORK RELEASE, COMMIT WORK RELEASE (commit), // if (sqlcasqlcode < 0) { printf("\n@s", sqlcasqlerrmsqlerrmc); EXEC SQL ROLLBACK WORK RELEASE; exit(1); 14

else { printf("\nconnected to Oracle"); EXEC SQL COMMIT WORK RELEASE; getdata(); exit(); 225 SQL,, SELECT, EXEC SQL (:) // void getdata() { printf("\n Enter Employee Number to Query:"); scanf("%d\n", emp_number); /* */ EXEC SQL SELECT ename INTO :emp_name FROM emp WHERE emp_no =: emp_number; EXEC SQL SELECT deptno INTO :emp_dept FROM emp WHERE dept_no =: emp_number; EXEC SQL SELECT sql INTO :emp_salary FROM emp WHERE sal =: emp_number; printf("\n Emplyoee %d :", emp_number); printf("\n Name : %s", emp_name); printf("\n Salary : %s", emp_salary); printf("\n Dept : %s", emp_dept); 23 Pro*C Pro*C, Pro*C Pro*C empdatapc $ proc empdata Pro*C pc Pro*C pc, 15

Pro*C INAME, $ proc INAME = empdata Pro*C,, Pro*C Pro*C, Pro*C Pro*C? C /? $ proc? Pro*C pmscfgh proc 231 Pro*C, (1) INAME :, ` INAME = filename filename Pro*C INAME pc (2) CPP_SUFFIX : CODE CPP Pro*C, code = CPP CPP_SUFFIX = gcc gcc CPP_SUFFIX (3) ONAME : Pro*C ONAME = output_filename output_filename, c CPP_SUFFIX, ONAME ONAME proc sample oname = sample001c ONAME c proc sample samplec 16

(4) CONFIG :, CONFIG, filename CONFIG = filename (5) INCLUDE : Include, INCLUDE = pathname, INCLUDE =(pathname, path_name,) Include () Include, Pro *C Include 1 SYS_INCLUDED 2 3 4 INCLUDE, sqlcah Pro *C Include Pro *C, Include (6) SYS_INCLUDE :, SYS_INCLUDE = path_name path_name (7) LNAME : Pro *C,,, LNAME = listing_filename listing_filenaem, lis (8) LTYPE :, LTYPE = NONE, SHORT, LONG, LONG, SHORT NONE (9) COM_CHARSET :,, MULTI_BYTE, MULTI_BYTE SINGLE_BYTE MULTI_BYTE COMP_CHARSET = MULTI_BYTE COMP_CHARSET MULTI_BYTE Pro*C MULTI_BYTE MULTI_BYTE (10) CODE :,, ANSI_C,KR_C CPP KR_C CODE = ANSI_C C ANSI_C ANSI_C 17

KR_C CPP C++ (11) DBMS : SQL, DBMS = NATIVE V6, V7, PRO *C SQL 6 NATIVE (12) ERRORS :, YES,NO YES ERRORS = YES, NO (13) FIPS : ANSI SQL SQL, FIPS = YES, SQL89, NO, NONE NONE FIPS YES, SQL, Pro *c Pro *c SQL 1 SQLCA, ORACA, SQLDA, 2 Embedded PL/SQL 3 DATE,NUMBER, RA, LONGRAW, VARCHAR2 4 CONNECT (14) MAXOPENCURSORS : Pro *C OPENCURSOR, 10 MAXOPENCURSORS = (15) ORACA : ORACA = YES, NO NO, YES EXEC SQL INCLUDE ORACA #INCLUDE oracah (16) PARSE : PRO *C, PARSE = FULL, PARTIAL, NONE PARSE FULL, FULL C C++ NONE, PARATIAL (17) SELECT_ERROW : SELECT,, YES SELECT_ERROW = YES, NO 3 18