sqc基础库使用手册

合集下载

sqlite 数据库使用说明

sqlite 数据库使用说明

sqlite 数据库使用说明SQLite是一种嵌入式关系型数据库管理系统,它占用非常少的资源并具有轻量级的特性。

以下是对SQLite数据库的使用说明。

我们需要在系统中安装SQLite。

可以从SQLite官方网站上下载并安装适合您的操作系统版本。

一旦安装完成,我们可以使用命令行工具或使用SQLite提供的GUI工具(如SQLite Studio、DB Browser for SQLite等)来管理和操作数据库。

创建数据库:我们可以使用以下命令创建一个新的SQLite数据库文件:```sqlite3 mydatabase.db```这将创建名为mydatabase.db的SQLite数据库文件。

如果文件已经存在,它将打开该文件。

创建数据表:通过命令行工具,我们可以使用SQL语句来创建数据表。

例如,以下是创建一个名为students的数据表的示例:```CREATE TABLE students (id INTEGER PRIMARY KEY, name TEXT, age INTEGER);```在这个示例中,我们创建了一个具有id、name和age列的students表。

插入数据:要将数据插入到数据表中,可以使用INSERT语句。

例如,以下是一个将数据插入到students表的示例:```INSERT INTO students (name, age) VALUES ('John Doe', 25);```这个示例将一个名为John Doe且年龄为25的学生插入到students表中。

查询数据:要从数据表中检索数据,可以使用SELECT语句。

例如,以下是检索所有学生记录的示例:```SELECT * FROM students;```这将返回students表中的所有记录。

更新和删除数据:要更新数据表中的记录,可以使用UPDATE语句。

例如,以下是将id为1的学生的年龄更新为30的示例:```UPDATE students SET age = 30 WHERE id = 1;```要删除数据表中的记录,可以使用DELETE语句。

SQC作业程序

SQC作业程序
Page11
◆ 5.SQC檢驗規範。 SQC檢驗規範
5-3出貨管制
e.生產中出現整批性或潛常性不良時,品管將召集相關部門開 會商討解決對策,並做會議記錄,並根據會議記錄為判退是 Rework、Sorting或Hold。 f.R&D緊急設計變更須立刻導入,品管並召集相關部門進行開會 商討解決對策,並做會議記錄,並根據會議記錄為判退是 Rework、Sorting或Hold 。 g.客戶抱怨,產線正在生產的產品經確認也存在同樣的異常, 品管將通知相關部門進行開會商討解決對策,並做會議記錄, 並根據會議記錄為判退是Rework、Sorting或Hold 。
csqc檢驗不良相機將不良現象寫在流程卡背面然後將不合格品用汽泡袋裝好放在不良盒並依不合格品管制作業規范fordsc執行
Page1
題的編碼原則。 3.SQC的工作職責。 3. 4.SQC的檢驗流程。 5.SQC的檢驗規範。 6.各種表單的填寫。
Page2
SQC Weekly Report
Page17
◆ 6.各種表單的填寫。
6-5.DSC SQC Monthly Report
SQC Monthly Report
Page18
品質異常單
Page14
◆ 6.各種表單的填寫。
6-2.DSC SQC檢驗通知單
SQC 再檢通知單
Page15
◆ 6.各種表單的填寫。
6-3.DSC SQC Daily Report
SQC Daily Report
Page16
◆ 6.各種表單的填寫。
6-4.DSC SQC Weekly Report
Page12
◆ 6.各種表單的填寫。
6-1.品質異常處理單 6-2.DSC SQC檢驗通知單 6-3.DSC SQC Daily Report 6-4.DSC SQC Weekly Report 6-5.DSC SQC Monthly Report

SQL Server数据库教程(第3版)(SQL Server 2012)源代码使用说明

SQL Server数据库教程(第3版)(SQL Server 2012)源代码使用说明

SQL Server数据库教程(第3版)(SQL Server 2012)源代码使用说明1. 学生成绩数据库stsc该数据库是贯穿全书的重要数据库,参见本书346页“附录B学生成绩数据库stsc的表结构和样本数据”。

