External Procedure in Oracle7
I have found the topic for external procedure in Oracle document both Oracle9 and Oracle8, but not in Oracle7. Is external procedure supported in Oracle7? If yes, where can I find the document?
Thanks.
What can I do if I need the function like External Procedures? The best option is to ugrade your database (Oracle 7 is meanwhile for a very long time out of support)
Another option (although I really don't recommend it!) might be to install a second database with a version that supports both, external procedures and database links to Oracle 7.
Configure the external procedure on this database and call the extprocs from the original database through the database link.
Similar Messages
-
Database design and pl/sql vs external procedures
hi,
My project involves predicting arrival time of a bus at a bus-stop, given statistical data of traffic patterns on the previous n(say 3) days, as well as the current location of the bus(latitude-longitude).
Given current bus location, I derive my distance-until-destination bus-stop, which must be translated into time until arrival.
Ive enlisted the triggers and procedures involved in making the prediction. Thse procedures especially the determination of perpendicular distances involve some complex trigonometric operations. I would like to know if my approach is correct and my database design is suited for the operations to b performed.
Will it be more efficient to implement the procedures as external procedures or as pl/sql blocks
This is my database design:
LINKS ( a link is the road segment between adjacent bus-stops)
LINK_ID NUMBER [PRIMARY-KEY]
START_LATITUDE NUMBER
START_LONGITUDE NUMBER
START_STOP_ID NUMBER
END_LATITUDE NUMBER
END_LONGITUDE NUMBER
END_STOP_ID NUMBER
LINK_LENGTH NUMBER
BUS_ROUTE
ROUTE_ID NUMBER
LINKS_ENROUTE VARRAY(30) OF NUMBER
STOPS_ENROOUTE VARRAY(30) OF NUMBER
TRACK(keeps track of current location of bus)
BUS_ID NUMBER [PRIMARY-KEY]
ROUTE VARCHAR2(20)
LATITUDE NUMBER
LONGITUDE NUMBER
TS TIMESTAMP
LINK_ID NUMBER
START_STOP NUMBER
END_STOP NUMBER
ARRIVAL_TIMES(actual arrival times of the bus, updated by track)
BUS_ID NUMBER [PRIMARY-KEY]
BUS_ROUTE VARCHAR2(20)
ARRIVAL TIMESTAMP
STOP_ID NUMBER
ETA (expected time of arrival)
BUS_ID NUMBER
BUS_ROUTE VARCHAR2(20)
BUS_STOP_ID NUMBER
ARR_TIME VARRAY(5) OF TIMESTAMP
Triggers and procedures
1)TRACK_TRIGGER
On insert/update of track determine which link the us is currently on.
Invoke a procedure that calculates perpendicular distance from current location to all links en-route (cursor on LINKS).
Results are stored in a temporary table. Select the link-id of the tuple whose perpendicular distance is MINIMUM. This is the link the bus is currently on. Place link-id, start_stop_id and end_stop_id in corresponding row of TRACK.
2)ARRIVAL_TRIGGER
update ARRIVAL_TIMES.and store in ARRIVAL_TIMES that start-stop id with the time-stamp of the current track record.
b)update ETA: Find the BUS-STOPS that come before the START_STOP of current track record. All these rows are deleted from the ETA tables, as the bus has already crossed these stops.
3)Prediction Algorithm Procedure.
Determine distance until destination for each STOP, 20 stops down from stop current location.
Determine current avg. speed of the bus over a 2 hour window, by dividing total distance traveled by time taken.
Calculate time-until arrival T1=current avg. speed * distance until destination
From the records of previous n days (say n=3) find those buses on the same route that were near the link the bus is currently on. Again determine avg speed over 2 hour window and calculate avg. speed.
Calculate travel time T(i) = speed*distance until destination. i.=2,3, 4
The final predicted arrival time is a weighted sum of all T(i).
I hope Im not asking for too much, but the help would be greatly appreciated.
Thankyou,
Aminahello,
actually i can manage ETA without a varray, since there will b a maxximum of 3 -4 values of expected arrival times at each stop. this can b done with separate columns.
though i dont quite understand how lag() will help me...from what i understand lag() is to access values of previous rows. but in ETA table each element in the varray(if there is one) is going to be the expected arrival time of buses on a particular route at that particular stop, and is different from the arrival time at a previous stop(i.e.row).
but for my other table BUS_ROUTE i have 2 varrays describing the links and stops enroute. in quite a few procedures i have to loop through these arrays and perform some calculations in every iteration is varray the best way 2 go, or nested tables?
Thank you
Amina
As an aside, external procedures tend by their very
nature to be slow - there's an overhead incurred
each time we step outside the database. Therefore
you really ought to avoid using a C extproc unless
your calculations really cannot be done in PL/SQL or
a Java Stored Procedure.
Also, before you go down the VARRAY route you should
consider the virues of analytic functions, notably
[url=http://download-west.oracle.com/docs/cd/B1050
1_01/server.920/a96540/functions56a.htm#83619]LAG()[/u
rl]. I think you really ought to do some
benchmarking of parformance before you start afdding
denormalised columns like ETA. You may find the
overhead in maintaining those columns exceeds their
perceived benefits.
Cheers, APC -
ORA-12203 while calling a form from external procedure
Hi
I am using oracle 10g 10.2.0.3.0 database with forms 6i. We have created a database procedure , which makes a call to external procedure(C program). Now this external procedure creates a process and process is creating a call to form.
We have checked through the process explorer in the server, process is getting created successfully, but doesn't executed. We tried to start the process manually, it is throwing ora-12203: TNS unable to connect to destination.
We are able to connect the database from form's runtime. but if this runtime is executed from a process which is created by external procedure, it is throwing ora-12203.
Any idea?check tnsnames and listener files.verify the host and the port
-
We have an external procedure running fine on 8.1.7 on VMS. After compiling and linking succesfully under 10.1.0, I get ORA-06521 PL/SQL: Error mapping function and ORA-06522: ERROR - vms_dlsym for file x, where x in the filename of the linked executable. Another external procedure that does not connect to the 10.1.0 database runs fine. What could be causing this error in Server 10.1.0 on VMS?
Thanks,
DaveHere is the code to create the function:
CREATE OR REPLACE FUNCTION f1
(h_file_name IN VARCHAR2)
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY l1
NAME "f1"
LANGUAGE C
WITH CONTEXT
PARAMETERS
(CONTEST,
h_file_name string);
Here is the beginning of the Pro*C:
int f1(epctx, h_file_name)
OCIExtProcContext *epctx;
char h_file_name[70];
char h_line_txt [251];
int lineno;
FILE *fptr;
/* register the connection context ... */
EXEC SQL REGISTER CONNECT USING :epctx;
The function loads a flat file into the database. It is probably not related but are unable to SQLPLUS/ or SQLLDR/ into the database from an OS autheniticated account (get ORA-12547: TNS:lost contact.) Thanks for taking the time to look at this. There aren't many people trying this on VMS, I'd bet. -
Hello,
I had installed ore 1.3.1 windows server 2008 on top of Oracle DB 11.2.0.3 ,but when I connect the database,it didn't work.
That is my code and error code.
ore.connect(user = "rquser", sid = "db11g", host = "....", password = "....", all = TRUE)
Got error as below:
error.oci.GetQuery(conn, statement, data = data, prefetch = prefetch, :
ORA-28575: unable to open RPC connection to external procedure agent
ORA-06512: at "RQSYS.RQEVALIMPL", line 17
ORA-06512: at "RQSYS.RQEVALIMPL", line 14
ORA-06512: at line 4
Also i have follwed the below link:
///ORE1.3-ore-server-win-x86_64-1.3,error ORA-28575: unable to open RPC connec
But failed to resolve the problem.
Below are the TNS and Listener file entry:
# listener.ora Network Configuration File: F:\OracleDB\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = EXTPROC)
(ORACLE_HOME = H:\ORA11G\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:H:\ORA11G\product\11.2.0\dbhome_1\bin\oraclr11.dll")
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.168.11.69)(PORT = 1521))
ADR_BASE_LISTENER = H:\ORA11G
-============================
# tnsnames.ora Network Configuration File: F:\OracleDB\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(CONNECT_DATA =
(SID = EXTPROC)
(PRESENTATION = RO)
DB11G =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.168.11.69)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = DB11G)
====================================================
Thanks
SandyHi Sandy,
If you set EXTPROCS_DLLS=ANY in the listener and then restart the listener, does it fix the problem?
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = EXTPROC)
(ORACLE_HOME = H:\ORA11G\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ANY")
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.168.11.69)(PORT = 1521))
Sherry -
External procedure with Pro*C in it
I have some C functions that I have compiled into a shared library on Unix.
One of the functions contains a SQL statement to insert into a table, so I
compile the file with Pro*C. It compiles fine. I have another C program
that calls the function within my shared library. It runs fine and the shared
library does insert the data into the table.
I create an Oracle library that points to the shared library, then create a stored
function in the database that executes the routine in the shared library. At
this point, everything seems in place. We have been using external procedures
for a while, and they seem to work OK. This is the first one we have, though that
has Pro*C code in it.
When I execute the stored function to execute my Pro*C routine, I get the errors
ORA-06520: PL/SQL: Error loading external library
ORA-06522: Unresolved external.
This shared library is the first one that we are using that has Pro*C in it. The
documentation doesn't say anything about being able to use Pro*C routines
as external procedures; but it doesn't say you can't. Am I attempting the impossible?
If not, what am I missing?
nullIs your library object pointing to one shared library and in turn function in this library is 'looking' to another shared library? if so, that is not allowed
-
How to use external procedures in OWB Mapping
Hi,
Does anyone have an exmple of using external procdures in Mapping.
Thanks
mandiHi Mandi,
you can use Public and self created external Procedures/Functions in a Mapping.
You can integrate them in Expressions, e.g.
or use them as Post or Premapping in a Mapping.
It´s simple, just play a bit :-)
Only on a few Things you´ve to watch:
Every external Objects you want to use in a Mapping must be known in the Metadatas.
If you create a Mapping under the User scott,(e.g.), and you want to use
an external Procedures/Functions from the User Tiger,(e.g.), you must make sure
that theres a connection between these two Schematas.
For such things you can create a Connector in the Control Center.
Regards
Lone -
Problem in Calling External Procedure
Hello,
I am trying to call external procedure written in C from PL/SQL.
Here are the codes :
For external procedure:
#include<stdio.h>
void extproc_fn ( void )
FILE * file_handle;
if (( file_handle = fopen ( "/root/cprogs/extproc.out", "a" )) != NULL )
fwrite ( "External Procedure Testing", 26, 1, file_handle );
fclose ( file_handle );
I have created library as :
create or replace library extproc_lib as '/root/cprogs/extproc.so';
And the procedure :
create or replace procedure extproc_proc as
external
name "extproc_fn"
library extproc_lib
language c;
My listener and tnsname is configured correctly.
But when I try to connect to Oracle by that tnsname, extproc program core dumps under $ORACLE_HOME/network/log directory. Under WinNT, it creates a Dr. Watson error.
Any idea what might have gone wrong.
Thanks in advance.
Soumen Ghoshhi there,
everything u did is correct as far as i recollect about external procedures ,the only thing that i suppose is missing is that u forgot to grant permissions on the library to the user...pls check this once i hope this works...
bye
Atul -
Cannot get external procedural call in Oracle RAC Environment
Cannot get external procedure call to work in our test RAC env.
We are able to get it to work in our DEV env which is a single instance
LISTENER.ORA:
NODE1:
# listener.ora Network Configuration File: /opt/oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER_SBLBGT01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sblbgt01-vip1)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.41.1.21)(PORT = 1521)(IP = FIRST))
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
(ENVS="EXTPROC_DLLS=ANY")
NODE2:
# listener.ora.sblbgt02 Network Configuration File: /opt/oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.sblbgt02
# Generated by Oracle configuration tools.
LISTENER_SBLBGT02 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sblbgt02-vip2)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.41.1.22)(PORT = 1521)(IP = FIRST))
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
(ENVS="EXTPROC_DLLS=ANY")
2) ### If you are receiving errors, please list exact error messages and text: ###
(cont 1.)
tnsnames.ora (on both nodes):
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = extproc))
(CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO)))
[opt/oracle/app/oracle/product/10.2.0/db_1/network/admin]> tnsping EXTPROC_CONNECTION_DATA
TNS Ping Utility for Solaris: Version 10.2.0.3.0 - Production on 11-APR-2011 10:52:49
Copyright (c) 1997, 2006, Oracle. All rights reserved.
Used parameter files:
/opt/oracle/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = extproc)) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO)))
OK (0 msec)
Calling External Procedure:
SQL> execute ttran.shell('ls');
BEGIN ttran.shell('ls'); END;
ERROR at line 1:
ORA-28575: unable to open RPC connection to external procedure agent
ORA-06512: at "TTRAN.SHELL", line 1
ORA-06512: at line 1Any Reply Please...
would appreciate your help... -
Using an AIX archive file as a library for an external procedure.
I cannot use an archive file, created with the ar command, that contains a shared object that was created with the xlc and ld commands as a library for external procedures. I can use the shared object file created with the ld command as a library for an external procedure. Why would I encounter an invalid magic number and what is the resolution?
Example:
oracle:@husk21:/home/oracle> ksh -x ./Oracle_demo.ksh
+ rm shell.o shell.so shell.so.exp shell.so.imp
+ make -f /u01/oracle/product/11.1.0.7/db/rdbms/demo/demo_rdbms32.mk extproc_no_context SHARED_LIBNAME=shell.so OBJS=shell.o
/u01/oracle/product/11.1.0.7/db/bin/oraxlc -q32 -c -I/u01/oracle/product/11.1.0.7/db/rdbms/demo -I/u01/oracle/product/11.1.0.7/db/rdbms/public -I/u01/oracle/product/11.1.0.7/db/plsql/public -I/u01/oracle/product/11.1.0.7/db/network/public -I/u01/oracle/product/11.1.0.7/db/precomp/public shell.c
generate_export_list() { /bin/nm -X32_64 -B -h -g "$1" | grep -v ' U ' | awk '{print $3}' | egrep -v '^\.|^TOC' | sort | uniq ; }; generate_import_list() { LIB_NAME=$1; IMP_FILE=$2; cat /u01/oracle/product/11.1.0.7/db/rdbms/lib/xa.imp | head -1 | awk '{print $0, "." }' > ${IMP_FILE}; /bin/nm -X32_64 -C -B -h -g ${LIB_NAME} | grep ' U ' | grep -v "::" | grep -v "(" | grep -v "\.cc" | awk '{print $3}' | sed -e "s/\.//g" | grep -v "^_" >> ${IMP_FILE}; }; generate_import_list shell.o shell.so.imp; generate_export_list shell.o > shell.so.exp; /bin/ld -b32 -bnoentry -bM:SRE -bE:shell.so.exp -bI:shell.so.imp -o shell.so shell.o -L/u01/oracle/product/11.1.0.7/db/lib -lc_r -lm
ld: 0711-224 WARNING: Duplicate symbol: .system
ld: 0711-224 WARNING: Duplicate symbol: system
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
oracle:@husk21:/home/oracle> ar rv libshell.a shell.so
ar: Creating an archive file libshell.a.
a - shell.so
oracle:@husk21:/home/oracle> ar tv libshell.a
rwxr-xr-x 3514/3516 1263 Sep 08 10:00 2009 shell.so
oracle:@husk21:/home/oracle> file shell.so
shell.so: executable (RISC System/6000) or object module not stripped
oracle:@husk21:/home/oracle> file libshell.a
libshell.a: archive (big format)
SQL> CREATE OR REPLACE LIBRARY shell_lib is '/home/oracle/libshell.a';
/ 2
Library created.
SQL> CREATE OR REPLACE PROCEDURE shell(command IN char)
AS EXTERNAL
NAME "shell"
LIBRARY shell_lib
LANGUAGE C
PARAMETERS (command string);
/ 2 3 4 5 6 7
Procedure created.
SQL> exec shell('ls');
BEGIN shell('ls'); END;
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: 0509-022 Cannot load module /home/oracle/libshell.a.
0509-103 The module has an invalid magic number.
ORA-06512: at "V500.SHELL", line 1
ORA-06512: at line 1
SQL> CREATE OR REPLACE LIBRARY shell_lib is '/home/oracle/shell.so';
2 /
Library created.
SQL> exec shell('ls');
PL/SQL procedure successfully completedUsing an AIX archive file as a library for an external procedure.
-
External Procedure call from Trigger
I'd like to call an external C Procedure from
an Oracle Trigger.
In trying to get an example to work, after setting up the listener and tnsnames.ora for external procedures, the following SQL*Plus command behaves strangely:
CREATE LIBRARY TTest as "c:\winnt\system32\TTrigger.dll";
After entering this, the command line prompts for more data as if the command was not terminated. Tried single quotes, double quotes, forward slash, backward slash...
What is wrong with this command?
Thankshi,
COuld you send me the configuration parameters for listner and TNSNAMES? I am working so hard to set it up but getting stuck and I am sure that I am missing some configuration set up.
Please could you mail your tnsname a nd listner files to bellow shown address?
[email protected] ?
Thanks in advance
Suresh -
Not able to create Oracle External Procedure to Run Host Commands
Trying to follow this article
http://timarcher.com/node/9
Its related to
Oracle External Procedure to Run Host Commands
steps
1)mkdir –p /u01/app/usfapp/oracle_external_procs/oracle_host
2)
Author is suggesting to create a file
but header file is missing in very first line... may be not sure..say it is <stdio.h>Create a file named oracle_host.c. The contents of this file will be:
#include
int RunCmd(char *cmd)
return(system(cmd));
4) Create the file named makefile. The contents of this file will be:
oracle_host: oracle_host.o
gcc -shared -o oracle_host.so oracle_host.o
$ cat makefile
oracle_host: oracle_host.o
gcc -shared -o oracle_host.so oracle_host.o
5)
Now run the command make
The output on my server looks like:
[u01/app/usfapp/oracle_external_procs/oracle_host]
banner@usfbannerte [TRNG] > make
gcc -shared -o oracle_host.so oracle_host.o
here I stuck .. Not able to run this step ]$ make
gcc -shared -o oracle_host.so oracle_host.o
/usr/bin/ld: oracle_host.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
oracle_host.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [oracle_host] Error 1
Any one has any idea what went wrong
Any other link related to this is most welcomed.
Please suggest ...hi
please update
or
provide any other link / document for
Oracle External Procedure to Run Host Commands
--using c
Thanks in advance. -
Rebuilding an External Procedure
Hi,
I'm currently having trouble with my external procedure. It's working, I can call it and it will do it's job but I have to debug it. But when I rebuild it, oracle still uses the old lib. Even if a delete the library it will still work. How can I force oracle to get the last library?
Thanks,
Matthieu LevesqueCorrection... the program I'm using is Data Rescue II, not File Salvage II. The latter is actually called just 'File Salvage' and is good to use as a last-ditch effort when all else has failed. I say last ditch because though it WILL pull files back from the great beyond, it does so without the actual file name. Great for pictures, not so great for design docs.
15" Powerbook G4 1.33 GHz Mac OS X (10.4.3) -
Error using EXTERNAL PROCEDURES on UNIX
I'm having troubles to run external procedures on UNIX. I'm following the extern.c example that comes by default. It works very well on my NT enviornment, but not on Unix.
I compiled the share library on my solaris OS, and then I create the library, procedures,etc.
But when I try to run the procedure I received the following error:
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: ld.so.1: extprocextproc: fatal: libucb.so.1: open failed: No such
file or directory
ORA-06512: at "SAMPLE.PLS_MAX", line 0
ORA-06512: at "SAMPLE.USEIT", line 8
ORA-06512: at line 1I'm having troubles to run external procedures on UNIX. I'm following the libtest1.c example that comes by default. It works very well on my NT enviornment, but not on Unix.
I compiled the share library on my solaris OS, and then I create the library, procedures,etc.
But when I try to run the procedure I received the following error:
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: Unresolved external
ORA-06512: at "YDBROW.ORA_TEST", line 0
ORA-06512: at line 8 -
SQL Developer and External Procedures not in tree.
Does sql Dveloper add external procedures to the object browser tree? I have SQL Developer 1.5 and if you have external procedures/functions before your regular PLSQL objects they will not display in the tree. I can make the tree work but the tree still doesn't capture the externals. Am I doing something wrong or should this be a feature request?
VSAMPLE1 shows the problem.
VSAMPLE2 is a try to resolve...
/* the problem.. */
CREATE OR REPLACE package VSAMPLE_1 IS
PROCEDURE foobar(feedname IN VARCHAR2);
END VSAMPLE_1;
CREATE OR REPLACE PACKAGE BODY VSAMPLE_1
IS
* Function Name:- canread
* Description :-This function checks the file will give any error or not while reading
FUNCTION canread (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.canRead (java.lang.String) return int';
* Function Name:- is_exist
* Description :-This function checks the existance of the filein the required folder
FUNCTION is_exist (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.exists (java.lang.String) return int';
* Function Name:- isDirectory
* Description :-This function checks the name provided by the user is a directory or not
FUNCTION isDirectory (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.isDirectory (java.lang.String) return int';
* Function Name:- isFile
* Description :-This function checks the name provided by the user is a file or not
FUNCTION isFile (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.isFile (java.lang.String) return int';
* Function Name:- isExist
* Description :-This function checks the existance of file,correctness of the directory provided by the user.
* @Param file_name :- File Name in directory
* @return retcode :- Error checking while uploading the feed.
FUNCTION isExist(file_name IN VARCHAR2,
is_dir BOOLEAN)
RETURN PLS_INTEGER
IS
retcode PLS_INTEGER := -1;
v_errcode PLS_INTEGER;
v_errtext VARCHAR2(1000);
l_section_name VARCHAR2(32) := 'isExist ' ;
BEGIN
IF VTMLOG.isDebugEnabled THEN
VTMLOG.debug(l_section_name,$$PLSQL_LINE, 'Checking existense of '||file_name);
END IF;
retcode := is_exist(file_name);
IF retcode = 1 THEN
IF is_dir THEN
retcode := isDirectory(file_name);
ELSE
retcode := isFile(file_name);
END IF;
IF retcode = 1 THEN
retcode := canread(file_name);
IF retcode != 1 THEN
VTMLOG.error(l_section_name,$$PLSQL_LINE, ' Can not read ' || file_name);
END IF;
ELSE
VTMLOG.error(l_section_name,$$PLSQL_LINE, ' Unable to check if ' || file_name || ' is directory or file ');
END IF;
ELSE
VTMLOG.error(l_section_name,$$PLSQL_LINE, file_name || ' does not exist ');
END IF;
VTMLOG.debug(l_section_name,$$PLSQL_LINE, 'Leaving ' );
RETURN retcode;
EXCEPTION
WHEN OTHERS THEN
VTMLOG.SHOW_ERROR_MESSAGE(l_section_name,$$PLSQL_LINE);
RAISE;
END isExist;
PROCEDURE foobar(feedname VARCHAR2)
IS
retval PLS_INTEGER;
BEGIN
/* implementation omitted */
retval := isExist('feed.txt',false);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END foobar;
END VSAMPLE_1;
/* This version at least shows the tree. But I can't reach the external by clicking in the navigation tree just the placeholders */
PROCEDURE foobar(feedname IN VARCHAR2);
END VSAMPLE_2;
CREATE OR REPLACE PACKAGE BODY VSAMPLE_2
IS
FUNCTION canread (FILE IN VARCHAR2) RETURN NUMBER;
FUNCTION is_exist (FILE IN VARCHAR2) RETURN NUMBER;
FUNCTION isDirectory (FILE IN VARCHAR2) RETURN NUMBER;
FUNCTION isFile (FILE IN VARCHAR2) RETURN NUMBER;
* Function Name:- isExist
* Description :-This function checks the existance of file,correctness of the directory provided by the user.
* @Param file_name :- File Name in directory
* @return retcode :- Error checking while uploading the feed.
FUNCTION isExist(file_name IN VARCHAR2,
is_dir BOOLEAN)
RETURN PLS_INTEGER
IS
retcode PLS_INTEGER := -1;
v_errcode PLS_INTEGER;
v_errtext VARCHAR2(1000);
l_section_name VARCHAR2(32) := 'isExist ' ;
BEGIN
IF VTMLOG.isDebugEnabled THEN
VTMLOG.debug(l_section_name,$$PLSQL_LINE, 'Checking existense of '||file_name);
END IF;
retcode := is_exist(file_name);
IF retcode = 1 THEN
IF is_dir THEN
retcode := isDirectory(file_name);
ELSE
retcode := isFile(file_name);
END IF;
IF retcode = 1 THEN
retcode := canread(file_name);
IF retcode != 1 THEN
VTMLOG.error(l_section_name,$$PLSQL_LINE, ' Can not read ' || file_name);
END IF;
ELSE
VTMLOG.error(l_section_name,$$PLSQL_LINE, ' Unable to check if ' || file_name || ' is directory or file ');
END IF;
ELSE
VTMLOG.error(l_section_name,$$PLSQL_LINE, file_name || ' does not exist ');
END IF;
VTMLOG.debug(l_section_name,$$PLSQL_LINE, 'Leaving ' );
RETURN retcode;
EXCEPTION
WHEN OTHERS THEN
VTMLOG.SHOW_ERROR_MESSAGE(l_section_name,$$PLSQL_LINE);
RAISE;
END isExist;
PROCEDURE foobar(feedname VARCHAR2)
IS
retval PLS_INTEGER;
BEGIN
/* implementation omitted */
retval := isExist('feed.txt',false);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END foobar;
* Function Name:- canread
* Description :-This function checks the file will give any error or not while reading
FUNCTION canread (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.canRead (java.lang.String) return int';
* Function Name:- is_exist
* Description :-This function checks the existance of the filein the required folder
FUNCTION is_exist (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.exists (java.lang.String) return int';
* Function Name:- isDirectory
* Description :-This function checks the name provided by the user is a directory or not
FUNCTION isDirectory (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.isDirectory (java.lang.String) return int';
* Function Name:- isFile
* Description :-This function checks the name provided by the user is a file or not
FUNCTION isFile (FILE IN VARCHAR2)
RETURN NUMBER AS LANGUAGE JAVA NAME 'com.myCompany.myApp.bulk.FileUtil.isFile (java.lang.String) return int';
END VSAMPLE_2;
/Hi,
I am afraid that according to the error message, it seems that this issue is mainly related to third-party, since issues using oracle database are not supported here, you could consider posting this issue in its website to get supports.
In addition, you could mark any reply as answer if it is helpful.
Thanks for your understanding.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
IPhone not connecting to WEP 128 Wireless network after 1.0.2 upgrade
Hello all, I have the iphone since the last week. I was pretty happy with it until I upgraded the iphone to version 1.0.2. From that very moment, the WEP Hex/ASCII Key option dissapeared when setting a connection to a wireless network. Mine was worki
-
Change Storage Bin Number in 309 movement type
Hi Gurus, I have problems with creation TO for movement type 309(material to material posting), when i want to create the TO for that movement type, i can't change the destination bin.. The destination bin field in that TO is disable, how to make tha
-
I want to implement AutoComplete search functionality to form field using freely available JQuery. Now, I have a fully functional, simplified code that works perfectly with a .cfm page, but I have been struggling to convert it to a cfc file, namely t
-
Reducing shared pool latch contention
I see a lot of shared pool latch contention on my 11gR2 database because there are over 100 identical schemas that run identical SQL. This causes lots of child cursors to be created. Scheduled jobs kick off hourly for every schema at the same time an
-
Hey, We're using RD Web Access on 2008 R2. We've got the Web.Config file set to Windows authentication (for integrated) so internal, domain-joined clients can get to the web page without having to log in. We then publish the RDWeb Access web site thr