/* Result Sets Interface */
#ifndef SQL_CRSR
# define SQL_CRSR
struct sql_cursor
{
unsigned int curocn;
void *ptr1;
void *ptr2;
unsigned long magic;
};
typedef struct sql_cursor sql_cursor;
typedef struct sql_cursor SQL_CURSOR;
#endif /* SQL_CRSR */
/* Thread Safety */
typedef void * sql_context;
typedef void * SQL_CONTEXT;
/* Object support */
struct sqltvn
{
unsigned char *tvnvsn;
unsigned short tvnvsnl;
unsigned char *tvnnm;
unsigned short tvnnml;
unsigned char *tvnsnm;
unsigned short tvnsnml;
};
typedef struct sqltvn sqltvn;
struct sqladts
{
unsigned int adtvsn;
unsigned short adtmode;
unsigned short adtnum;
sqltvn adttvn[1];
};
typedef struct sqladts sqladts;
static struct sqladts sqladt = {
1,1,0,
};
/* Binding to PL/SQL Records */
struct sqltdss
{
unsigned int tdsvsn;
unsigned short tdsnum;
unsigned char *tdsval[1];
};
typedef struct sqltdss sqltdss;
static struct sqltdss sqltds =
{
1,
0,
};
/* File name & Package Name */
struct sqlcxp
{
unsigned short fillen;
char filnam[13];
};
static struct sqlcxp sqlfpn =
{
12,
"db_detail.pc"
};
static unsigned long sqlctx = 291371;
static struct sqlexd {
unsigned int sqlvsn;
unsigned int arrsiz;
unsigned int iters;
unsigned int offset;
unsigned short selerr;
unsigned short sqlety;
unsigned int occurs;
short *cud;
unsigned char *sqlest;
char *stmt;
sqladts *sqladtp;
sqltdss *sqltdsp;
void **sqphsv;
unsigned int *sqphsl;
int *sqphss;
void **sqpind;
int *sqpins;
unsigned int *sqparm;
unsigned int **sqparc;
unsigned short *sqpadto;
unsigned short *sqptdso;
void *sqhstv[10];
unsigned int sqhstl[10];
int sqhsts[10];
void *sqindv[10];
int sqinds[10];
unsigned int sqharm[10];
unsigned int *sqharc[10];
unsigned short sqadto[10];
unsigned short sqtdso[10];
} sqlstm = {10,10};
/* SQLLIB Prototypes */
extern sqlcxt (/*_ void **, unsigned long *,
struct sqlexd *, struct sqlcxp * _*/);
extern sqlcx2t(/*_ void **, unsigned long *,
struct sqlexd *, struct sqlcxp * _*/);
extern sqlbuft(/*_ void **, char * _*/);
extern sqlgs2t(/*_ void **, char * _*/);
extern sqlorat(/*_ void **, unsigned long *, void * _*/);
/* Forms Interface */
static int IAPSUCC = 0;
static int IAPFAIL = 1403;
static int IAPFTL = 535;
extern void sqliem(/*_ char *, int * _*/);
static char *sq0008 =
"select ename ,sal from emp ";
static char *sq0027 =
"select * from sale where sale_date between to_date(:b0,'yyyymmddhh24miss')\
and to_date(:b1,'yyyymmddhh24miss') ";
static char *sq0028 =
"select * from sale where staff_id=:b0 ";
static char *sq0029 =
"select * from staff ";
typedef struct { unsigned short len; unsigned char arr[1]; } VARCHAR;
typedef struct { unsigned short len; unsigned char arr[1]; } varchar;
/* CUD (Compilation Unit Data) Array */
static short sqlcud0[] =
{10,4130,0,0,0,
5,0,0,1,0,0,24,25,0,0,1,1,0,1,0,1,97,0,0,
24,0,0,2,0,0,24,26,0,0,1,1,0,1,0,1,97,0,0,
43,0,0,3,0,0,24,27,0,0,1,1,0,1,0,1,97,0,0,
62,0,0,4,93,0,4,49,0,0,4,2,0,1,0,2,97,0,0,2,3,0,0,1,97,0,0,1,97,0,0,
93,0,0,5,82,0,4,76,0,0,10,1,0,1,0,2,97,0,0,2,97,0,0,2,97,0,0,2,97,0,0,2,4,0,0,
2,4,0,0,2,3,0,0,2,4,0,0,2,3,0,0,1,97,0,0,
148,0,0,6,0,0,27,108,0,0,4,4,0,1,0,1,97,0,0,1,97,0,0,1,97,0,0,1,10,0,0,
179,0,0,7,0,0,30,127,0,0,0,0,0,1,0,
194,0,0,8,39,0,9,141,0,0,0,0,0,1,0,
209,0,0,8,0,0,13,148,0,0,2,0,0,1,0,2,97,0,0,2,4,0,0,
232,0,0,8,0,0,15,154,0,0,0,0,0,1,0,
247,0,0,8,0,0,15,163,0,0,0,0,0,1,0,
262,0,0,9,63,0,4,186,0,0,1,0,0,1,0,2,97,0,0,
281,0,0,10,45,0,4,192,0,0,1,0,0,1,0,2,3,0,0,
300,0,0,11,45,0,4,197,0,0,1,0,0,1,0,2,3,0,0,
319,0,0,12,63,0,4,221,0,0,1,0,0,1,0,2,97,0,0,
338,0,0,13,78,0,3,230,0,0,6,6,0,1,0,1,97,0,0,1,97,0,0,1,97,0,0,1,4,0,0,1,4,0,0,
1,4,0,0,
377,0,0,14,52,0,5,242,0,0,3,3,0,1,0,1,3,0,0,1,3,0,0,1,97,0,0,
404,0,0,15,51,0,5,248,0,0,1,1,0,1,0,1,97,0,0,
423,0,0,16,52,0,4,255,0,0,1,0,0,1,0,2,3,0,0,
442,0,0,17,53,0,3,258,0,0,5,5,0,1,0,1,3,0,0,1,97,0,0,1,97,0,0,1,3,0,0,1,4,0,0,
477,0,0,18,0,0,29,264,0,0,0,0,0,1,0,
492,0,0,19,82,0,4,299,0,0,2,1,0,1,0,2,97,0,0,1,3,0,0,
515,0,0,20,74,0,4,317,0,0,7,1,0,1,0,2,97,0,0,2,97,0,0,2,97,0,0,2,97,0,0,2,3,0,
0,2,97,0,0,1,97,0,0,
558,0,0,21,51,0,3,359,0,0,6,6,0,1,0,1,97,0,0,1,97,0,0,1,97,0,0,1,3,0,0,1,3,0,0,
1,97,0,0,
597,0,0,22,0,0,29,361,0,0,0,0,0,1,0,
612,0,0,23,100,0,5,401,0,0,6,6,0,1,0,1,97,0,0,1,97,0,0,1,3,0,0,1,3,0,0,1,97,0,
0,1,97,0,0,
651,0,0,24,0,0,29,404,0,0,0,0,0,1,0,
666,0,0,25,43,0,5,432,0,0,1,1,0,1,0,1,97,0,0,
685,0,0,26,0,0,29,435,0,0,0,0,0,1,0,
700,0,0,27,122,0,9,476,0,0,2,2,0,1,0,1,97,0,0,1,97,0,0,
723,0,0,27,0,0,13,487,0,0,6,0,0,1,0,2,97,0,0,2,97,0,0,2,97,0,0,2,4,0,0,2,4,0,0,
2,4,0,0,
762,0,0,27,0,0,15,495,0,0,0,0,0,1,0,
777,0,0,8,0,0,15,506,0,0,0,0,0,1,0,
792,0,0,28,49,0,9,539,0,0,1,1,0,1,0,1,97,0,0,
811,0,0,28,0,0,13,550,0,0,6,0,0,1,0,2,97,0,0,2,97,0,0,2,97,0,0,2,4,0,0,2,4,0,0,
2,4,0,0,
850,0,0,28,0,0,15,554,0,0,0,0,0,1,0,
865,0,0,28,0,0,15,565,0,0,0,0,0,1,0,
880,0,0,29,32,0,9,593,0,0,0,0,0,1,0,
895,0,0,29,0,0,13,604,0,0,6,0,0,1,0,2,97,0,0,2,97,0,0,2,97,0,0,2,3,0,0,2,3,0,0,
2,97,0,0,
934,0,0,29,0,0,15,613,0,0,0,0,0,1,0,
949,0,0,29,0,0,15,623,0,0,0,0,0,1,0,
};
#include <stdio.h>
#include <sqlca.h>
#include <string.h>
#include "db_detail.h"
#include "pu.h"
#include "link.h"
/***************************************************************
func:系统启动时根用户名和密码导入数据库文件
para:char *username,用户名;char *passwd,密码;char *db,数据库实例
retu:0
****************************************************************/
int db_import(char *username, char *passwd , char *db)
{
char str1[512] = {0};
char str2[512] = {0};
char str3[512] = {0};
char str4[512] = {0};
sprintf(str1,"drop user %s cascade",username);
sprintf(str2,"create user %s identified by %s",username,passwd);
sprintf(str3,"grant connect,resource to %s",username);
db_connect("system","manager","orcl");
/* EXEC SQL EXECUTE IMMEDIATE:str1; */
{
struct sqlexd sqlstm;
sqlstm.sqlvsn = 10;
sqlstm.arrsiz = 1;
sqlstm.sqladtp = &sqladt;
sqlstm.sqltdsp = &sqltds;
sqlstm.stmt = "";
sqlstm.iters = (unsigned int )1;
sqlstm.offset = (unsigned int )5;
sqlstm.cud = sqlcud0;
sqlstm.sqlest = (unsigned char *)&sqlca;
sqlstm.sqlety = (unsigned short)256;
sqlstm.occurs = (unsigned int )0;
sqlstm.sqhstv[0] = ( void *)str1;
sqlstm.sqhstl[0] = (unsigned int )512;
sqlstm.sqhsts[0] = ( int )0;
sqlstm.sqindv[0] = ( void *)0;
sqlstm.sqinds[0] = ( int )0;
sqlstm.sqharm[0] = (unsigned int )0;
sqlstm.sqadto[0] = (unsigned short )0;
sqlstm.sqtdso[0] = (unsigned short )0;
sqlstm.sqphsv = sqlstm.sqhstv;
sqlstm.sqphsl = sqlstm.sqhstl;
sqlstm.sqphss = sqlstm.sqhsts;
sqlstm.sqpind = sqlstm.sqindv;
sqlstm.sqpins = sqlstm.sqinds;
sqlstm.sqparm = sqlstm.sqharm;
sqlstm.sqparc = sqlstm.sqharc;
sqlstm.sqpadto = sqlstm.sqadto;
sqlstm.sqptdso = sqlstm.sqtdso;
sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}
/* EXEC SQL EXECUTE IMMEDIATE:str2; */
{
struct sqlexd sqlstm;
sqlstm.sqlvsn = 10;
sqlstm.arrsiz = 1;
sqlstm.sqladtp = &sqladt;
sqlstm.sqltdsp = &sqltds;
sqlstm.stmt = "";
sqlstm.iters = (unsigned int )1;
sqlstm.offset = (unsigned int )24;
sqlstm.cud = sqlcud0;
sqlstm.sqlest = (unsigned char *)&sqlca;
sqlstm.sqlety = (unsigned short)256;
sqlstm.occurs = (unsigned int )0;
sqlstm.sqhstv[0] = ( void *)str2;
sqlstm.sqhstl[0]
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
POS机.rar (56个子文件)
项目文档
pos设计文档.doc 309KB
pos操作手册.doc 322KB
可执行文件
oracle.cfg 305B
main 174KB
pos.conf 94B
pos.dmp 24KB
数据库
pos.sql 3KB
pos.dmp 24KB
源文件
POS
db_detail.c 86KB
posmain.c 585B
pos.conf.bak 94B
oracle.cfg 305B
gets_config.c.bak 2KB
link.c 7KB
gets_config.h.bak 178B
pos_front.c 57KB
db_detail.c.bak 72KB
pu.h 169B
pos_front.h.bak 2KB
link.c.bak 7KB
pos_front.c.bak 57KB
pos_ui.h.bak 456B
link.h.bak 2KB
win2.scr 9KB
pu.c 749B
pos_ui.h 518B
db_detail.h 2KB
debug.log.bak 11B
sqlnet.log 17KB
pos_back.c 39KB
pos_ui.c.bak 5KB
pos.conf 94B
button.c 3KB
button.h.bak 356B
makefile 434B
gets_config.h 178B
debug.log 30KB
pos_ui.c 5KB
makefile.bak 407B
pos_front.h 2KB
win3.scr 9KB
db_detail.pc 20KB
db_detail.pc.bak 20KB
pos_back.c.bak 39KB
posmain.c.bak 585B
button.c.bak 3KB
.pos_front.c.swo 16KB
button.h 356B
pos_back.h 1KB
gets_config.c 2KB
link.h 2KB
win1.scr 9KB
pos_back.h.bak 1KB
pos.dmp 24KB
db_detail.h.bak 2KB
win.scr 9KB
共 56 条
- 1
资源评论
zhujm320
- 粉丝: 9
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功