{"id":1193,"date":"2013-09-23T10:04:11","date_gmt":"2013-09-23T02:04:11","guid":{"rendered":"http:\/\/www.gejoin.com\/?p=1193"},"modified":"2013-09-23T10:04:11","modified_gmt":"2013-09-23T02:04:11","slug":"aix-db2%e5%b5%8c%e5%85%a5%e5%bc%8fsqlsqc%e7%bc%96%e8%af%91","status":"publish","type":"post","link":"https:\/\/www.mujins.com\/?p=1193","title":{"rendered":"AIX db2\u5d4c\u5165\u5f0fSQL(sqc)\u7f16\u8bd1"},"content":{"rendered":"<h3>\u7f16\u8bd1SQC<\/h3>\n<p>\u4f7f\u7528C\u8bed\u8a00\u7f16\u5199\u5d4c\u5165\u5f0fSQL\u4ee5\u8bbf\u95eeDB2\u7684\u7a0b\u5e8f,DB2\u9884\u7f16\u8bd1\u5668\u53ef\u4ee5\u5c06SQL\u8bed\u6cd5\u76f4\u63a5\u8f6c\u6362\u4e3aDB2\u884c\u65f6\u670d\u52a1\u5e94\u7528\u7a0b\u5e8f\u7f16\u7a0b\u63a5\u53e3\uff08API\uff09\u8c03\u7528\u3002<\/p>\n<p>bind\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u6839\u636eSQC\u4e2d\u7684SQL\u8bed\u53e5\u4f7f\u7528\u7684\u8868\u548c\u64cd\u4f5c\u6307\u5b9a\u8bbf\u95ee\u65f6DB\u8981\u4f7f\u7528\u7684\u7b56\u7565\uff0c\u662f\u4e00\u79cd\u4f18\u5316\u4f5c\u7528\uff0c\u4ee5\u52a0\u5feb\u6570\u636e\u8bbf\u95ee\u7684\u901f\u5ea6\u3002<\/p>\n<p><a href=\"https:\/\/www.gigiwangs.com\/wp-content\/uploads\/2013\/09\/aix_sqc.png\" data-lightbox=\"gal[1193]\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1194\" alt=\"aix_sqc \u7f16\u8bd1\" src=\"https:\/\/www.gigiwangs.com\/wp-content\/uploads\/2013\/09\/aix_sqc.png\" width=\"525\" height=\"281\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u9884\u7f16\u8bd1\u547d\u4ee4\uff1a<\/p>\n<pre class=\"brush:bash\">db2 prep *.sqc bindfile<\/pre>\n<p>bindfile\u53c2\u6570\u4f5c\u7528\u662f\u751f\u6210\u548csqc\u6587\u4ef6\u540c\u540d\u7684.bnd\u6587\u4ef6\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u5c31\u548c\u4e00\u822c\u7684C\u7a0b\u5e8f\u4e00\u6837\u8fdb\u884c\u7f16\u8bd1\u4e86\uff0c\u6765\u770b\u770b\u8fd9\u4e2a\u7b80\u5355\u7684Makefile\uff0cAIX \u7f16\u8bd164\u4f4d\u7684\u5e94\u7528\u3002<\/p>\n<pre class=\"brush:bash\">CHMOD =chmod 755\nRM =rm -f\n#export OBJECT_MODE=64\nDB2_HOME=\/opt\/IBM\/db2\/V9.1\nCFLAGS=  -q64 -qchars=signed -I.  -g -I$(DB2_HOME)\/include\nLDFLAGS = -b64 -g -L $(DB2_HOME)\/lib64 -ldb2\nDB2 =db2\nBINHOME=$(HOME)\/batch\/bin\n\nCC= xlc_r\n\n#DB CONFIGURE\nDBNAME = db2name\nUSEID = db2user\nPASWD = db2pswd\n\nALL =$(BINHOME)\/ApsBatchWS\nall:$(ALL)\n.SUFFIXES:\n.SUFFIXES:.sqc .cpp .c .o\nOBJS = dbcons.o serv.o util.o log.o flow.o\n\n.sqc.o:\n        $(DB2)  connect to $(DBNAME) user $(USEID) using $(PASWD)\n        @$(RM)   *.bnd $*.c\n        @$(DB2)  prep $&lt; bindfile\n        @$(DB2)  bind $*.bnd\n        @$(DB2)  connect reset\n        @$(DB2)  terminate\n        @$(CC)  $(CFLAGS) -s -c  $*.c\n.c.o:\n        $(CC) -c $(CFLAGS)  $&lt;\n.cpp.o:\n        $(CC) -c  $(CFLAGS)  $&lt;\n\n$(ALL) : $(OBJS)\n        $(CC) $(CFLAGS)  $(OBJS) $(LDFLAGS) -o  $@\n        $(CHMOD)  $@\n\nclean:\n        $(RM) *.o dbcon.c dbcons.bnd $(ALL)<\/pre>\n<p>\u770b\u8fd9\u91cc\u8fd8\u6709\u597d\u591a\u7684\u4f8b\u5b50\uff1a<a href=\"http:\/\/www.columbia.edu\/acis\/rad\/db2\/doc\/db2hs\/cpp\/frame3.htm#cpp\/cursorq\" target=\"_blank\"><span style=\"color: #339966;\">\u70b9\u51fb\u8fd9\u91cc\u67e5\u770b<\/span><\/a><\/p>\n<p>sqc\u7684\u7f16\u5199\u65b9\u6cd5\u8fd9\u91cc\u5c31\u4e0d\u518d\u8d58\u8ff0\uff0c\u76f8\u5173\u7684\u6587\u7ae0\u5df2\u7ecf\u592a\u591a\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f16\u8bd1SQC<br \/>\n\u4f7f\u7528C\u8bed\u8a00\u7f16\u5199\u5d4c\u5165\u5f0fSQL\u4ee5\u8bbf\u95eeDB2\u7684\u7a0b\u5e8f,DB2\u9884\u7f16\u8bd1\u5668\u53ef\u4ee5\u5c06SQL\u8bed\u6cd5\u76f4\u63a5\u8f6c\u6362\u4e3aDB2\u884c\u65f6\u670d\u52a1\u5e94\u7528\u7a0b\u5e8f\u7f16\u7a0b\u63a5\u53e3\uff08API\uff09\u8c03\u7528\u3002<br \/>\nbind\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u6839\u636eSQC\u4e2d\u7684SQL\u8bed\u53e5\u4f7f\u7528\u7684\u8868\u548c\u64cd\u4f5c\u6307\u5b9a\u8bbf\u95ee\u65f6DB\u8981\u4f7f\u7528\u7684\u7b56\u7565\uff0c\u662f\u4e00\u79cd\u4f18\u5316\u4f5c\u7528\uff0c\u4ee5\u52a0\u5feb\u6570\u636e\u8bbf\u95ee\u7684\u901f\u5ea6\u3002<\/p>\n","protected":false},"author":1,"featured_media":1194,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[49,31,50,4,21,5],"tags":[24,22,51,32,13],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts\/1193"}],"collection":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1193"}],"version-history":[{"count":0,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts\/1193\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}