은행 고객 관리 DB -3 조 - 32011771 이영철 32011405 강민재. 은행 고객 관리 DB 테이블구조 -Customer table 고객 ID( 기본키 ), 고객이름, 고객등급 ( 트리거 )

Slides:



Advertisements
Similar presentations
Data Structure Lecture-5
Advertisements

Senem Kumova Metin Spring2009 STACKS AND QUEUES Chapter 10 in A Book on C.
Transact-SQL. 1. Declare float = 10 select * from customers where discnt
PL/SQL. Introduction to PL/SQL PL/SQL is the procedure extension to Oracle SQL. It is used to access an Oracle database from various environments (e.g.
My_Demo_Test : Air –Pollution measured at certain time points in a day t0t1t2t3t
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Lecture#7 (cont’d): Rel. model - SQL part3.
Murali Mani SQL with other Programming Languages.
End of SQL: Triggers, Impedance Mismatch and Transactions February 6 th, 2004.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
SQL Keys and Constraints Justin Maksim. Key Declaration Key constraint defined within the CREATE TABLE command Key can be declared using either the PRIMARY.
COMP 5138 Relational Database Management Systems Semester 2, 2007 Lecture 8A Transaction Concept.
Database Management System LICT 3011 Eyad H. Elshami.
If () else statement, switch statement, while () loop, do…while() loop and for( ; ; ) loop 1.
SQL Constraints & Triggers May 10 th, Agenda Big picture –what are constraints & triggers? –where do they appear? –why are they important? In SQL.
Database Processing with JSP ISYS 350. Example: Enter CID in a box and retrieve the customer record.
Virtual Private Databases Dr. Gabriel. 2 Overview of Virtual Private Databases A VPD deals with data access VPD controls data access at the row or column.
Lecture 4 PL/SQL language. PL/SQL – procedural SQL Allows combining procedural and SQL code PL/SQL code is compiled, including SQL commands PL/SQL code.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
Database Programming using JSP and MySQL Byung-Hyun Ha
Database Processing with JSP ISYS 350. Example: Enter CID in a box and retrieve the customer record.
Temple University – CIS Dept. CIS331– Principles of Database Systems V. Megalooikonomou Relational Model – SQL Part II (based on notes by Silberchatz,Korth,
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Transactions1 Unit of work on a database. Transactions2 Transactions, concept Logical unit of work on the database –Examples Transfer money from bank.
1. SQL Header of tables: –Head(Custoemrs) = (cid, cname, city, discnt) –Head(Orders) = (ordno, month, cid, pid, qty, dollars) –Head(Products) = (pid, pname,
Procedure Function Trigger. create table employee ( id number, name varchar2(100), deptno number, salary float, primary key(id) ) create table deptincrease.
Advanced SQL: Cursors & Stored Procedures
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
Advanced SQL Instructor: Mohamed Eltabakh 1 Part II.
Stored Procedures Week 9. Test Details Stored Procedures SQL can call code written in iSeries High Level Languages –Called stored procedures SQL has.
Java the UML Way versjon Only to be used in connection with the book "Java the UML Way", by Else Lervik and.
ICS 321 Fall 2010 SQL in a Server Environment (i) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 11/1/20101Lipyeow.
Programmatic SQL Shaista Khan CS 157B. Topic Embedded SQL statements in high-level programming languages.
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Rel. model - SQL part3.
1 SQL Constraints and Programming. 2 Agenda Constraints in SQL Systems aspects of SQL.
Advanced SQL: Triggers & Assertions
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
Tables and Constraints Oracle PL/SQL. Datatypes The SQL Data Definition Language Commands (or DDL) enable us to create, modify and remove database data.
Constraints CSED421 Database Systems Lab. Constraints To define an integrity constraint (IC) –IC : condition that must be true for any instance of the.
Prince Sultan University Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Visual Programing SQL Overview Section 1.
Dr Gordon Russell, Napier University Unit Embedde SQL - V2.0 1 Embedded SQL Unit 5.1.
CS1010E Programming Methodology Tutorial 9 Pointers in Arrays & Structures C14,A15,D11,C08,C11,A02.
Database Processing with JSP ISYS 350. Example: Enter CID in a box and retrieve the customer record.
G. Green 1.  Options include:  Script Files  already covered  APIs  last course topic  Database-Stored Code  our focus 2.
7장 PHP와 Mysql 연동 한빛미디어(주).
1 SQL Insert Update Delete Create table Alter table.
DBMS 3. course. Reminder Data independence: logical and physical Concurrent processing – Transaction – Deadlock – Rollback – Logging ER Diagrams.
Slide 1 Chapter 7 – Part 3 Stored Procedure, Function &Trigger.
1 Dept. of CIS, Temple Univ. CIS616/661 – Principles of Data Management V. Megalooikonomou SQL (part 2) (based on slides by C. Faloutsos at CMU)
CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 29 Thanks for Lecture Slides:
Database Processing with JSP ISYS 350. Example: Enter CID in a box and retrieve the customer record.
방명록 제작. 목차  기본 레이아웃  DB 구조  방명록 구조  코드 설명  화면 설명.
App Package Folder App data Folders Local Roaming Temp Removable Storage (SD Card) Cloud Credential Locker B/ground Transfer Publishers Shared Folder.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Ch 7. Working with relational data. Transactions Group of statements executed as a group. If all statements execute successfully, changes are committed.
1 Lecture 8: SQL Programming and Transactions Friday, January 24, 2003.
Ch.2 Relational Data Model E. F. Codd (1969, 1970)
Database Processing with JSP ISYS 350. Database Applications Applications Database Server Queries/Updates Results.
(2 주차 ) Chapter 2 Database(MySQL). Database 를 사용하는 이유 - 보안성.
User-defined functions, Procedures, Triggers and Transactions
SQL: Constraints and Triggers
LINKED LISTS.
Lecture 17: Systems Aspects of SQL
TicTacToe 過三關 使用者可按 XO X char gb[3][3]; gb[0][1] gb[0][0] gb[0][2]
Chapter # 7 Introduction to Structured Query Language (SQL) Part I.
Lecture 14: XML Publishing & Storage
Character Arrays char string1[] = “first”;
Updating Databases With Open SQL
Triggers 7/11/2019 See scm-intranet.
Lecture 05: SQL Systems Aspects
Presentation transcript:

은행 고객 관리 DB -3 조 이영철 강민재

은행 고객 관리 DB 테이블구조 -Customer table 고객 ID( 기본키 ), 고객이름, 고객등급 ( 트리거 )

은행 고객 관리 DB Account table 고객 ID( 외래키 ), 고개계좌 ( 기본키 ), 현재금액

CusInfo table 고객 ID( 외래키 ), 고객계좌 ( 외래키 ), 주민등록번호, 주소, 전화 은행 고객 관리 DB

PROGRAM STRUCTURE

현재 테이블에 입력된 값

실행화면 1 프로그램시작화면 … for(j=0;j<3;j++) { printf(" 관리자 확인, 패스워드 입력 : "); for(i=0;i<4;i++) { pass[i]=getch(); printf("*"); } printf("\n"); if(strncmp(password1,pass,4)==0) break; cnt+=1; if(cnt==3) exit(1); }

실행화면 2 입금화면

실행화면 3 출금화면

실행화면 4 잔액확인

실행화면 5 계좌이체

실행화면 6 EXEC SQL DECLARE viewInfo CURSOR FOR SELECT C.id, A.accountNum, C.name, CI.jumin, CI.address, CI.phone, A.money FROM Customer C,Account A,CusInfo CI WHERE A.accountNum = CI.accountNum AND C.id = A.id ORDER BY C.name,C.id; EXEC SQL OPEN viewInfo; printf("================================== 고객 정보 ====================================\n"); printf("ID 이름 계좌번호 주민등록번호 주소 전화번호 잔액 (\\)\n"); printf("========================================================================= ======\n"); while(1) { EXEC SQL FETCH viewInfo INTO :id, :name, :accountNum, :jumin, :address, :phone, :money; if(NO_MORE_TUPLES) { break; } printf("%2d %8s %-s %s %s %s %d\n",id, name, accountNum, jumin, address, phone, money); } EXEC SQL CLOSE viewInfo;

실행화면 6 고객정보보기 (CURSOR)

뷰 (view) 생성

트리거 (TRIGGER)

트리거 (TRIGGER)- 계속

트랜잭션 (TRANSACTION)1 if(money>input_money) { money-=input_money; EXEC SQL UPDATE Account SET money = :money WHERE accountNum = :search_acc; EXEC SQL COMMIT TRAN; printf("\n** 출금 성공 **\n");

트랜잭션 (TRANSACTION)1 printf("┌──────────────────┐\n"); printf("│ 현재시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-15ld│\n",money); printf("└──────────────────┘\n"); } else { printf("\n** 잔액 부족. 출금 실패 **\n"); EXEC SQL ROLLBACK TRAN; }

트랜잭션 1 실행화면 현재 잔액보다 많은 금액을 출금액에 입력하게 되면 트랜잭션에 의해 실행이 취소된다.

트랜잭션 (TRANSACTION)2 if(mymoney>input_money) { mymoney-=input_money; money+=input_money; EXEC SQL COMMIT TRAN; EXEC SQL UPDATE Account SET money=:mymoney WHERE accountNum=:self_acc; EXEC SQL UPDATE Account SET money=:money WHERE accountNum=:search_acc; printf("\n** 계좌이체 성공 **\n");

트랜잭션 (TRANSACTION)2 printf("┌─────────────────────┐\n"); printf("│%-8s 님의 현재 잔액 : (\\) %- 11ld│\n",myname,mymoney); printf("│%-8s 님의 현재 잔액 : (\\) %- 11ld│\n",name,money); printf("└─────────────────────┘\n"); } else { printf("** 잔액 부족, 계좌이체 실패.**\n"); EXEC SQL ROLLBACK TRAN;}

트랜잭션 2 실행화면 이체할 계좌에 남아있는 금액보다 많은 금액을 이체하려고 하기때문에 트랜잭션에 의해 실행 이 취소된다.

테이블 생성 코드 CREATE TABLE Customer ( id int NOT NULL, name char(10), grade char(2), UNIQUE (id), PRIMARY KEY (id) );

테이블 생성 코드 CREATE TABLE Account ( id int, accountNum char(12) NOT NULL, money integer DEFAULT 0, UNIQUE(accountNum), PRIMARY KEY (accountNum), FOREIGN KEY (id) REFERENCES Customer(id) --ON DELETE SET NULL );

테이블 생성 코드 CREATE TABLE CusInfo ( id int, accountNum char(12), jumin char(13), address varchar(30), phone char(11) UNIQUE(jumin), FOREIGN KEY (accountNum) REFERENCES Account(accountNum) --ON DELETE SET NULL FOREIGN KEY (id) REFERENCES Customer(id) );

뷰 생성 코드 CREATE VIEW viewInfo (id, name, accountNum, jumin, address, phone, money) AS SELECT C.id, C.name, A.accountNum, CI.jumin, CI.address, CI.phone, A.money FROM Customer C,Account A,CusInfo CI WHERE A.accountNum = CI.accountNum AND C.id = A.id

트리거 생성 코드 CREATE TRIGGER superior_customer ON Account FOR UPDATE AS int = id FROM Account WHERE money >= begin UPDATE Customer SET grade = 's' WHERE end

ESQL-C 코드 #include #define MAX 100 #define NO_SQL_ERROR (SQLCODE == 0) #define NO_MORE_TUPLES (SQLCODE == 100) char password1[5]="1234"; static int rem=0; int menu();// 메뉴출력함수 void make_acc();// 계정생성함수 void deposit();// 예금 함수 void payment();// 출금 함수 void transfer();// 타인의 계좌에 송금함수 void balance();// 잔액 확인 void viewInfo();// 고객정보 보기

ESQL-C 코드 void main() { int j,i; char pass[4]; int cnt=0; EXEC SQL BEGIN DECLARE SECTION; char dbname[6]="BANK3", user[3]="sa"; EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO :dbname USER :user; for(j=0;j<3;j++) { printf(" 관리자 확인, 패스워드 입력 : "); for(i=0;i<4;i++) { pass[i]=getch(); printf("*"); } printf("\n"); if(strncmp(password1,pass,4)==0) break; cnt+=1; if(cnt==3) exit(1); } if(NO_SQL_ERROR) printf(" 은행 데이터베이스가 연결 되었습니다.\n",dbname); else { printf(" 에러가 발생했습니다 ( 에러코드 : %ld)\n",SQLCODE); exit(1); }

ESQL-C 코드 while(1) { int i=menu(); switch(i) { case 1: make_acc(); break; case 2: deposit(); break; case 3: payment(); break; case 4: balance(); break; case 5: transfer(); break; case 6: viewInfo(); break; case 7: exit(0); } EXEC SQL DISCONNECT CURRENT; }

ESQL-C 코드 int menu() { int a; printf("\n- 은행 고객관리 데이터베이스 -"); printf("\n 아래의 작업을 선택하시오.\n"); printf("\n ①. 계정생성 (Make Account)\n"); printf(" ②. 예금하기 (Make Deposit)\n"); printf(" ③. 출금하기 (Make Withdrawal)\n"); printf(" ④. 잔액확인 (Check Balance)\n"); printf(" ⑤. 송금하기 (Send Money)\n"); printf(" ⑥. 정보보기 (View All Members)\n"); printf(" ⑦. 종료하기 (Exit)\n\n"); printf(" 선택 (1-7) : "); scanf("%d",&a); fflush(stdin); return a; }

ESQL-C 코드 oid make_acc() { char ch; int i; FILE *Cnt; EXEC SQL BEGIN DECLARE SECTION; char name[10], jumin[14], address[30], phone[11], accountNum[13]; int money=0; int id=0; EXEC SQL END DECLARE SECTION; for(i=rem;i<MAX;i++) { id = rem+1; printf("[%d] 번째 고객의 실명을 입력 ( 입력취소시 ENTER 입력 ) : ",i+1); gets(name); if(strlen(name)==0) { printf(" 데이터 입력을 취소함.\n"); break;// 이름에다 공백을 입력하면 빠져나감. }

ESQL-C 코드 printf("[%d] 번째 고객의 주민 등록 번호를 입력 : ",i+1); gets(jumin); printf("[%d] 번째 고객의 주소를 입력 : ",i+1); gets(address); printf("[%d] 번째 고객의 전화 번호를 입력 : ",i+1); gets(phone); printf("[%d] 번째 고객의 계좌번호를 입력 : ",i+1); gets(accountNum); printf("[%d] 번째 고객의 처음 입금할 금액을 입력 ( 단위 :\\) : ",i+1); scanf("%d",&money); fflush(stdin); rem++; printf(" 위 사실과 동일 합니까 ?(y/n) : "); scanf("%c",&ch); fflush(stdin); if(ch =='n' || ch == 'N') { rem--; break; }

ESQL-C 코드 EXEC SQL INSERT INTO Customer(id,name) VALUES(:id,:name); if(!NO_SQL_ERROR) { printf(" 고객 테이블 입력시 에러가 발생했습니다.\n"); exit(1); } EXEC SQL INSERT INTO Account(id,accountNum,money) VALUES(:id,:accountNum,:money); if(!NO_SQL_ERROR) { printf(" 계좌 테이블 입력시 에러가 발생했습니다.\n"); exit(1); } EXEC SQL INSERT INTO CusInfo(id,accountNum,jumin,address,phone) VALUES(:id,:accountNum,:jumin,:address,:phone); if(!NO_SQL_ERROR) { printf(" 고객 정보 테이블 입력시 에러가 발생했습니다.\n"); exit(1); } printf("\n"); Cnt=fopen("Cnt","w");// 정보를 입력받은 다음부터 저장 가능하도록 fwrite(&rem,sizeof(int),1,Cnt);//count 변수를 파일로 저장한다. fclose(Cnt); }

ESQL-C 코드 void deposit() { int i; for(i=0;i<1;i++) { EXEC SQL BEGIN DECLARE SECTION; char search_acc[13]; char name[10],jumin[14]; int money,input_money; EXEC SQL END DECLARE SECTION; struct tm *ptr; time_t lt=time(NULL); ptr=localtime(&lt); printf("\n 계좌 번호 입력 : "); gets(search_acc); EXEC SQL SELECT C.name, CI.jumin, A.money INTO :name, :jumin, :money FROM Customer C,Account A,CusInfo CI WHERE CI.accountNum = :search_acc AND A.accountNum = :search_acc AND C.id=CI.id; if(NO_MORE_TUPLES) { printf("** 없는 계좌번호입니다 **\n"); break; }

ESQL-C 코드 printf("\n"); printf("┌──────────────────┐\n"); printf("│ 성명 : %-29s│\n",name); printf("│ 주민등록번호 : %-21s│\n",jumin); printf("│ 현재시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-15ld│\n",money); printf("└──────────────────┘\n"); printf("\n 입금할 금액 : "); scanf("%d",&input_money); money+=input_money; EXEC SQL UPDATE Account SET money = :money WHERE accountNum = :search_acc; printf("\n** 입금 성공 **\n"); printf("┌──────────────────┐\n"); printf("│ 현재시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-15ld│\n",money); printf("└──────────────────┘\n"); }

ESQL-C 코드 void payment() { int i; for(i=0;i<1;i++) { EXEC SQL BEGIN DECLARE SECTION; char search_acc[13]; char name[10],jumin[14]; int money,input_money; EXEC SQL END DECLARE SECTION; struct tm *ptr; time_t lt=time(NULL); ptr=localtime(&lt); printf("\n 계좌 번호 입력 : "); gets(search_acc); fflush(stdin); EXEC SQL SELECT C.name, CI.jumin, A.money INTO :name, :jumin, :money FROM Customer C,Account A,CusInfo CI WHERE CI.accountNum = :search_acc AND A.accountNum = :search_acc AND C.id=CI.id; if(NO_MORE_TUPLES) { printf("** 없는 계좌번호입니다 **\n"); break; }

ESQL-C 코드 printf("\n"); printf("┌──────────────────┐\n"); printf("│ 성명 : %-29s│\n",name); printf("│ 주민등록번호 : %-21s│\n",jumin); printf("│ 현재시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-15ld│\n",money); printf("└──────────────────┘\n"); printf("\n 출금할 금액 : "); scanf("%ld",&input_money); if(money>input_money) { money-=input_money; EXEC SQL UPDATE Account SET money = :money WHERE accountNum = :search_acc; EXEC SQL COMMIT TRAN; printf("\n** 출금 성공 **\n"); printf("┌──────────────────┐\n"); printf("│ 현재시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-15ld│\n",money); printf("└──────────────────┘\n"); } else { printf("\n** 잔액 부족. 출금 실패 **\n"); EXEC SQL ROLLBACK TRAN; }

ESQL-C 코드 void transfer() { int i; for(i=0;i<1;i++) { EXEC SQL BEGIN DECLARE SECTION; char search_acc[13],self_acc[13]; char name[10],myname[10],jumin[14],myjumin[14]; int money,mymoney,input_money; EXEC SQL END DECLARE SECTION; struct tm *ptr; time_t lt=time(NULL); ptr=localtime(&lt); printf(" 이체받을 계좌번호 입력 : "); gets(search_acc); EXEC SQL SELECT C.name, CI.jumin, A.money INTO :name, :jumin, :money FROM Customer C,Account A,CusInfo CI WHERE CI.accountNum = :search_acc AND A.accountNum = :search_acc AND C.id=CI.id; if(NO_MORE_TUPLES) { printf("** 없는 계좌번호입니다 **\n"); break; }

ESQL-C 코드 printf("┌────────────────────┐\n"); printf("│ 이체받을 고객의 성명 : %-17s│\n",name); printf("│ 주민등록번호 : %-25s│\n",jumin); printf("│ 현재 시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-19ld│\n",money); printf("└────────────────────┘"); printf("\n 이체할 고객의 계좌번호를 입력 : "); gets(self_acc); EXEC SQL SELECT C.name, CI.jumin, A.money INTO :myname, :myjumin, :mymoney FROM Customer C,Account A,CusInfo CI WHERE CI.accountNum = :self_acc AND A.accountNum = :self_acc AND C.id=CI.id; if(NO_MORE_TUPLES) { printf("** 없는 계좌번호입니다 **\n"); break; }

ESQL-C 코드 printf("┌────────────────────┐\n"); printf("│ 이체할 고객의 성명 : %-18s │\n",myname); printf("│ 주민등록번호 : %-25s│\n",myjumin); printf("│ 현재 시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-19ld│\n",mymoney); printf("└────────────────────┘"); printf("\n 이체할 금액 입력 (\\) : "); scanf("%d",&input_money); if(mymoney>input_money) { mymoney-=input_money; money+=input_money; EXEC SQL COMMIT TRAN; EXEC SQL UPDATE Account SET money=:mymoney WHERE accountNum=:self_acc; EXEC SQL UPDATE Account SET money=:money WHERE accountNum=:search_acc; printf("\n** 계좌이체 성공 **\n"); printf("┌─────────────────────┐\n"); printf("│%-8s 님의 현재 잔액 : (\\) %-11ld│\n",myname,mymoney); printf("│%-8s 님의 현재 잔액 : (\\) %-11ld│\n",name,money); printf("└─────────────────────┘\n"); } else { printf("** 잔액 부족, 계좌이체 실패.**\n"); EXEC SQL ROLLBACK TRAN; }

ESQL-C 코드 void balance() { int i; for(i=0;i<1;i++) { EXEC SQL BEGIN DECLARE SECTION; char search_acc[13]; char name[10],jumin[14]; int money=0; EXEC SQL END DECLARE SECTION; struct tm *ptr; time_t lt=time(NULL); ptr=localtime(&lt); printf("\n 잔액 확인 계좌번호 입력 : "); gets(search_acc); EXEC SQL SELECT C.name, CI.jumin, A.money INTO :name, :jumin, :money FROM Customer C,Account A,CusInfo CI WHERE CI.accountNum = :search_acc AND A.accountNum = :search_acc AND C.id=CI.id;

ESQL-C 코드 if(NO_MORE_TUPLES) { printf("** 없는 계좌번호입니다 **\n"); break; } printf("\n"); printf("┌──────────────────┐\n"); printf("│ 성명 : %-29s│\n",name); printf("│ 주민등록번호 : %-21s│\n",jumin); printf("│ 현재시각 : %s",asctime(ptr)); printf("│ 현재 남은 잔액 : (\\) %-15ld│\n",money); printf("└──────────────────┘\n"); }

ESQL-C 코드 void viewInfo() { EXEC SQL BEGIN DECLARE SECTION; char name[10],jumin[14],address[20],phone[11],accountNum[13]; int money,id; EXEC SQL END DECLARE SECTION; EXEC SQL DECLARE viewInfo CURSOR FOR SELECT C.id, A.accountNum, C.name, CI.jumin, CI.address, CI.phone, A.money FROM Customer C,Account A,CusInfo CI WHERE A.accountNum = CI.accountNum AND C.id = A.id ORDER BY C.name,C.id; EXEC SQL OPEN viewInfo;

ESQL-C 코드 printf("================================== 고객 정보 ====================================\n"); printf("ID 이름 계좌번호 주민등록번호 주소 전화번호 잔액 (\\)\n"); printf("===================================================== ==========================\n"); while(1) { EXEC SQL FETCH viewInfo INTO :id, :name, :accountNum, :jumin, :address, :phone, :money; if(NO_MORE_TUPLES) { break; } printf("%2d %8s %-s %s %s %s %d\n",id, name, accountNum, jumin, address, phone, money); } EXEC SQL CLOSE viewInfo; }