stsc数据库有student、course、score、teacher、lecture 5个表,这5个表的表结构和样本数据都在本书第346页至第348页的附录B中。

2. 创建数据库stsc、创建表和插入样本数据(1)启动SQL Server Management Studio,屏幕出现SQL Server Management Studio窗口,单击窗口左上方工具栏“新建查询”按钮,右边出现查询分析器编辑窗口。

(2)打开“学生成绩数据库stsc建库建表和插入样本数据源代码”文件→选中全部代码→复制,在查询分析器编辑窗口中光标闪烁处右单击,在弹出的菜单中选择“粘贴”,单击“执行”按钮,约数秒钟,就可建好数据库stsc和上述5个表及插入样本数据。

3. 例题源代码的操作(1)启动SQL Server Management Studio,屏幕出现SQL Server Management Studio窗口,单击窗口左上方工具栏“新建查询”按钮,右边出现查询分析器编辑窗口。

(2)在"SQL Server数据库教程(第3版)(SQL Server 2012)例题源代码”中,有各章例题源代码。

打开所需章的例题源代码文件→选中指定例题的代码→复制,在查询分析器编辑窗口中光标闪烁处右单击,在弹出的菜单中选择“粘贴”,单击“执行”按钮,就可得到该例题的运行结果。

4. 商店实验数据库storeexpm建库建表和插入样本数据该数据库在实验中多次用到。

storeexpm数据库包含5个表:部门表DeptInfo、员工表EmplInfo、订单表OrderInfo、订单明细表DetailInfo、商品表GoodsInfo。

SQL Server 2019 数据库系统用户手册说明书

SQL Server 2019 数据库系统用户手册说明书
Build an intelligence-driven organization by leveraging machine learning and AI to ingest, store, and analyze any type of data, structured or unstructured, with the power of SQL Server, Hadoop and Spark in SQL Server 2019 Big Data Clusters.
5 Make faster, better decisions
Use data virtualization to combine and query a variety of external relational and non-relational data sources without moving or replicating data.
Mission critical security 4
Access rich, interactive reports and enterprise reporting for better analysis and decision-making.
Create, deploy, and manage mobile and paginated reports with rich visualizations in SQL Server Reporting Services. Author beautiful reports with Power BI Desktop. Publish Power BI reports to the cloud or Power BI Report Server in SQL Server 2019, and distribute and consume reports across devices. Consume interactive dashboards and reports, both online and offline, with mobile reporting on iOS, Android, and Windows devices.

sqc基础库使用手册

sqc基础库使用手册

sqc基础库使⽤⼿册SqcLib库接⼝定义新的sqc基础库采⽤c++封装,开发⼈员只需要从基础类Db2Tools派⽣⾃⼰的业务类。

然后重载基础类的busiLogic⽅法,就可以完成⾃⼰业务逻辑处理。

具体的处理流程为:1、在基础类Db2Tools的run⽅法中完成对具体应⽤参数的解析。

2、run⽅法调⽤busiLogic⽅法,完成具体的业务逻辑3、busiLogic⽅法中调⽤基础类的常⽤数据库访问⽅法,完成对数据库的操作。

4、在基础类的数据库访问⽅法中,除完成指定的数据库操作外,同时完成⽇志输出和相关事务控制。

[⽇志的输出⽬录为profile⽂件中定义的AGENTTRACEDIR⽬录,如果没有定义,取默认路径]1函数列表1.1数据库类(Db2Tools)该类有两个主要功能:1、实现数据库访问2、完成对具体业务逻辑调⽤和事务控制●connDb函数原形:int connDb(const char *m_para_conn)⽤途:连接数据库参数:m_para_conn:数据库名dbname返回:1.输⼊的数据库参数不对2.密码参数环境变量设置错误3.数据库连接失败0.数据库连接成功●busiLogic函数原形:int busiLogic(void)⽤途:业务逻辑⼊⼝参数:返回:●run函数原形:int run(int argc,char *argv[])⽤途:实例开始⼊⼝参数:argc:参数个数Argv:参数数组(通常取main函数⼊⼝参数)返回:0:成功,其它:失败函数原形:int db2RunstatTab(char *tabname,char *file,int line)⽤途:对表做runstats参数:tabname:输⼊需要runstats的表名,schema.tabname或者tabname(schema默认为⽤户名)返回:-1:失败0:成功●db2Insert函数原形:int db2Insert(char *sqlstr,char *tabname,char *file,int line)⽤途:提交insert语句参数:sqlstr:insert sql语句file:line:返回:-1:失败0:成功●db2Update函数原形:int db2Update(char *sqlstr,char *tabname,char *file,int line)⽤途:提交update语句参数:sqlstr:update sql语句file:line:返回:-1:失败0:成功●db2Delete函数原形:int db2Delete(char *sqlstr,char *tabname,char *file,int line)⽤途:提交delete语句参数:sqlstr:delete sql语句file:line:返回:-1.失败0.成功●db2DropTab函数原形:int db2DropTab(char *tabname,char *file,int line)参数:tabname:需要删除的表名,schema.tabnamefile:line:返回:-1:删除失败1:表不存在0:成功●db2DelAll函数原形:int db2DelAll(char *tabname, char *file,int line)⽤途:清空该表中的全部数据参数:tabname:需要删除的表名,schema.tabnamefile:line:返回:-1:删除失败1:表不存在0:成功●db2CreTab函数原形:int db2CreTab(char *sqlstr,char *tabname,char *file,int line)⽤途:新建⼀张表参数:返回:-1:建表失败1:表已经存在0:建表成功●db2GrantTab函数原形:int db2GrantTab(char *user,char *tabname,char *file,int line)⽤途:表付权函数,只能付select权限,⼀次只能给⼀个⽤户或者组付权参数:返回:●dbRrefreshTab函数原形:int dbRrefreshTab(char *tabname,char *file,int line)⽤途:同步刷新表参数:返回:1.2⽇期类(DateFormat)完成读⽇期的各种运算函数原形:CdateFormat (std::string pat)⽤途:构造函数参数:pat:输⼊⽇期的格式●getMonthRoll函数原形:string getMonthRoll(int interval)⽤途:获得输⼊⽉份偏移interval后的⽉份参数:interval:偏移量返回:返回yyyymm 格式的⽇期●getDateRoll函数原形:string getDateRoll(int intverval)⽤途:获得输⼊⽇期偏移interval后的⽇期参数:interval:偏移量返回:返回yyyymmdd格式的⽇期●getYearRoll函数原形:string getYearRoll(int intverval)⽤途:获得输⼊年偏移interval后的年份参数:interval:偏移量返回:返回yyyy格式的⽇期●setPattern函数原形:int setPattern(std::string strFormat)⽤途:指定输⼊⽇期值的格式(%Y%m%d, %Y-%m-%d)参数:strFormat:输⼊的⽇期格式返回:-1:执⾏失败0:执⾏成功●getPattern函数原形:string getPattern ( )⽤途:返回⽇期值的格式参数:strTime:输⼊的⽇期返回:-1:执⾏失败0:执⾏成功●dateParsing⽤途:把表⽰时间的字符串strTime按pattern格式转换成tm结构的⽇期时间结构参数:strTime:输⼊的⽇期返回:-1:执⾏失败0:执⾏成功●getLastDay函数原形:string getLastDay ()⽤途:返回指定⽉份的最后⼀天参数:返回:返回yyyymmdd格式的⽇期●getFirstDay函数原形:string getFirstDay()⽤途:返回指定⽉份的第⼀天参数:返回:返回yyyymmdd格式的⽇期●getQuater函数原形:string getQuater ()⽤途:返回当前⽉份所在的季度参数:返回:季度(1、2、3、4)1.3⽇志类完成⽇志数据●writeLogTrace函数原形:int writeLogTrace(char *m_proname,int m_ddh,int m_rwh,int m_cmdstatus,char *promptMsg1,char *promptMsg2,char *file,int line,char *fpath)⽤途:写ss⽇志到指定⽬录下参数:●open_trace函数原形:int open_trace(char * tast_name)⽤途:打开trace⽂件参数:tast_name:程序名返回:TRACE_FD:会产⽣该全局变量,指向⽂件的指针1.4控制表类●synTab函数原形:int synTab(FILE *trace,char *sqlstr,char *tabname,char *file,int line)⽤途:向同步申请表中插⼊需要同步的表tabname:需要同步的表名file:⽂件名line:⾏号返回:●writeSysLog函数原形:int writeSysLog(FILE *trace,int status,char *file,int line)⽤途:向统⼀通信表中插⼊程序成功失败⽇志参数:trace:⽇志⽂件句柄status:程序成功失败标识file:⽂件名line:⾏号返回:errorLog2memset函数详细说明1。

sqlist在c语言中用法

sqlist在c语言中用法

sqlist在c语言中用法在 C 语言中,如果你想要使用 SQL,你通常会使用 SQL 数据库的 C 接口库来执行 SQL 查询和操作数据库。

最常见的 C 接口库之一是 SQLite,它是一个轻量级的、自包含的、基于文件的 SQL 数据库引擎。

以下是在 C 语言中使用 SQLite 的基本用法:包含头文件:首先,你需要包含SQLite 头文件,通常是sqlite3.h。

#include <sqlite3.h>打开数据库:使用 sqlite3_open() 函数打开或创建一个数据库连接。

如果数据库文件不存在,则会创建一个新的数据库文件。

cCopy codesqlite3 *db;int rc = sqlite3_open("example.db", &db);if (rc != SQLITE_OK) {// 打开数据库失败fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));sqlite3_close(db);return 1;}执行 SQL 语句:你可以使用 sqlite3_exec() 函数执行 SQL 查询或操作。

cCopy codeconst char *sql = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)";rc = sqlite3_exec(db, sql, 0, 0, 0);if (rc != SQLITE_OK) {// SQL 执行失败fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db));sqlite3_close(db);return 1;}处理查询结果:如果执行的是查询语句,你需要使用回调函数来处理查询结果。

SQC-XP 统计质量控制系统说明书

SQC-XP 统计质量控制系统说明书

Filling processesTransparency at a glanceS Q CSQC-XPStatistical Quality Control For monitoring, controlling and opti-mising filling processes to comply with economic and legal requirements in these industries:I Pharma I Cosmetics I FoodIChemistryFoodFood manufacturers have to meet anarray of regulatory requirements. SQC-XP is your tool for relieving the burdenof collecting and evaluating productiondata. With SQC-XP you always knowyour production mean value and thesize of the scatter of the fill quantities.The trend display shows you the direc-tion of movement of your fill quantities.e-Mark, IFS, German PrepackagingOrdinance (FPVO)ChemicalsEnd customers also expect to receive precisely the indicated quantity from countless other products. Numerous containers are filled and supplied to secondary industries as semi-finished products.An SQC-XP can manage up to 100 articles.CosmeticsMost cosmetics contain extremely valuable sub-stances. With the help of SQC-XP, you can reduce the fill quantity to the legally required minimum and verify that your cosmetics comply with therequired fill quantities and their tolerances.S t a t i s t i c a l Q u a l i t y C o n t r o lPharmaSQC-XP offers filling process control for the weight uniformity of tablets, capsules,powders and suppositories in accor-dance with the European Pharma-copoeia.GMP , GLP , European PharmacopoeiaThe LV11 automatically feeds tablets and capsules to the weighing pan.ITransforms an Excellence Plus XP balance into a quality control system I Comfortable operation with touch screenI Standalone system, SQC application in the balanceI Display increments beginning with 1µg, weighing range up to 64kgEuropean Pharmacopeia and German Prepackaging Ordinance As a filler of prepackaged goods,you cannot underfill but also don't want to give anything away. Uniformity is the law! SQC-XP is a tool that gives you optimal support for compliance and GMP .Comfortable operationAll important information is display-ed on the large touch screen. Make your entries by directly touching the display: Start a random sample,configure the system, adjust an arti-cle, define a new article or print a report.SQC-XP – Excellent balancebetween legal compliance and filling costsThe right balance for every packageThe wide variety of Excellence Plus XP balances means you'll find the right balance for your product. The selection ranges from analytical balances with a resolution of 1µg,to precision balances with a weigh-ing range of 64kg.The pre-configured printoutsconform to GxP and can be adapted to the needs of the customer.Process monitoring and documentationRandom samplesRandom sample results are clearly shown on the large display and automatically printed on a strip or A4/legal printer.Use the mean value, scatter and trend to determine whether you need to adjust the fill quantity.StatisticsSQC-XP provides short- and long-term statistics per batch.Batch and statistics reports can be printed on a strip printer or A4printer.For more informationon your PC printer. If the SQC-XP's 100-article memory should proveIf you are planning to use 3 or more peripheral devices with the SQC-XP,you will need either the LocalCan or the BT option.Draft shield doors for LV11 operation:–Doors with slot for XP analytical balances 11106715–Doors with slot for XP precision balances withhigh draft protection111327111Mettler-Toledo AGPO Box VI-400, CH-8606 GreifenseeTel. +41-44-944 22 11, Fax +41-44-944 31 70Subject to technical changes© 09/07 Mettler-Toledo AGPrinted in Switzerland 21901293SQC-XP product features•SQC application for installation on XP precision/analytical balances•Operated and configured through the clearly laid out touch screen•Languages: German, English, French, Italian, SpanishNumber of articles: – 100, with up to 25 parameters eachTolerance systems:–EU, e.g. for food–European Pharmacopeia–3 free tolerance systems–Separate mean-value tolerance (TM)Units: –mg, g, kg, oz, lb, ml, l, fz, customer standardRandom samples: –Mean value tare (preset packaging weight, scatter neglected)–Tare series (for determining the tare with small mean variations in packaging weights)–Single tare (individual recording of the tare with large mean variations in packaging weights throughpreweighing/differential weighing)–Additive and subtractive weighing–Automatic feeding with LV11Statistics: –1 batch-based article, code-controlled–2 time-based per article; periods freely selectableReports:–Random sample printouts, statistical printouts–Standard: mean, standard deviation, number of individual values–Configurable:•2 headers and 3 footers with free text, time/date, balance identification•Tolerances in the statistical report (pharma: in the statistical and random sample reports)•Single values on the random sample report•Largest single value, smallest single value, difference of both values•Overfilling and underfilling violations (in tabular form)•Violation monitoring messages (in large print)•Histogram, class table•Graphic representation of the last 10 mean values and standard deviations•Simple statistical information (only on the random sample report)Safety: 8 different user profiles, the same as all XP applications, access authorizations configurable Interfaces: The SQC-XP application supports the following interfaces:RS232, LC (LocalCan), BTS (Bluetooth single point),BT (Bluetooth Multi Point), PS/2Backup/Restore–Configuration of article data on the PCPC program:–Management of an unlimited number of articles(100 per safety data)–SQC-XP data backup on the PC (backup)–Restoration of backup data from the PC to the balance(Restore)–View and print statistics on the PC–Minimal hardware requirements: Windows XP or 2000,Pentium II/64MB RAMStandard equipment:–Contained in the CD:•SQC-XP application (firmware)•BR-XP backup/restore program•SQC-XP training presentation•Operating instructions– Registration sheet, Quick GuideBalance You can obtain detailed information on XP precision and analytical balances from individual product specifications:datasheets or brochures provided by your METTLER TOLEDO sales representative.。

嵌入式SQL-SQC之ESQL编程入门与技巧(共20页)

嵌入式SQL-SQC之ESQL编程入门与技巧(共20页)

ESQL编程(Cheng)使用说明1.1第一章 ESQL介(Jie)绍本章对ESQL做一概括介绍,主要讨论怎么使用(Yong)ESQL、ESQL的根(Gen)本的概念和定义、ESQL程序的各(Ge)个局部和ESQL 程序中语句的类型.SQL语言长短过程化语言,大局部语句的执行与其前面或后面的语句无关,而一些高级编程语言都是基于如循环,条件等布局的过程化语言,尽管SQL语言非常有力,但它却没有过程化能力.假设把SQL语言嵌入到过程化的编程语言中,那么操纵这些布局,程序开发人员就能设计出更加灵活的应用系统,具有SQL语言和高级编程语言的良好特征,它将比单独使用SQL或C语言具有更强的功能和灵活性.COBASE RDBMS提供两种东西在主语言中编程来存取COBASE数据库中的数据.即高级语言预编译程序接口(ESQL)和高级语言的函数调用接口(CCI).目前这些东西仅撑持C语言.COBASE RDBMS提供的ESQL东西把含有SQL语句的C程序转化为可存取和把持COBASE数据库中数据的C程序,作为一编译器,ESQL把输入文件中的EXEC SQL 语句在输出文件中转化为适当的CCI函数调用.输出文件那么可以正常的C程序的方式被编译、连接和执行.1.1.1ESQL中的底子概念ESQL中的底子概念主要有:1.嵌入的SQL语句:嵌入的SQL语句是指在应用程序中使用的SQL语句.该应用程序称作宿主程序,书写该程序的语言称作宿主语言.嵌入的SQL语句与交互式SQL语句在语法上没有太大的差别,只是嵌入式SQL语句在个别语句上有所扩充.如嵌入式SQL中的SELECT语句增加了INTO子句,以便与宿主语言变量打交道.此外,嵌入式SQL为适合程序设计语言的要求,还增加了许多语句,如游标的定义、翻开和关闭语句等等.2.执行性SQL语句和说明性SQL语句:嵌入的SQL语句主要有两种类型:执行性SQL语句和说明性SQL语句.执行性SQL语句可用来连接COBASE,定义、查询和把持COBASE数据库中的数据,每一执行性语句真正对数据库进行操作 ,执行完成后,在USERCA中存放执行信息.说明性语句用来说明通讯域和SQL语句顶用到的变量. 说明性语句不生成执行代码,对USERCA不发生影响.3.事务:事务是逻辑上相关的一组SQL语句.COBASE把(Ba)它们视作一个单位.为了保持数据库的一致性,一事务内(Nei)的所有操作要么都做,要么都不做.1.1.2ESQL程序(Xu)的组成和运行在ESQL程序中嵌入的SQL语句以EXEC作为起始标识,语句的结束以";"作为标识.在嵌入的SQL语句可以使用主语言(这时是C语言)的程序变(Bian)量(即主变量),这时主变量名前加冒号(:)作为标识表记标帜,以区别于字段名.ESQL程(Cheng)序包罗两局部:程序首部和程序体.程序首部定义变量,为ESQL程序做筹办, 程序体包罗各种SQL语句来把持COBASE数据库中的数据.编制并运行ESQL程序比单独使用纯C语言多一个预编译过程,通常具有以下几个步调:1.编纂ESQL程序(可操纵编纂软件如: EDLIN, WS等进行编纂).程序保后缀为.ec.2.使用COBASE的预编译器ETE对ESQL源程序进行预处置,该编译器将源程序中嵌入的SQL语言翻译成尺度C语言,发生一个C语言编译器能直接进行编译的文件.其文件的扩展名为.cpp。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

SqcLib库接口定义新的sqc基础库采用c++封装,开发人员只需要从基础类Db2Tools派生自己的业务类。

然后重载基础类的busiLogic方法,就可以完成自己业务逻辑处理。

具体的处理流程为:1、在基础类Db2Tools的run方法中完成对具体应用参数的解析。

2、run方法调用busiLogic方法,完成具体的业务逻辑3、busiLogic方法中调用基础类的常用数据库访问方法,完成对数据库的操作。

4、在基础类的数据库访问方法中,除完成指定的数据库操作外,同时完成日志输出和相关事务控制。

[日志的输出目录为profile文件中定义的AGENTTRACEDIR目录,如果没有定义,取默认路径]1函数列表1.1数据库类(Db2Tools)该类有两个主要功能:1、实现数据库访问2、完成对具体业务逻辑调用和事务控制●connDb函数原形:int connDb(const char *m_para_conn)用途:连接数据库参数:m_para_conn:数据库名dbname返回:1.输入的数据库参数不对2.密码参数环境变量设置错误3.数据库连接失败0.数据库连接成功●busiLogic函数原形:int busiLogic(void)用途:业务逻辑入口参数:返回:●run函数原形:int run(int argc,char *argv[])用途:实例开始入口参数:argc:参数个数Argv:参数数组(通常取main函数入口参数)返回:0:成功,其它:失败●db2RunstatTab函数原形:int db2RunstatTab(char *tabname,char *file,int line)用途:对表做runstats参数:tabname:输入需要runstats的表名,schema.tabname或者tabname(schema默认为用户名)返回:-1:失败0:成功●db2Insert函数原形:int db2Insert(char *sqlstr,char *tabname,char *file,int line)用途:提交insert语句参数:sqlstr:insert sql语句file:line:返回:-1:失败0:成功●db2Update函数原形:int db2Update(char *sqlstr,char *tabname,char *file,int line)用途:提交update语句参数:sqlstr:update sql语句file:line:返回:-1:失败0:成功●db2Delete函数原形:int db2Delete(char *sqlstr,char *tabname,char *file,int line)用途:提交delete语句参数:sqlstr:delete sql语句file:line:返回:-1.失败0.成功●db2DropTab函数原形:int db2DropTab(char *tabname,char *file,int line)用途:删除表参数:tabname:需要删除的表名,schema.tabnamefile:line:返回:-1:删除失败1:表不存在0:成功●db2DelAll函数原形:int db2DelAll(char *tabname, char *file,int line)用途:清空该表中的全部数据参数:tabname:需要删除的表名,schema.tabnamefile:line:返回:-1:删除失败1:表不存在0:成功●db2CreTab函数原形:int db2CreTab(char *sqlstr,char *tabname,char *file,int line)用途:新建一张表参数:返回:-1:建表失败1:表已经存在0:建表成功●db2GrantTab函数原形:int db2GrantTab(char *user,char *tabname,char *file,int line)用途:表付权函数,只能付select权限,一次只能给一个用户或者组付权参数:返回:●dbRrefreshTab函数原形:int dbRrefreshTab(char *tabname,char *file,int line)用途:同步刷新表参数:返回:1.2日期类(DateFormat)完成读日期的各种运算●CdateFormat函数原形:CdateFormat (std::string pat)用途:构造函数参数:pat:输入日期的格式●getMonthRoll函数原形:string getMonthRoll(int interval)用途:获得输入月份偏移interval后的月份参数:interval:偏移量返回:返回yyyymm 格式的日期●getDateRoll函数原形:string getDateRoll(int intverval)用途:获得输入日期偏移interval后的日期参数:interval:偏移量返回:返回yyyymmdd格式的日期●getYearRoll函数原形:string getYearRoll(int intverval)用途:获得输入年偏移interval后的年份参数:interval:偏移量返回:返回yyyy格式的日期●setPattern函数原形:int setPattern(std::string strFormat)用途:指定输入日期值的格式(%Y%m%d, %Y-%m-%d)参数:strFormat:输入的日期格式返回:-1:执行失败0:执行成功●getPattern函数原形:string getPattern ( )用途:返回日期值的格式参数:strTime:输入的日期返回:-1:执行失败0:执行成功●dateParsing函数原形:int dateParsing(std::string strTime)用途:把表示时间的字符串strTime按pattern格式转换成tm结构的日期时间结构参数:strTime:输入的日期返回:-1:执行失败0:执行成功●getLastDay函数原形:string getLastDay ()用途:返回指定月份的最后一天参数:返回:返回yyyymmdd格式的日期●getFirstDay函数原形:string getFirstDay()用途:返回指定月份的第一天参数:返回:返回yyyymmdd格式的日期●getQuater函数原形:string getQuater ()用途:返回当前月份所在的季度参数:返回:季度(1、2、3、4)1.3日志类完成日志数据●writeLogTrace函数原形:int writeLogTrace(char *m_proname,int m_ddh,int m_rwh,int m_cmdstatus,char *promptMsg1,char *promptMsg2,char *file,int line,char *fpath)用途:写ss日志到指定目录下参数:●open_trace函数原形:int open_trace(char * tast_name)用途:打开trace文件参数:tast_name:程序名返回:TRACE_FD:会产生该全局变量,指向文件的指针1.4控制表类●synTab函数原形:int synTab(FILE *trace,char *sqlstr,char *tabname,char *file,int line)用途:向同步申请表中插入需要同步的表参数:trace:日志文件句柄sqlstr:同步sql语法tabname:需要同步的表名file:文件名line:行号返回:●writeSysLog函数原形:int writeSysLog(FILE *trace,int status,char *file,int line)用途:向统一通信表中插入程序成功失败日志参数:trace:日志文件句柄status:程序成功失败标识file:文件名line:行号返回:errorLog2memset函数详细说明1。

void *memset(void *s,int c,size_t n)总的作用:将已开辟内存空间s 的首n 个字节的值设为值c。

3。

memset() 函数常用于内存空间初始化。

如:char str[100];memset(str,0,100);4。

memset()的深刻内涵:用来对一段内存空间全部设置为某个字符,一般用在对定义的字符串进行初始化为‘ ’或‘\0’;例:char a[100];memset(a, '\0', sizeof(a));memcpy用来做内存拷贝,你可以拿它拷贝任何数据类型的对象,可以指定拷贝的数据长度;例:char a[100],b[50]; memcpy(b, a, sizeof(b));注意如用sizeof(a),会造成b的内存地址溢出。

strcpy就只能拷贝字符串了,它遇到'\0'就结束拷贝;例:char a[100],b[50];strcpy(a,b);如用strcpy(b,a),要注意a中的字符串长度(第一个‘\0’之前)是否超过50位,如超过,则会造成b的内存地址溢出。

5.补充:一点心得memset可以方便的清空一个结构类型的变量或数组。

2.1学习笔记---Sql语句的执行步骤及注意事项在以上的10个处理步骤中, 每一步的处理都生成一个虚拟表来作为下一步的输入. 虚拟表对于调用者或输出查询来说是不存在的, 仅在最后步骤生成的表才会返回给调用者或者输出查询. 如果某一子句没有出现在SQL语句中, 这一步就被简单跳过..这10个具体步骤是:1.FROM: from子句中的两个表首先进行交叉连接(笛卡尔积), 生成虚拟表VT1。

2.ON: on条件作用在VT1上, 将条件为True的行生成VT2。

3.OUTER: 如果outer join被指定, 则根据外连接条件, 将左表or右表or多表的未出现在VT2查询结果中的行加入到VT2后生成VT3。

4.WHERE: VT3表中应用Where条件, 结果为真的行用来生成VT4。

5.GROUP BY: 根据Group by指定的列, 将VT4的行组织到不同的组中, 生成VT5。

6.CLUB|ROLLUP: 超级组(分组之后的分组)被添加到VT5中, 生成VT6。

7.HAVING: Having用来筛选组, VT6上符合条件的组将用来生成VT7。

8.SELECT: select子句用来选择指定的列, 并生成VT8。

9.DISTINCT: 从VT8中删除重复的行后, VT9被生成。

相关文档
最新文档