免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1478 | 回复: 3
打印 上一主题 下一主题

求救:怎样在vc中用sqlload指令!! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-02-21 08:14 |只看该作者 |倒序浏览
小弟在实习中~  
现在要写用proc导入数据到oracle数据库
我想用sqlload命令,将数据和导入命令分别放在两个文挡里
在dos下,输入:sqlldr username/password@XXX control=命令文挡路径
就可以导入了 ,但是在vc里如何执行呢,是不是用shell?
谁能告诉小弟用什么导入啊!!!
可否写出格式啊,或者给出例子,求大家拉……



_________________

论坛徽章:
0
2 [报告]
发表于 2004-02-21 09:39 |只看该作者

求救:怎样在vc中用sqlload指令!!

VC里有system函数

论坛徽章:
0
3 [报告]
发表于 2004-02-21 14:10 |只看该作者

求救:怎样在vc中用sqlload指令!!

楼上的可否具体相告????
此函数格式是什么
有例子吗

论坛徽章:
0
4 [报告]
发表于 2004-02-21 15:32 |只看该作者

求救:怎样在vc中用sqlload指令!!

谢谢2楼指点!
我自己看msdn
system, _wsystem
Execute a command.

int system( const char *command );

int _wsystem( const wchar_t *command );

Routine Required Header Compatibility
system <process.h>; or <stdlib.h>; ANSI, Win 95, Win NT
_wsystem <process.h>; or <stdlib.h>; or <wchar.h>; Win NT


For additional compatibility information, see Compatibility in the Introduction.

Libraries

LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version


Return Value

If command is NULL and the command interpreter is found, the function returns a nonzero value. If the command interpreter is not found, it returns 0 and sets errno to ENOENT. If command is not NULL, system returns the value that is returned by the command interpreter. It returns the value 0 only if the command interpreter returns the value 0. A return value of – 1 indicates an error, and errno is set to one of the following values:

E2BIG

Argument list (which is system-dependent) is too big.

ENOENT

Command interpreter cannot be found.

ENOEXEC

Command-interpreter file has invalid format and is not executable.

ENOMEM

Not enough memory is available to execute command; or available memory has been corrupted; or invalid block exists, indicating that process making call was not allocated properly.

Parameter

command

Command to be executed

Remarks

The system function passes command to the command interpreter, which executes the string as an operating-system command. system refers to the COMSPEC and PATH environment variables that locate the command-interpreter file (the file named CMD.EXE in Windows NT). If command is NULL, the function simply checks to see whether the command interpreter exists.

You must explicitly flush (using fflush or _flushall) or close any stream before calling system.

_wsystem is a wide-character version of system; the command argument to _wsystem is a wide-character string. These functions behave identically otherwise.

Generic-Text Routine Mappings

TCHAR.H Routine  _UNICODE & _MBCS Not Defined _MBCS Defined _UNICODE Defined
_tsystem system system _wsystem


Example

/* SYSTEM.C: This program uses
* system to TYPE its source file.
*/

#include <process.h>;

void main( void )
{
   system( "type system.c" );
}


Output

/* SYSTEM.C: This program uses
* system to TYPE its source file.
*/
#include <process.h>;
void main( void )
{
   system( "type system.c" );
}

另外说一下:此函数真的很有用,可以在vc里执行dos命令
可以让程序员从地层编程里脱离出来(小弟正在脱离中……)
希望看到帖子的人能觉得有点帮助
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP