| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4411 人关注过本帖
标题:可编译 含有 EXEC SQL BEGIN DECLARE SECTION;语句的编译器是什么?
只看楼主 加入收藏
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
结帖率:79.17%
收藏
已结贴  问题点数:10 回复次数:3 
可编译 含有 EXEC SQL BEGIN DECLARE SECTION;语句的编译器是什么?
看到在C代码中 EXEC SQL BEGIN DECLARE SECTION;
听说这些都是把sql嵌入到宿主语言,不知道用什么编译器才能编译这样的程序?
我使用#include <stdio.h>
EXEC SQL BEGIN DECLARE SECTION;
    char cno[6];
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE SQLCA;

int main()
{
    return 0;
}
做测试,在VC中没有通过
搜索更多相关主题的帖子: SQL SECTION EXEC BEGIN DECLARE 
2009-09-06 23:25
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
收藏
得分:0 
/* ===== aaaa.c =====*/

/* ===== NT doesn't need the following... */
#ifndef WIN32
#define WIN32
#endif
#define _loadds
#define _SQLPREP_
#include <sqlca.h>
#include <sqlda.h>
#include <string.h>
#define SQLLENMAX(x)      ( ((x) > 32767) ? 32767 : (x) )
short ESQLAPI _loadds sqlaaloc(
    unsigned short usSqlDaId,
    unsigned short sqld,
    unsigned short stmt_id,
    void far *spare);
short ESQLAPI _loadds sqlxcall(
    unsigned short usCallType,
    unsigned short usSection,
    unsigned short usSqldaInId,
    unsigned short usSqlDaOutId,
    unsigned short usSqlTextLen,
    char far *lpszSQLText);
short ESQLAPI _loadds sqlacall(
    unsigned short usCallType,
    unsigned short usSection,
    unsigned short usSqldaInId,
    unsigned short usSqlDaOutId,
    void far *spare);
short ESQLAPI _loadds sqladloc(
    unsigned short usSqldaInId,
    void far *spare);
short ESQLAPI _loadds sqlasets(
    unsigned short cbSqlText,
    void far *lpvSqlText,
    void far *spare);
short ESQLAPI _loadds sqlasetv(
    unsigned short usSqldaInId,
    unsigned short sqlvar_index,
    unsigned short sqltype,
    unsigned short sqllen,
    void far *sqldata,
    void far *sqlind,
    void far *spare);
short ESQLAPI _loadds sqlastop(
    void far *spare);
short ESQLAPI _loadds sqlastrt(
    void far *pid,
    void far *spare,
    void far *sqlca);
short ESQLAPI _loadds sqlausda(
    unsigned short sqldaId,
    void far *lpvSqlDa,
    void far *spare);
extern struct tag_sqlca far sql_sqlca;
extern struct tag_sqlca far *sqlca;
struct sqla_program_id2 {
unsigned short length;
unsigned short rp_rel_num;
unsigned short db_rel_num;
unsigned short bf_rel_num;
unsigned char  sqluser[30];
unsigned char  sqlusername[30];
unsigned char  planname[256];
unsigned char  contoken[8];
unsigned char  buffer[8];
};
static struct sqla_program_id2 program_id =
        {340,2,0,0,"                              ","","aaaa","777fAHJx","        "};
static void far* pid = &program_id;
#line 1 "aaaa.sqc"
#line 1 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"







#pragma once
#line 18 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"



#line 25 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"



#pragma pack(push,8)
#line 34 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"







#line 49 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 50 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"



#line 57 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"




#line 66 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 67 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"

typedef unsigned int size_t;
#line 73 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"


typedef unsigned short wchar_t;
#line 80 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"

typedef wchar_t wint_t;
typedef wchar_t wctype_t;
#line 87 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 88 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"




typedef char *  va_list;
#line 99 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 101 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"



#line 108 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 110 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"















#line 141 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"


struct _iobuf {
        char *_ptr;
        int   _cnt;
        char *_base;
        int   _flag;
        int   _file;
        int   _charbuf;
        int   _bufsiz;
        char *_tmpfname;
        };
typedef struct _iobuf FILE;
#line 159 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"






#line 172 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"






#line 185 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"














#line 214 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 215 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"


 extern FILE _iob[];
#line 222 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"




#line 232 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"

typedef __int64 fpos_t;



#line 243 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 244 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"

#line 247 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"














 int __cdecl _filbuf(FILE *);
 int __cdecl _flsbuf(int, FILE *);


 FILE * __cdecl _fsopen(const char *, const char *, int);
#line 283 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
 void __cdecl clearerr(FILE *);
 int __cdecl fclose(FILE *);
 int __cdecl _fcloseall(void);


 FILE * __cdecl _fdopen(int, const char *);
#line 293 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
 int __cdecl feof(FILE *);
 int __cdecl ferror(FILE *);
 int __cdecl fflush(FILE *);
 int __cdecl fgetc(FILE *);
 int __cdecl _fgetchar(void);
 int __cdecl fgetpos(FILE *, fpos_t *);
 char * __cdecl fgets(char *, int, FILE *);


 int __cdecl _fileno(FILE *);
