database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Q&A 2919 게시물 읽기
No. 2919
Re: Re: 이게 무슨 에러죠?
작성자
전병제
작성일
2001-02-09 20:40
조회수
3,509

아래의 파일이 makefile이거든요...

 

include $(ORACLE_HOME)/precomp/lib/env_precomp.mk

 

# This Makefile builds the sample programs in

# $(ORACLE_HOME)/precomp/demo/proc, and can serve as a template for linking

# customer applications.

#

# SAMPLES is a list of the c proc sample programs.

# CPPSAMPLES is a list of the c++ proc sample programs.

# OBJECT_SAMPLES is a list of the proc sample programs using the new

# type features. You must install ott in addition to proc to run some

# of those samples.

#

SAMPLES=sample1 sample2 sample3 sample4 sample6 sample7 sample8 \

sample9 sample10 sample11 sample12 oraca sqlvcp cv_demo \

ansidyn1 ansidyn2

CPPSAMPLES=cppdemo1 cppdemo3

OBJECT_SAMPLES=objdemo1 lobdemo1 coldemo1 navdemo1

#

# These targets are build all of a class of samples in one call to make.

#

samples: $(SAMPLES)

cppsamples: $(CPPSAMPLES)

object_samples: $(OBJECT_SAMPLES)

#

# The target 'build' puts together an executable $(EXE) from the .o files

# in $(OBJS) and the libraries in $(PROLDLIBS). It is used to build the

# c sample programs. The rules to make .o files from .c and .pc files are

# later in this file.

# ($(PROLDLIBS) includes the client shared library, and $(STATICPROLDLIBS) does

# not.)

#

build: $(OBJS)

$(CC) -o $(EXE) $(OBJS) -L$(LIBHOME) $(PROLDLIBS)

build_static: $(OBJS)

$(CC) -o $(EXE) $(OBJS) -L$(LIBHOME) $(STATICPROLDLIBS)

$(SAMPLES) $(OBJECT_SAMPLES):

$(MAKE) -f $(MAKEFILE) OBJS=$@.o EXE=$@ build

#

# The c++ samples are built using the 'cppbuild' target. It precompiles to

# get a .c file, compiles to get a .o file and then builds the executable.

#

cppbuild:

$(PROC) $(PROCPPFLAGS) iname=$(EXE)

$(CPLUSPLUS) -c $(INCLUDE) $(EXE).c

$(CPLUSPLUS) -o $(EXE) $(OBJS) -L$(LIBHOME) $(CPPLDLIBS)

cppbuild_static:

$(PROC) $(PROCPPFLAGS) iname=$(EXE)

$(CPLUSPLUS) -c $(INCLUDE) $(EXE).c

$(CPLUSPLUS) -o $(EXE) $(OBJS) -L$(LIBHOME) $(STATICCPPLDLIBS)

$(CPPSAMPLES): cppdemo2

$(MAKE) -f $(MAKEFILE) OBJS=$@.o EXE=$@ cppbuild

#

# sample5.pc illustrates the precompiler part of building a precompiler-forms

# application. Building the actual executable would require the FORMS bundle.

#

sample5:

@echo 'sample5 is a user-exit demo; use a forms makefile to build it.'

 

cppdemo2: empclass.o

$(MAKE) -f $(MAKEFILE) OBJS="cppdemo2.o empclass.o" EXE=$@ cppbuild

cppdemo2_static: empclass.o

$(MAKE) -f $(MAKEFILE) OBJS="cppdemo2.o empclass.o" EXE=cppdemo2 cppbuild_static

 

#

# Some of the samples require that .sql scripts be run before precompilation.

# If you set RUNSQL=run in your call to make, then make will use sqlplus or

# svrmgrl, as appropriate, to run the .sql scripts.

# If you leave RUNSQL unset, then make will print out a reminder to run the

# scripts.

# If you have already run the scripts, then RUNSQL=done will omit the reminder.

#

sqlplus_run:

($(CD) ../sql; $(BINHOME)sqlplus $(USER) @$(SCRIPT) < /dev/null)

svrmgrl_run:

($(CD) ../sql; $(BINHOME)svrmgrl < $(SCRIPT).sql)

sqlplus_ svrmgrl_:

@$(ECHO) "# You must run the .sql script, " $(SCRIPT),

@$(ECHO) "# before precomping this sample."

sqlplus_done svrmgrl_done:

#

calldemo-sql:

$(MAKE) -f $(MAKEFILE) USER=scott/tiger SCRIPT=calldemo sqlplus_$(RUNSQL)

sample11-sql:

$(MAKE) -f $(MAKEFILE) USER=scott/tiger SCRIPT=sample11 sqlplus_$(RUNSQL)

cv_demo-sql:

$(MAKE) -f $(MAKEFILE) USER=scott/tiger SCRIPT=cv_demo sqlplus_$(RUNSQL)

cppdemo2-sql:

$(MAKE) -f $(MAKEFILE) USER=scott/tiger SCRIPT=cppdemo2 sqlplus_$(RUNSQL)

lobdemo1-sql:

$(MAKE) -f $(MAKEFILE) SCRIPT=lobdemo1c svrmgrl_$(RUNSQL)

objdemo1-sql:

$(MAKE) -f $(MAKEFILE) SCRIPT=objdemo1 svrmgrl_$(RUNSQL)

coldemo1-sql:

$(MAKE) -f $(MAKEFILE) SCRIPT=coldemo1 svrmgrl_$(RUNSQL)

navdemo1-sql:

$(MAKE) -f $(MAKEFILE) SCRIPT=navdemo1 svrmgrl_$(RUNSQL)

#

# Here are some rules for converting .pc -> .c -> .o and for .typ -> .h.

#

# If proc needs to find .h files, it should find the same .h files that the

# c compiler finds. We use a macro named INCLUDE to hadle that. The general

# format of the INCLUDE macro is

# INCLUDE= $(I_SYM)dir1 $(I_SYM)dir2 ...

#

# Normally, I_SYM=-I, for the c compiler. However, we have a special target,

# pc1, which calls $(PROC) with various arguments, include $(INCLUDE). It

# is used like this:

# $(MAKE) -f $(MAKEFILE) <more args to make> I_SYM=include= pc1

# This is used for some of $(SAMPLES) and for $(OBJECT_SAMPLE).

.SUFFIXES: .pc .c .o .typ .h

 

pc1:

$(PROC) $(PROCFLAGS) iname=$(PCCSRC) $(INCLUDE)

 

.pc.c:

$(PROC) $(PROCFLAGS) iname=$*

 

.pc.o:

$(PROC) $(PROCFLAGS) iname=$*

$(CC) $(CFLAGS) -c $*.c

 

.c.o:

$(CC) $(CFLAGS) -c $*.c

 

.typ.h:

$(OTT) intype=$*.typ hfile=$*.h outtype=$*o.typ $(OTTFLAGS) code=c user=scott/tiger

#

# These are specific targets to make the .o files for samples that require

# more careful handling.

#

sample9.o: sample9.pc calldemo-sql

$(PROC) $(PROCPLSFLAGS) iname=$*

$(CC) $(CFLAGS) -c $*.c

 

cv_demo.o: cv_demo.pc cv_demo-sql

$(PROC) $(PROCPLSFLAGS) iname=$*

$(CC) $(CFLAGS) -c $*.c

 

sample11.o: sample11.pc sample11-sql

$(PROC) $(PROCPLSFLAGS) iname=$*

$(CC) $(CFLAGS) -c $*.c

 

sample4.o: sample4.pc

$(MAKE) -f $(MAKEFILE) PCCSRC=$* I_SYM=include= pc1

$(CC) $(CFLAGS) -c $*.c

 

ansidyn1.o: ansidyn1.pc

$(PROC) mode=ansi iname=$*

$(CC) $(CFLAGS) -c $*.c

 

ansidyn2.o: ansidyn2.pc

$(PROC) dynamic=ansi iname=$*

$(CC) $(CFLAGS) -c $*.c

 

empclass.o: empclass.pc cppdemo2-sql

$(MAKE) -f $(MAKEFILE) PROCFLAGS="sqlcheck=full user=scott/tiger $(PROCPPFLAGS)" PCCSRC=$* I_SYM=include= pc1

$(CPLUSPLUS) -c $(INCLUDE) $*.c

 

lobdemo1.o: lobdemo1.pc lobdemo1-sql

$(MAKE) -f $(MAKEFILE) PROCFLAGS="$(PROCPLSFLAGS)" PCCSRC=$* I_SYM=include= pc1

$(CC) $(CFLAGS) -c $*.c

 

objdemo1.o: objdemo1.pc objdemo1.typ objdemo1-sql

$(OTT) intype=$*.typ hfile=$*.h outtype=$*o.typ $(OTTFLAGS) code=c user=scott/tiger

$(MAKE) -f $(MAKEFILE) PROCFLAGS=intype=$*o.typ PCCSRC=$* I_SYM=include= pc1

$(CC) $(CFLAGS) -c $*.c

 

coldemo1.o: coldemo1.pc coldemo1.typ coldemo1-sql

$(OTT) intype=$*.typ hfile=$*.h outtype=$*o.typ $(OTTFLAGS) code=c user=scott/tiger

$(MAKE) -f $(MAKEFILE) PROCFLAGS=intype=$*o.typ PCCSRC=$* I_SYM=include= pc1

$(CC) $(CFLAGS) -c $*.c

 

navdemo1.o: navdemo1.pc navdemo1.typ navdemo1-sql

$(OTT) intype=$*.typ hfile=$*.h outtype=$*o.typ $(OTTFLAGS) code=c user=scott/tiger

$(MAKE) -f $(MAKEFILE) PROCFLAGS=intype=$*o.typ PCCSRC=$* I_SYM=include= pc1

$(CC) $(CFLAGS) -c $*.c

#

# The macro definition fill in some details or override some defaults from

# other files.

#

OTTFLAGS=$(PCCFLAGS)

CLIBS= $(TTLIBS_QA) $(LDLIBS)

PRODUCT_LIBHOME=

MAKEFILE=$(ORACLE_HOME)/precomp/demo/proc/demo_proc.mk

PROCPLSFLAGS= sqlcheck=full userid=$(USERID)

PROCPPFLAGS= code=cpp $(CPLUS_SYS_INCLUDE)

USERID=scott/tiger

NETWORKHOME=$(ORACLE_HOME)/network/

PLSQLHOME=$(ORACLE_HOME)/plsql/

INCLUDE=$(I_SYM). $(I_SYM)$(PRECOMPHOME)public $(I_SYM)$(RDBMSHOME)public $(I_SYM)$(RDBMSHOME)demo $(I_SYM)$(PLSQLHOME)public $(I_SYM)$(NETWORKHOME)public

>>소몰이 님께서 쓰시길<<

 

:: Makefile을 먼저 봐야 될 것 같은데여..

:: >>전병제 님께서 쓰시길<<

::

:: :: #include <sys/errno.h>

:: :: #include <stdio.h>

:: :: #include <netdb.h>

:: :: #include <string.h>

:: ::

:: :: #define sql_msg sqlca.sqlerrm.sqlerrmc

:: ::

:: :: EXEC SQL INCLUDE sqlca.h;

:: ::

:: ::

:: :: main() {

:: :: sqlEnv();

:: :: sqlLinitial();

:: :: sql_insert();

:: :: }

:: ::

:: :: sqlEnv() {

:: ::

:: :: char Env[100];

:: ::

:: :: putenv("NLS_LANG=American_America.K016KSC5601");

:: :: sprintf(Env, "ORACLE_SIC=%S", "ORCL");

:: :: putenv(Env);

:: :: putenv("ORACLE_HOME=/oracle");

:: :: }

:: ::

:: :: sqlLinitial() {

:: ::

:: :: strncpy(userid.arr, "id", strlen("id"));

:: :: userid.len = strlen(userid.arr);

:: ::

:: :: strncpy(passwd.arr, "password", strlen("password"));

:: :: userid.len = strlen(passwd.arr);

:: ::

:: :: EXEC SQL connect :userid identified by :passwd;

:: :: EXEC SQL WHENEVER SQLERROR GOTO stop_st;

:: :: printf("\n Sqlplus initial Success\n");

:: :: }

