Executing sqlloader from sqlplus [message #121380] |
Fri, 27 May 2005 18:36 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
caga_na_sakinha
Messages: 4 Registered: April 2005
|
Junior Member |
|
|
Hi everyone,
when I execute sqloader from sqlplus, (i´ve created a procedure named "shell" to call external progs) the procedure completes successfully (no errors) but does nothing, meaning it doesnt load the values to my table.
using: exec shell('sqlldr user/pass refload.ctl')
when running the command on DOS prompt it works fine...
do you know why or how can i debug it???
thanks in advance for any help
take care
|
|
|
|
Re: Executing sqlloader from sqlplus [message #121418 is a reply to message #121386] |
Sat, 28 May 2005 13:52 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
caga_na_sakinha
Messages: 4 Registered: April 2005
|
Junior Member |
|
|
==============begin shell.c=================
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
void __declspec(dllexport) sh(char *);
void sh(char *cmd)
{
system(cmd);
}
============end shell.c======================
3) create shell_run.c (a test program)
=============begin shell_run.c===============
void __declspec(dllimport)ch (char*);
int main(int argc, char *argv[])
{
sh(argv[1]);
return 0;
}
============end shell_run.c==================
3) Create and run shell_compile.bat to compile and link shell and shell_run
============begin shell_compile.bat =========
bcc32 -WD shell.c
implib shell.lib shell.dll
bcc32 shell_run.c shell.lib
============end shell_compile.bat ===========
SQL> create library shell_lib is 'shell.dll';
SQL> create or replace procedure shell (
cmd IN varchar2)
as external
library shell_lib
name "_sh"
language C
parameters (
cmd string);
/
when I use this:
SQL> exec shell('any operating system command');
it gives me: procedure completed sucessfuly.
about using HOST, i was not aware of this, however i intent to use this shell procedure in a page from my ORACLE HTMLDB web application and i don't know if the HOST command can be executed there.
thanks again
|
|
|
|