#line 307 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
 int __cdecl _flushall(void);
 FILE * __cdecl fopen(const char *, const char *);
 int __cdecl fprintf(FILE *, const char *, ...);
 int __cdecl fputc(int, FILE *);
 int __cdecl _fputchar(int);
 int __cdecl fputs(const char *, FILE *);
 size_t __cdecl fread(void *, size_t, size_t, FILE *);
 FILE * __cdecl freopen(const char *, const char *, FILE *);
 int __cdecl fscanf(FILE *, const char *, ...);
 int __cdecl fsetpos(FILE *, const fpos_t *);
 int __cdecl fseek(FILE *, long, int);
 long __cdecl ftell(FILE *);
 size_t __cdecl fwrite(const void *, size_t, size_t, FILE *);
 int __cdecl getc(FILE *);
 int __cdecl getchar(void);
 int __cdecl _getmaxstdio(void);
 char * __cdecl gets(char *);
 int __cdecl _getw(FILE *);
 void __cdecl perror(const char *);
 int __cdecl _pclose(FILE *);
 FILE * __cdecl _popen(const char *, const char *);
 int __cdecl printf(const char *, ...);
 int __cdecl putc(int, FILE *);
 int __cdecl putchar(int);
 int __cdecl puts(const char *);
 int __cdecl _putw(int, FILE *);
 int __cdecl remove(const char *);
 int __cdecl rename(const char *, const char *);
 void __cdecl rewind(FILE *);
 int __cdecl _rmtmp(void);
 int __cdecl scanf(const char *, ...);
 void __cdecl setbuf(FILE *, char *);
 int __cdecl _setmaxstdio(int);
 int __cdecl setvbuf(FILE *, char *, int, size_t);
 int __cdecl _snprintf(char *, size_t, const char *, ...);
 int __cdecl sprintf(char *, const char *, ...);
 int __cdecl sscanf(const char *, const char *, ...);
 char * __cdecl _tempnam(const char *, const char *);
 FILE * __cdecl tmpfile(void);
 char * __cdecl tmpnam(char *);
 int __cdecl ungetc(int, FILE *);
 int __cdecl _unlink(const char *);
 int __cdecl vfprintf(FILE *, const char *, va_list);
 int __cdecl vprintf(const char *, va_list);
 int __cdecl _vsnprintf(char *, size_t, const char *, va_list);
 int __cdecl vsprintf(char *, const char *, va_list);




#line 363 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"


 FILE * __cdecl _wfsopen(const wchar_t *, const wchar_t *, int);
#line 369 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
 wint_t __cdecl fgetwc(FILE *);
 wint_t __cdecl _fgetwchar(void);
 wint_t __cdecl fputwc(wint_t, FILE *);
 wint_t __cdecl _fputwchar(wint_t);
 wint_t __cdecl getwc(FILE *);
 wint_t __cdecl getwchar(void);
 wint_t __cdecl putwc(wint_t, FILE *);
 wint_t __cdecl putwchar(wint_t);
 wint_t __cdecl ungetwc(wint_t, FILE *);
 wchar_t * __cdecl fgetws(wchar_t *, int, FILE *);
 int __cdecl fputws(const wchar_t *, FILE *);
 wchar_t * __cdecl _getws(wchar_t *);
 int __cdecl _putws(const wchar_t *);
 int __cdecl fwprintf(FILE *, const wchar_t *, ...);
 int __cdecl wprintf(const wchar_t *, ...);
 int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *, ...);
 int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
 int __cdecl vfwprintf(FILE *, const wchar_t *, va_list);
 int __cdecl vwprintf(const wchar_t *, va_list);
 int __cdecl _vsnwprintf(wchar_t *, size_t, const wchar_t *, va_list);
 int __cdecl vswprintf(wchar_t *, const wchar_t *, va_list);
 int __cdecl fwscanf(FILE *, const wchar_t *, ...);
 int __cdecl swscanf(const wchar_t *, const wchar_t *, ...);
 int __cdecl wscanf(const wchar_t *, ...);



 FILE * __cdecl _wfdopen(int, const wchar_t *);
 FILE * __cdecl _wfopen(const wchar_t *, const wchar_t *);
 FILE * __cdecl _wfreopen(const wchar_t *, const wchar_t *, FILE *);
 void __cdecl _wperror(const wchar_t *);
 FILE * __cdecl _wpopen(const wchar_t *, const wchar_t *);
 int __cdecl _wremove(const wchar_t *);
 wchar_t * __cdecl _wtempnam(const wchar_t *, const wchar_t *);
 wchar_t * __cdecl _wtmpnam(wchar_t *);

#line 414 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 415 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"

#line 418 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
















 int __cdecl fcloseall(void);
 FILE * __cdecl fdopen(int, const char *);
 int __cdecl fgetchar(void);
 int __cdecl fileno(FILE *);
 int __cdecl flushall(void);
 int __cdecl fputchar(int);
 int __cdecl getw(FILE *);
 int __cdecl putw(int, FILE *);
 int __cdecl rmtmp(void);
 char * __cdecl tempnam(const char *, const char *);
 int __cdecl unlink(const char *);
#line 463 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"



#pragma pack(pop)
#line 471 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 473 "D:\\Program_Files\\Microsoft Visual Studio\\VC98\\include\\stdio.h"
#line 2 "aaaa.sqc"

#line 3
/*
EXEC SQL INCLUDE SQLCA;
*/
#line 3

#line 5
/*
EXEC SQL BEGIN DECLARE SECTION;
*/
#line 5
    char cno[6];
#line 7
/*
EXEC SQL END DECLARE SECTION;
*/
#line 7


int main()
{
    return 0;
}
long SQLCODE;
哇 还真的能转换!

~~~~~~~~~~~~~~~好好学习~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009-09-07 19:15
forclwy
Rank: 4
等 级:业余侠客
帖 子:167
专家分:255
注 册:2008-10-21
收藏
得分:7 
真长
2009-09-07 19:50
vfdff
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:2172
专家分:425
注 册:2005-7-15
收藏
得分:0 
是呀,软件自动转化得到的东西

~~~~~~~~~~~~~~~好好学习~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009-09-07 22:10
快速回复:可编译 含有 EXEC SQL BEGIN DECLARE SECTION;语句的编译器是什么?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.064606 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved