CREATE PROCEDURE MAIL_LABEL (
CUST_NO INTEGER
) RETURNS (
LINE1 CHAR(40),
LINE2 CHAR(40),
LINE3 CHAR(40),
LINE4 CHAR(40),
LINE5 CHAR(40),
LINE6 CHAR(40)
) AS
DECLARE VARIABLE customer VARCHAR(25);
DECLARE VARIABLE first VARCHAR(15);
DECLARE VARIABLE last VARCHAR(20);
DECLARE VARIABLE addr1 VARCHAR(30);
DECLARE VARIABLE addr2 VARCHAR(30);
DECLARE VARIABLE city VARCHAR(25);
DECLARE VARIABLE state VARCHAR(15);
DECLARE VARIABLE country VARCHAR(15);
DECLARE VARIABLE postcode VARCHAR(12);
DECLARE VARIABLE cnt INTEGER;
BEGIN
line1 = '';
line2 = '';
line3 = '';
line4 = '';
line5 = '';
line6 = '';
SELECT customer, contact_first, contact_last, address_line1,
address_line2, city, state_province, country, postal_code
FROM CUSTOMER
WHERE cust_no = :cust_no
INTO :customer, :first, :last, :addr1, :addr2,
:city, :state, :country, :postcode;
IF (customer IS NOT NULL) THEN
line1 = customer;
IF (first IS NOT NULL) THEN
line2 = first || ' ' || last; ←←←요거 무슨 말이죠..그냥 문자열 더하기인가요?
ELSE
line2 = last;....
................
IF (country = 'USA') THEN
BEGIN
IF (city IS NOT NULL) THEN
line5 = city || ', ' || state || ' ' || postcode; ←←요거 점하나 더 있는거랑.
ELSE 아하등등...
...........................
그냥 초보가 인터베이스 공부하다가..질문드림다..
부탁 해요... ㅠㅠ;
퀀쿼터네이션이라고 부르는데(스팰링은 잘모름...)
단순히 스트링에 스트링을 연결(붙임)이란 뜻입니다.
ㅜㅜ wrote:
> CREATE PROCEDURE MAIL_LABEL (
> CUST_NO INTEGER
> ) RETURNS (
> LINE1 CHAR(40),
> LINE2 CHAR(40),
> LINE3 CHAR(40),
> LINE4 CHAR(40),
> LINE5 CHAR(40),
> LINE6 CHAR(40)
> ) AS
> DECLARE VARIABLE customer VARCHAR(25);
> DECLARE VARIABLE first VARCHAR(15);
> DECLARE VARIABLE last VARCHAR(20);
> DECLARE VARIABLE addr1 VARCHAR(30);
> DECLARE VARIABLE addr2 VARCHAR(30);
> DECLARE VARIABLE city VARCHAR(25);
> DECLARE VARIABLE state VARCHAR(15);
> DECLARE VARIABLE country VARCHAR(15);
> DECLARE VARIABLE postcode VARCHAR(12);
> DECLARE VARIABLE cnt INTEGER;
> BEGIN
> line1 = '';
> line2 = '';
> line3 = '';
> line4 = '';
> line5 = '';
> line6 = '';
>
> SELECT customer, contact_first, contact_last, address_line1,
> address_line2, city, state_province, country, postal_code
> FROM CUSTOMER
> WHERE cust_no = :cust_no
> INTO :customer, :first, :last, :addr1, :addr2,
> :city, :state, :country, :postcode;
>
> IF (customer IS NOT NULL) THEN
> line1 = customer;
> IF (first IS NOT NULL) THEN
> line2 = first || ' ' || last; ←←←요거 무슨 말이죠..그냥 문자열 더하기인가요?
> ELSE
> line2 = last;....
> ................
> IF (country = 'USA') THEN
> BEGIN
> IF (city IS NOT NULL) THEN
> line5 = city || ', ' || state || ' ' || postcode; ←←요거 점하나 더 있는거랑.
> ELSE 아하등등...
> ...........................
> 그냥 초보가 인터베이스 공부하다가..질문드림다..
> 부탁 해요... ㅠㅠ;