Parameter types in FORTRAN DLL's
Hi
I am a novice to fortran programing but want to use existing fortran code
within Labview. I have Digital Visual Fortran 5.0A and have suceeded in making
an elementary .DLL and calling it with the Labview call library function.
However, this only works if I set the parameter types to 'Adapt to Type'.
If I try to specify the types Labview crashes with an invalid page fault.
This particular example has only real parameters. I have tried with arrays
and have even less sucess as the 'Adapt to Type' option does not even work
in these cases.
Any help or explanation would be most appreciated.
Rory Stieger
PS : If it's any help here is the fortran code (the commented out bits for
the test with arrays)
ccccccccccccccccc
cccccccccccccccccccccccccc
c subroutine ftoc (n,f,c)
subroutine ftoc (f,c)
implicit none
!DEC$ ATTRIBUTES DLLEXPORT :: ftoc
!DEC$ ATTRIBUTES ALIAS :'ftoc'::ftoc
c integer n,i
c real*8 f,c(n)
real*8 f,c
c do i=1,n
c c(i) = (5.0/9.0) * (f*i-32.0)
c = (5.0/9.0) * (f-32.0)
c end do
return
end
ccccccccccccccccccccccccccccccccccccccccccc
[posted and mailed]
[email protected] (Rory Stieger) wrote in <[email protected]>:
>
>Hi
>
>I am a novice to fortran programing but want to use existing fortran
>code within Labview. I have Digital Visual Fortran 5.0A and have
>suceeded in making an elementary .DLL and calling it with the Labview
>call library function.
>
>
>However, this only works if I set the parameter types to 'Adapt to
>Type'. If I try to specify the types Labview crashes with an invalid
>page fault. This particular example has only real parameters. I have
>tried with arrays and have even less sucess as the 'Adapt to Type'
>option does not even work in these cases.
>
>Any help or explanation would be most appreciated.
>
>Rory Stieger
>
>PS : If it's any help here is the fortran code (the commented out bits
>for the test with arrays)
>
>ccccccccccccccccccccccccccccccccccccccccccc
>c subroutine ftoc (n,f,c)
> subroutine ftoc (f,c)
> implicit none
> !DEC$ ATTRIBUTES DLLEXPORT :: ftoc
> !DEC$ ATTRIBUTES ALIAS :'ftoc'::ftoc
>c integer n,i
>c real*8 f,c(n)
> real*8 f,c
>c do i=1,n
>c c(i) = (5.0/9.0) * (f*i-32.0)
> c = (5.0/9.0) * (f-32.0)
>c end do
> return
> end
>ccccccccccccccccccccccccccccccccccccccccccc
>
First of all when passing arrays you need to define them before passing
them to the call library node. So use the init tool before hand to allocate
memory for the array before passing it (This causes a lot of crashes if not
done correctly).
Secondly, the type of call the dll uses is important. Usually you can set
the dll fucntions to have the standard call and you then configure the call
library node to take this into account.
Thirdly, you need to find out how fortran passes parameters. I cannot
remember enough of my fortran to help. But, for example if all values are
passed by reference then configure all your call library parameters as
(*varname). Otherewise by value they would be (varname). In the example
above if they are not passed by reference then you will not receive any
valid value in "c" on return from the subroutine.
Fourthly, some function calls in some languages return values by default
even though the standard way of accessing them might not use the return
value. Check out whether fortran is returning a void function, otherwise
you might need to set up a return in the call library node.
Lastly, make sure that the types match in the parameters. For example is
your int 32 or 16 bit by default?
cheers, Alex.
Alexander C. Le Dain, PhD
ICON Technologies Pty Ltd
http://www.icon-tech.com.au
Similar Messages
-
Question on the parameter type of DLL functions
Question on the parameter type of DLL functions
I am trying to develop an interface to control a laser with LV8.2 I am planing to use the VI “Call Library Function Node” to call the DLL and set the exact same parameters of functions in the DLL.
According to the DLL manual of the laser, there are six functions. One of the prototypes is: function getstatuspointer : pointer. I don't know how to set this parameter for the function. Is there anyone who can give some hints? Thanks!
BTW :The following is a description of the function:
This function returns a 32 bit pointer to the STATUS data structure (Tstatusrec). In the 32 bit DLL, every application is using its own copy of the data structure (local
memory). The data structure is a packed structure. "packed" means that the fields in the structure are not aligned on word or double-word boundaries.
Tstatusrec = packed record
size : word;
initstat : byte;
queuefill : byte;
anzapp16 : word; (not used)
anzapp32 : word;
anzdock16 : word; (not used)
anzdock32 : word;
dll16ver : tchararray; (not used)
dll32ver : tchararray;
excimerver : tchararray;
excimer : TExcimerStatus;
end;Hi Jack,
This is a good starting point when using Call Library Function node. Check out this Help Page
Van L
NI Applications Engineer -
Type librarys for DLL functions that TestStand understands for parameter information
Using the C/C++ DLL call adapter I would like to specify a call to a DLL function and have TestStand (3) understand the parameter information.
Usually it says 'there is no parameter information available'. Today however I tried building a DLL in Visual C++ instead of CVI and got a bit further. TestStand recognized that there WAS parameter type information but then said 'The type library for this DLL does not contain enough information to determine whether this function parameter is a pointer to a single item, or an array of items."
So in a nutshell, does anyone know what options (in CVI or MSVC) I need to build with so that TestStand recognizes the function prototypes exported in the DLL? After all it's alot of work to type in all that parameter information.
Many thanks,
Ronnie
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009In CVI, you can get the parameter information into a DLL. First of all, you have to have a function panel (.fp) file with all of your exported functions defined as function panels. From this function panel file you can also generate a windows help file to document your DLL. Once you have the .fp file and .hlp file, you can enable references to them in the build target settings (Build->Target Settings...). Select "Type Library..." and check "Add type library resource to DLL" and "include links to help file" then browse to your .fp file. If there are descepencies between the functions defined in your .fp file and the actual functions you have exported in the DLL, then you may get a compiler error.
--Peter -
How to call Fortran .dll file that using other library files?
Hi,
I am trying to do some arkward tasks using LabView, and I am desperately need help....
A little bit background:
1. My co-worker has some code written in Fortran, where he called other libraries (many from CERNLAB or PAW). Those stuffs are pretty powerful in mathmatical calculation and simulations.
2. In some of my LabView code, I need to call his Fortran source code in order to do some complicated calculations. I have no capablility to translate his Fortran code to Labview (or is it even possible??), so we end up with trying to use "Call library function node" where I just provide input/outputs to communicate with his code. The idea sounds simple enough?
3. We complie the Fortran code into .dll, and then specifiy the dll in "Call library function node". The first try with a very simple Fortran code, something like c = a+b*a, was sucessful. The dll file and Call lib function worked good. It's sort of proved the concept.
4. Now I am trying more complicated Fortran code (say Test.dll), which calling other library (.lib files) that using typical "call xxx(a,b,c)" line, and my nightmare started.... It seems nothing was excuted when I call Test.dll in LabView.
Questions:
1. How do LabView know if the Test.dll code needs functions from other .lib files? Do I need to copy all the .lib files to a specific folder?
2. When I create .dll file, for LabView to be able to use it, are there any special requirement on the way the .dll is compiled?
3. Seems there is mismatch btw the data type in Fortran and LabView. For example, LabView's Signed 8-bit Integer seems different with a integer in Fortran. How can i know the correlation btw data type in different langurage, i.e. LabView vs Fortran?
4. Are there any good examples that I can take a look?
I would highly appreicate any suggestions/helps!
Rgds,
HarryYou are aware that Intel Visual Fortran is the successor to Compaq Visual Fortran (I think you made a mistype with the Virtual)? So an upgrade might be at its place.
Anyhow I'm really not familiar with Fortran at all, but lib files are usually compiled into an EXE or DLL and not loaded dynamically. 1)
So there should be no problem with locating those libs. What most likely is a problem are other DLL dependencies such as any Fortran Runtime library or possibly other third party DLLs the more advanced code in your DLL might be using.
Typically most compilers can be configured to link the runtime library code statically into the DLL, as altenbach reports for the Intel compiler, otherwise you must make sure to install the redistributable Fortran Runtime Library for your compiler. Besides that you must make sure to find out what other runtime dependencies your code might have and install them.
1) One exception I know of is LabWindows CVI which allows to also load lib files dynamically. This is supposedly a legacy feature from LabWindows for DOS, which allowed that feature to simulate dynamic module loading in order to swap modules at runtime to work around the 640k memory limitation of DOS.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Struct in type library for DLL called from Visual Basic
Wrong dicsussion board, sorry.
Menchar
Message Edited by menchar on 10-20-2008 01:28 PMIn CVI, you can get the parameter information into a DLL. First of all, you have to have a function panel (.fp) file with all of your exported functions defined as function panels. From this function panel file you can also generate a windows help file to document your DLL. Once you have the .fp file and .hlp file, you can enable references to them in the build target settings (Build->Target Settings...). Select "Type Library..." and check "Add type library resource to DLL" and "include links to help file" then browse to your .fp file. If there are descepencies between the functions defined in your .fp file and the actual functions you have exported in the DLL, then you may get a compiler error.
--Peter -
Hello,
I am beating my head against the wall trying to get a fortran DLL to work in labview.
The DLL has multi-dimensional array inputs, and my guess is that my problem lies in correctly configuring the Call LibraryFunction.
The dll is very complex, but I know the dll works, because I have a visual basic program that calls the dll, and it works fine.
A simplified version of the DLL variable definition from the Fortran code is shown below:
Subroutine MyFunction(Numx,V,dz,ep,nx,top,D)
c
c *** Set DLL Attributes ***
c
!DEC$ ATTRIBUTES DLLEXPORT :: MyFunction
!DEC$ ATTRIBUTES ALIAS:'MyFunction' :: MyFunction
c
c *** Declare Variables ***
implicit real*8 (r-w)
integer sizex,sizey,sizez
parameter (sizex = 50,sizey = 50,sizez = 20)
c
c *** Variables passed from the control routine ***
c
integer D
integer Numx
real*8 V(0:sizex,0:sizey,0:3*sizez)
real*8 dz
real*8 ep(2)
real*8 nx(0:sizex,0:sizey,0:sizez)
integer top(0:sizex,0:sizey)
c
c *** The rest of the program ***
As you can see the inputs consist of Integers, 2D integer arrays, 3D double arrays, a 1d double array, and double inputs.
When I configure the call library function I have tried both calling conventions (C and stdcall) I have defined the integers as I32 (signed integers), I have configured the arrays as Array Format=Array Data Pointer. The input arrays have been pre-defined in labview as: V is 50x50x60, nx is 50x50x20, top is 50x50 and ep=2, which is the array size that they are defined in the fortran program.
I have tried all the different values for Array Format. I have tried both calling conventions and both thread selections. I'm working in LV 8.5
Everytime I try to run the program I get and error 1097 (An exception occured within external code).
I'm almost certain that the problem lies with how I'm configuring the DLL call.
I also have a dll called DFORMD.dll in the working directory (I'm pretty sure it's suppose to be there, but I don't know what to do with it).
The suggestion from my phone call to ni support was to wrap the fortran dll in a C dll, because labview cannot use fortran calling conventions. However, the posts on this forum seem to suggest that I should be able to use the fortran DLL directly.
Any help would be appreciated.
NeilAccording to this page
http://blogs.msdn.com/oldnewthing/archive/2004/01/02/47184.aspx
Fortran calling convention is the same as Pascal calling convention and according to
this wikipedia article
http://en.wikipedia.org/wiki/X86_calling_conventions
Pascal and stcall conventions are both callee clean-up convention, but the parameters
are passed to stack in different order. This might be the problem.
You could try to make a Fortran function with only one parameter and try to call that with stdcall convention.
In case of parameter, it does not matter in which order the parameters are passed to stack.
Maybe you can change the calling convention in your Fortran code when creating the DLL.
Unfortunately I don't know anything about Fortran, but hopefully this helps and gives you some ideas for this. -
Hello.
During developing Domain Index for Oracle 11.2.0.1.0 (problem also appears in 12с) i was faced with misunderstanding of parameter types of function
ODCIIndexInsert in case of creating indextype WITH ARRAY DML option
According to Oracle documentation
http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/ext_idx_ref.htm#i76892
In case of WITH ARRAY DML option Oracle will invoke ODCIIndexInsert with following signature
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
RETURN NUMBER
In my case indexed column has datatype NUMBER so i defined varray_of_column_type as SYS.ODCINumberList
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER
Indextype was created as
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
or
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
(problem occurs in all cases)
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
When attempting to insert data in the table
insert into test_table values (1);
oracle raise exception
Error starting at line 53 in command:
insert into test_table values (1)
Error at Command Line:53 Column:1
Error report:
SQL Error: ORA-29925: cannot execute SCOTT.INDEX_METHODS.ODCIINDEXINSERT
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
29925. 00000 - "cannot execute %s"
*Cause: The specified function does not exist or does not have an
appropriate signature.
*Action: Implement the function with the appropriate signature.
So my question is.
Is it normal behavior of oracle (according to documentation)?
What is correct signature of ODCIIndexInsert function in case of INDEXTYPE creation with 'WITH ARRAY DML' option and fact that indexed column has NUMBER datatype?
By the way if i define indextype without 'WITH ARRAY DML' option signature is clear, and working. But this approach doesn't satisfies our performance needs.
Also if i define index type with option 'WITH ARRAY DML WITHOUT COLUMN DATA' and use signature
static function ODCIIndexInsert(ia sys.odciindexinfo, ridlist sys.odciridlist, env sys.ODCIEnv) return number
Everything works too. But this approach doesn't satisfies our business needs.
Is it a way to define ODCIIndexInsert parameter types (in case of indexing number column) so that batch inserting works according to documentation ?
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
I am attaching full sql script to recreate environment and reproduce the problem.
Type definition:
CREATE OR REPLACE TYPE index_methods AS OBJECT
step number,
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
CREATE OR REPLACE TYPE BODY index_methods IS
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
BEGIN
ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
RETURN ODCIConst.Success;
END ODCIGetInterfaces;
STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexCreate;
STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexDrop;
STATIC FUNCTION ODCIIndexAlter (
ia sys.ODCIIndexInfo,
parms IN OUT VARCHAR2,
altopt NUMBER,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexAlter;
STATIC FUNCTION ODCIIndexUpdPartMetadata(
ia sys.ODCIIndexInfo,
palist sys.ODCIPartInfoList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexUpdPartMetadata;
STATIC FUNCTION ODCIIndexExchangePartition(
ia sys.ODCIIndexInfo,
ia1 sys.ODCIIndexInfo,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexExchangePartition;
STATIC FUNCTION ODCIIndexInsert(
ia sys.ODCIIndexInfo,
ridlist sys.ODCIRidList,
newvallist sys.ODCINumberList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexDelete(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
env SYS.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexUpdate(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
newval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexStart(
sctx IN OUT index_methods,
ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo,
qi sys.ODCIQueryInfo,
strt number,
stop number,
cmpval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
sctx := index_methods(1);
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexFetch(
self IN OUT index_methods,
nrows NUMBER,
rids OUT SYS.ODCIridlist,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
end;
Problem workaround:
--drop function test_eq_fun;
CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
BEGIN
IF a = b then
RETURN 1;
ELSE
RETURN 0;
END IF;
END;
--drop operator test_eq;
CREATE OPERATOR test_eq
BINDING (number, number) RETURN NUMBER
USING test_eq_fun;
--drop indextype test_index_type;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
--drop table test_table;
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
insert into test_table values (1);I get single for 1 row and batch for 2 or more rows in the following simplified simulation.
SCOTT@orcl12c> DESC SYS.ODCINUMBERLIST
SYS.ODCINUMBERLIST VARRAY(32767) OF NUMBER
SCOTT@orcl12c> CREATE OR REPLACE TYPE index_methods AS OBJECT
2 (
3 step number,
4 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
5 STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
6 STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
7 STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
8 STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
9 STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
10 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, rid in VARCHAR2, newval in NUMBER, env in SYS.ODCIEnv) RETURN NUMBER,
11 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in your_type, env in SYS.ODCIEnv) RETURN NUMBER,
12 STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
13 STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
14 STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
15 op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
16 MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
17 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
18 );
19 /
Type created.
SCOTT@orcl12c> CREATE OR REPLACE TYPE BODY index_methods IS
2 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
3 BEGIN
4 ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
5 RETURN ODCIConst.Success;
6 END ODCIGetInterfaces;
7
8 STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
9 BEGIN
10 RETURN ODCIConst.Success;
11 END ODCIIndexCreate;
12
13 STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
14 BEGIN
15 RETURN ODCIConst.Success;
16 END ODCIIndexDrop;
17
18 STATIC FUNCTION ODCIIndexAlter (
19 ia sys.ODCIIndexInfo,
20 parms IN OUT VARCHAR2,
21 altopt NUMBER,
22 env sys.ODCIEnv)
23 RETURN NUMBER IS
24 BEGIN
25 RETURN ODCIConst.Success;
26 END ODCIIndexAlter;
27
28 STATIC FUNCTION ODCIIndexUpdPartMetadata(
29 ia sys.ODCIIndexInfo,
30 palist sys.ODCIPartInfoList,
31 env sys.ODCIEnv)
32 RETURN NUMBER IS
33 BEGIN
34 RETURN ODCIConst.Success;
35 END ODCIIndexUpdPartMetadata;
36
37 STATIC FUNCTION ODCIIndexExchangePartition(
38 ia sys.ODCIIndexInfo,
39 ia1 sys.ODCIIndexInfo,
40 env sys.ODCIEnv)
41 RETURN NUMBER IS
42 BEGIN
43 RETURN ODCIConst.Success;
44 END ODCIIndexExchangePartition;
45
46 STATIC FUNCTION ODCIIndexInsert(
47 ia sys.ODCIIndexInfo,
48 rid VARCHAR2,
49 newval NUMBER,
50 env sys.ODCIEnv)
51 RETURN NUMBER IS
52 BEGIN
53 dbms_output.put_line ('single');
54 return ODCIConst.Success;
55 END;
56
57 STATIC FUNCTION ODCIIndexInsert(
58 ia sys.ODCIIndexInfo,
59 ridlist sys.ODCIRidList,
60 newvallist your_type,
61 env sys.ODCIEnv)
62 RETURN NUMBER IS
63 BEGIN
64 dbms_output.put_line ('batch');
65 return ODCIConst.Success;
66 END;
67
68 STATIC FUNCTION ODCIIndexDelete(
69 ia SYS.ODCIIndexInfo,
70 rid VARCHAR2,
71 oldval number,
72 env SYS.ODCIEnv)
73 RETURN NUMBER IS
74 BEGIN
75 return ODCIConst.Success;
76 END;
77
78 STATIC FUNCTION ODCIIndexUpdate(
79 ia SYS.ODCIIndexInfo,
80 rid VARCHAR2,
81 oldval number,
82 newval number,
83 env SYS.ODCIEnv)
84 RETURN NUMBER AS
85 BEGIN
86 return ODCIConst.Success;
87 END;
88
89 STATIC FUNCTION ODCIIndexStart(
90 sctx IN OUT index_methods,
91 ia SYS.ODCIIndexInfo,
92 op SYS.ODCIPredInfo,
93 qi sys.ODCIQueryInfo,
94 strt number,
95 stop number,
96 cmpval number,
97 env SYS.ODCIEnv)
98 RETURN NUMBER AS
99 BEGIN
100 sctx := index_methods(1);
101 return ODCIConst.Success;
102 END;
103
104 MEMBER FUNCTION ODCIIndexFetch(
105 self IN OUT index_methods,
106 nrows NUMBER,
107 rids OUT SYS.ODCIridlist,
108 env SYS.ODCIEnv)
109 RETURN NUMBER AS
110 BEGIN
111 return ODCIConst.Success;
112 END;
113
114 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
115 BEGIN
116 return ODCIConst.Success;
117 END;
118 end;
119 /
Type body created.
SCOTT@orcl12c> CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
2 BEGIN
3 IF a = b then
4 RETURN 1;
5 ELSE
6 RETURN 0;
7 END IF;
8 END;
9 /
Function created.
SCOTT@orcl12c> CREATE OPERATOR test_eq
2 BINDING (number, number) RETURN NUMBER
3 USING test_eq_fun
4 /
Operator created.
SCOTT@orcl12c> CREATE INDEXTYPE test_index_type
2 FOR
3 test_eq(number, number)
4 USING index_methods
5 WITH ARRAY DML(number, your_type)
6 WITH LOCAL RANGE PARTITION
7 WITH SYSTEM MANAGED STORAGE TABLES
8 /
Indextype created.
SCOTT@orcl12c> CREATE TABLE test_table (id NUMBER (19,0))
2 /
Table created.
SCOTT@orcl12c> CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type
2 /
Index created.
SCOTT@orcl12c> insert into test_table values (1)
2 /
single
1 row created.
SCOTT@orcl12c> insert into test_table
2 select 2 from dual union all
3 select 3 from dual
4 /
batch
2 rows created.
SCOTT@orcl12c> insert into test_table select deptno from dept
2 /
batch
4 rows created.
SCOTT@orcl12c> insert into test_table select object_id from user_objects
2 /
batch
34 rows created.
SCOTT@orcl12c> -
When/How to use - "search" parameter type in parameter like other types.
We recently upgraded BI Publisher to 10.1.3.4. I saw new parameter type "search" in parameter section, when creating report. whats the use of it? How to use it ? like other parameter type Text, Menu,Hidden, Date.
I couldn't find any help or release notes on this !
Thanks
AyapsI started looking into this parameter type when our drop-down for customer numbers went from 13,000 (manageable) to 45,000 (completely unmanageable).
I imagine this is supposed to mimic the effects of a "Long List" type LOV in Oracle Applications (as I had inquired about in [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=895521&stqc=true|Large List of Values (LoV) hangs. Is there an equivalent for a long list?]), but performance-wise, "Search" does not seem to be any more efficient that using the "Menu" type LOV. Even with the help of having a partial string with a wildcard to match, the "Search" still takes too long to pull up to be of any use to us. -
Parameter type in stored procedure call
What is the best way using ODP.net to reference the parameter type?
I have several stored procedure in a Oracle 9i database.
The database looks like:
Name Null? Type
FLTID NOT NULL NUMBER(10)
PLANEID NOT NULL VARCHAR2(3)
The call in my VB.net app is:
cmd = New OracleCommand("AeronauticsUtils.Flights_insert", conn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New OracleParameter("fID", OracleDbType.Int32, ParameterDirection.Input)).Value = row("FLTID")
cmd.Parameters.Add(New OracleParameter("plnid", OracleDbType.Varchar2, ParameterDirection.Input)).Value = row("PLANEID")
cmd.ExecuteNonQuery()
cmd.Dispose()
What should I use?
OracleDbType.Int32
OracleType.VarChar
Types.OracleDecimal
or something else?I use OracleDbType.Decimal for NUMBER columns and OracleDbType.Varchar2 for VARCHAR2 columns.
Are you having issues?
- Mark
===================================================
Mark A. Williams
Oracle DBA
Author, Professional .NET Oracle Programming
http://www.apress.com/book/bookDisplay.html?bID=378 -
IN,OUT and IN OUT Parameter Types
Dear All,
as per some book,
IN parameter uses Call by Reference
and OUT and IN OUT Uses Call by Value
we can use NOCOPY for Making OUT and IN OUT Call by Reference.
my small doubt is
when u r passing a reference of a Variable how oracle takes care that only IN Parameter are not allowed to change (in c and c++ we can say *para to access the variables) ,
i mean in case i use NOCOPY all parameter type are using CALL BY REFERENCE then how the "No Modify" is forced in case of IN Parameter.
Thanks for Reading Request.
Raj.The pl/sql compiler will simply not allow you to have a stmt that assigns something to an "IN" parameter. It can fully be enforced at compile time.
Tom Best -
How to use INVOKE function with INT parameter types
Can you tell me how to use invoke function with int parameter type ?
Pass the int as an Integer.
-
Web service: parameter types
Hi,
We made an ABAP webservice with input parameters.
In the WSDL the type of the parameters is:
- <wsdl:message name="ZTestWebService2">
<wsdl:part name="Costcenter" type="n0:char10" />
The type char10 is defined like:
- <xsd:simpleType name="char10">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
Question is: is there a way to influence the creation of this types, so that the type is not referring to n0:char10 but to something like char and that the length is also defined in the part name ? Something that is more Java friendly and will not create code for complex types on the client-side ?
Thanks,
Rolf.HI,
No u cant change this parameter dynamically after the release of web service.
When u will release the webservice for a RFC,the WSDL file will be generated.That time it will generate the files for every parameter types which are used in the RFC.
If u want increase this value length,Then u hv to increase the lenght of the parameter in RFC and then release the web service.So that it will come here.
Bcause in webservice lenght will not allow more that the lenghth which u gave in RFC.
Regs
Manas Ranjan Panda -
Hi, all:
I'm trying to configure TrendMicro IOS content filtering. I have this working on a separate box, running 15.1.
On this particular testbed, I have a 2900 running:
System image file is "flash0:c2900-universalk9-mz.SPA.152-3.T1.bin"
And the following licensing:
Technology Package License Information for Module:'c2900'
Technology Technology-package Technology-package
Current Type Next reboot
ipbase ipbasek9 Permanent ipbasek9
security securityk9 Permanent securityk9
uc uck9 Permanent uck9
data datak9 Permanent datak9
Configuration register is 0x2102
CUBE_GOLD_MEX#show ip trm subscription status
Package Name: Security & Productivity (Trial)
Status: Active
Status Update Time: 18:02:51 CST Mon Jul 23 2012
Expiration-Date: Mon Aug 20 02:00:00 2012
Last Req Status: Processed response successfully
Last Req Sent Time: 18:02:51 CST Mon Jul 23 2012
CUBE_GOLD_MEX#
Also, I have the following config lines on it:
ip host trps.trendmicro.com 216.104.8.100
ip name-server 4.2.2.2
ip cef
multilink bundle-name authenticated
parameter-map type urlfpolicy trend tm-pmap
allow-mode on
[snip]
parameter-map type trend-global trend-glob-map
class-map type inspect match-all http-imap
match protocol http
class-map type urlfilter trend match-any drop-category
match url category Abortion
match url category Activist-Groups
match url category Adult-Mature-Content
match url reputation ADWARE
match url reputation DIALER
match url reputation DISEASE-VECTOR
match url reputation HACKING
match url reputation PASSWORD-CRACKING-APPLICATIONS
match url reputation PHISHING
match url reputation POTENTIALLY-MALICIOUS-SOFTWARE
match url reputation SPYWARE
match url reputation VIRUS-ACCOMPLICE
policy-map type inspect urlfilter trend-policy
class type urlfilter trend drop-category
I have not been able to get to the good part of configuring the ZBF.
I've looked over several configuration examples and can't figure out what I'm doing wrong, since I'm not able to see the command 'parameter-map' under the 'policy-map urlfiltering'
XXXXXX(config)#policy-map type inspect urlfilter trend-policy
XXXXXX(config-pmap)#?
Policy-map configuration commands:
class policy criteria
description Policy-Map description
exit Exit from policy-map configuration mode
no Negate or set default values of a command
XXXXXX(config-pmap)#
I thought it might be an issue with version 15.2.3, but according to configuration guides, commands are the same.
Can anyone provide some assistance?
TIA.
c.Hi Carlos,
I am having the same problem. I have seen a few diffenent configuration examples and they all show adding the "parameter type urlfpolicy trend parm-map-name" command but it doesn't exist, at least in 15.2(3)T1 and I see it listed in the the IOS documentation for 15.2. Maybe they forgot it :-)
I guess I will open a TAC case as I do not want to downgrade...
I will keep you posted if I find the answer.
Regards,
Troy -
List as function parameter type
Hi,
how to declare list parameter type in function ? I want to call function with list, param2 = ('A', 'B', 'C'...) for example: function(param1, param2)
thxTwo ways....
either you know you have a maximum number of parameters allowed and specify it such as ...
e.g. with a maximum of 10 params...
FUNCTION myfunc (p_param1 IN VARCHAR2 := NULL
,p_param2 IN VARCHAR2 := NULL
,p_param3 IN VARCHAR2 := NULL
,p_param4 IN VARCHAR2 := NULL
,p_param5 IN VARCHAR2 := NULL
,p_param6 IN VARCHAR2 := NULL
,p_param7 IN VARCHAR2 := NULL
,p_param8 IN VARCHAR2 := NULL
,p_param9 IN VARCHAR2 := NULL
,p_param10 IN VARCHAR2 := NULL) IS
...or you pass in an array...
TYPE t_params IS TABLE OF VARCHAR2 INDEX BY PLS_INTEGER;
FUNCTION myfunc (p_params IN t_params) IS
...You can't code it for an unknown amount of parameters. -
Generic Method, How parameter type is determined
For method
<T> void fromArrayToCollection(T[] a, Collection<T> c) { ... } Why does
fromArrayToCollection(sa, co);passes and
fromArrayToCollection(oa, cs); fails.
oa - Object Array, Object[]
cs - Collection of String, Collection<String>
sa - String Array, String[]
co - Collection of Object, Collection<Object>
What are the rules governing the type of T inferred by compiler?epiphanetic wrote:
I think you still haven't fully understood the issue.
I suggest, you also read the same generics tutorial by Gilad Bracha, section 6 from where I found this issue :). Ha! But I think it's misleading that that section uses arrays.
In his words "It will generally infer the most specific type argument that will make the call type-correct." Its also mentioned that collection parameter type has to be supertype of Array parameter type but no reason is given. I wonder why it fails to infer correct type in second case.Assume you passed in an array of Objects, and a Collection of Strings, and it was possible that T would then be Object. Using Bracha's example implementation:
static <T> void fromArrayToCollection(T[] a, Collection<T> c) {
for (T o : a) {
c.add(o); // correct
}Now imagine you had this code making use of it:
Object[] objects = {Integer.valueOf(1), "hi", new Object()};
Collection<String> strings = new LinkedList<String>();
fromArrayToCollection(objects, strings);
String string = strings.iterator().next(); //get first String, which is actually an IntegerTrying to get the first String would give a ClassCastException. So clearly that method cannot not be safely invoked.
The reason I think he's confusing things by using the array is because you might get it in your head that this would be OK:
static <T> void fromCollectionToCollection(Collection<T> one, Collection<T> two) {
for ( T t : one ) {
two.add(t);
Collection<Object> col1; Collection<String> col2;
doSomething(col1, col2);When clearly it's unsafe, as now your Collection of Strings might have a non-String in it! That's why I said this is more a nuance of generic arrays than of type inference proper.
Maybe you are looking for
-
IPhone 4S activation NIGHTMARE, Apple problem, not AT&T
Got new iPhone 4S delivered on release day (Friday, Oct 14). Activated without problem. On Sunday, it quit working except when connected to wall charger. On Monday, called AppleCare, hardware failure was problem. Had choice to pay $29 for them to
-
No information on FS10n layouts
Hi All! I need a report for few GL accounts which includes the following information as main data for several reasons. [Customer, Vendor, Material, Quantity, PO, sales order, reason code]. I need to see GL line item display(all the documents data) fo
-
Concurrent program XML Data template error.
Internal Controls Manager: Version : 12.0.0 Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved. XX_EMP module: xx_emp_cP Current system time is 10-JAN-2009 08:41:41 XDO Data Engine Version No: 5.6.3 Resp: 20420 Org ID : 101 Request ID:
-
Logfile member shows in database but not on physical disk, not match
I just created a standby db through rman duplicat active database from target, and it worked. However when I issued a alter syste switch logfile, it not have anything going on on standby side. I checked the alert log, when the standby db started, it
-
HT1414 Restoring my iPhone 4 problems
I'm trying to restore my iPhone 4, but iTunes won't go past the "Preparing iPhone for restore..." stage after about 30 minutes. Please help.