:: ::

:: ::

:: ::

:: :: sql_insert() {

:: ::

:: :: EXEC SQL BEGIN DECLARE SECTION;

:: :: number user_no[4];

:: :: varchar user_name[10];

:: :: varchar user_data[10];

:: :: EXEC SQL END DECLARE SECTION;

:: ::

:: :: memset(Sqlcmd, 0x00, sizeof(Sqlcmd));

:: :: sprintf(Sqlcmd, "INSERT INTO mytable (user_no, user_name, user_data) \

:: :: VALUES (%d, %s, %s)", \

:: :: 10, "chonbj", "seoul");

:: :: EXEC SQL EXECUTE IMMEDIATE :Sqlcmd;

:: :: //EXEC SQL WHENEVER SQLERROR GOTO stop_st;

:: ::

:: :: printf("\n insert success");

:: ::

:: :: EXEC SQL COMMIT WORK;

:: ::

:: :: stop_st :

:: :: EXEC SQL ROLLBACK WORK;

:: :: printf("\n error message = %s", sql_msg);

:: :: }

:: :: 이렇게 해서 컴파일을 하니까....

:: :: /export/home/OraHome1/lib/libclntsh.so' is up to date 라고 나오고 실행파일도 생기지 않더라구

:: 요..

:: :: ..

:: :: 고수님들 왜 그런 거죠?

[Top]
No.
제목
작성자
작성일
조회
2921sqlplus 접속시 error
장정철
2001-02-09
2549
2934┕>Re: sqlplus 접속시 error
소몰이
2001-02-10 13:06:24
2901
2976 ┕>Re: Re: sqlplus 접속시 error
장정철
2001-02-12 20:10:44
3533
2910[질문]01008, 00000, "not all variables bound" 메시지에 대해서.
김경호
2001-02-09
3877
2915┕>Re: [질문]01008, 00000,
소몰이
2001-02-09 20:16:12
2943
2933 ┕>Re: Re: [질문]01008, 00000,
김경호
2001-02-10 10:39:14
4757
2909필드 네임을 바꿀려면.. 어케해야하져.. 제발갈켜주세용 ㅠ.ㅠ
조건형
2001-02-09
1973
2911┕>Re: 필드 네임을 바꿀려면.. 어케해야하져.. 제발갈켜주세용 ㅠ.ㅠ
dontgo
2001-02-09 20:04:32
2235
2918 ┕>Re: Re: 필드 네임을 바꿀려면.. 어케해야하져
최성준
2001-05-07 12:56:33
2645
2907이게 무슨 에러죠?
전병제
2001-02-09
2425
2912┕>Re: 이게 무슨 에러죠?
소몰이
2001-02-09 20:09:47
3019
2919 ┕>Re: Re: 이게 무슨 에러죠?
전병제
2001-02-09 20:40:29
3509
2958  ┕>Re: Re: Re: 이게 무슨 에러죠?
소몰이
2001-02-12 11:54:42
2458
2905svrmgrl 실행시 에러가 납니다. 도와 주세요
pobipobi
2001-02-09
1925
2914┕>Re: svrmgrl 실행시 에러가 납니다. 도와 주세요
소몰이
2001-02-09 20:15:41
2370
2935 ┕>Re: Re 그래도 message not found 에러가 없어지지를 않는군요 도와주세요.
pobipobi
2001-02-10 13:32:36
2674
2904범용 DB 라이브러리가 있나요?
sunamy
2001-02-09
2393
2916┕>Re: 범용 DB 라이브러리가 있나요?
소몰이
2001-02-09 20:18:10
2112
2902svrmgrl 때문에 죽갔습니다.
mis74
2001-02-09
2075
2908┕>Re: svrmgrl 때문에 죽갔습니다.
아마도
2001-02-09 15:12:39
2187
2938┕>Re: svrmgrl 때문에 죽갔습니다.
이기태
2001-02-10 14:10:30
2180
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.022초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다