Pass TestStand error type directly into function parameter
Hi,
I am using TestStand 4 and Labwindows CVI 8.5.
I wonder if it is possible to pass Standard Step error type into CVI function parameters.
I think it would be more simple to pass one parameter instead of passing Error code, Error occurred state and Error message into function prototype.
I tried to use tsErrorDataType struct defined into tsutil.h into my function prototype.
In TestStand, I pass Step error type into function parameter but it does not work.
TestStand displays an error meaning parameters does not match function prototype.
Thank you for your help.
Hi Tartempion,
In order to pass the TestStand Error Container as one parameter to a function in a CVI DLL, you must use a struct that is typedef'ed and create an .fp file that is included as a type library for the DLL. When you create a .fp file to add to a DLL, the DLL will not build unless all structs/enums are typedef'ed. Thus, I wouldn't advise using the tsutil.h because you would have to go through and typedef every single struct and enum in the header file.
Instead, you can simply create a typedef'ed struct in your projects header file and create an .fp file with the struct specified as a data type. Then in TestStand, when you call the function you would need to ensure that the parameter is of Category "C Struct", and type "Error". The attached zip file contains a CVI 8.5 project that demonstrates this along with a TestStand 4.0 sequence file that demonstrates how to pass the parameter to the function by reference. In case you run into trouble creating the .fp file please refer to the following KnowledgeBase. The instructions are for enums but easily correspond to structs as well:
TestStand and LabWindows/CVI Enumeration Data Types
Hope this helps!
Manooch H.
National Instruments
Attachments:
PassTSError.zip 19 KB
Similar Messages
-
How to pass table type variable into function from SQL*PLUS ?
How to pass a table type variable from sql*plus prompt into a function ?
Thanx in advance.Krishna,
Do you mean like this?SQL> DECLARE
2 TYPE t_tbl IS TABLE OF VARCHAR2(20);
3 l_sample_tbl t_tbl;
4
5 FUNCTION print_contents ( p_tbl IN t_tbl )
6 RETURN VARCHAR2
7 IS
8 l_string VARCHAR2(1000);
9 BEGIN
10 FOR i IN 1..p_tbl.COUNT LOOP
11 IF (i = 1) THEN
12 l_string := p_tbl(i);
13 ELSE
14 l_string := l_string || ', ' || p_tbl(i);
15 END IF;
16 END LOOP;
17 RETURN (l_string);
18 END print_contents;
19
20 BEGIN
21 l_sample_tbl := t_tbl();
22 l_sample_tbl.EXTEND;
23 l_sample_tbl(1) := 'one';
24 l_sample_tbl.EXTEND;
25 l_sample_tbl(2) := 'two';
26 l_sample_tbl.EXTEND;
27 l_sample_tbl(3) := 'three';
28 l_sample_tbl.EXTEND;
29 l_sample_tbl(4) := 'four';
30 l_sample_tbl.EXTEND;
31 l_sample_tbl(5) := 'five';
32 DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
33 END;
34 /
one, two, three, four, five
PL/SQL procedure successfully completed.
SQL> HTH,
T. -
Error while calling FM : Function parameter "PE_LFA1" is unknown
Dear Experts,
I am trying to call a FM in my code, but somehow I am getting the following error .Please help !
My code is :
DATA : VENDOR_NO TYPE WSRS_SHVDST_RES-VENDOR_NO,
PE_LFA2 TYPE LFA1,
PE_ADDR2 TYPE BAPIADDR1,
PE_ADRPRT2 TYPE WISO_ADRPRT,
PE_RETURN2 TYPE WSRS_RETURN,
PE_LFM2 TYPE LFM1,
PE_LFB2 TYPE LFB1.
DATA:
node_vendor TYPE REF TO if_wd_context_node,
elem_vendor TYPE REF TO if_wd_context_element,
stru_vendor TYPE if_vendor_view=>element_vendor ,
item_vendorinp LIKE stru_vendor-vendorinp.
navigate from <CONTEXT> to <VENDOR> via lead selection
node_vendor = wd_context->get_child_node( name = if_vendor_view=>wdctx_vendor ).
get element via lead selection
elem_vendor = node_vendor->get_element( ).
get single attribute
elem_vendor->get_attribute(
EXPORTING
name = `VENDORINP`
IMPORTING
value = item_vendorinp ).
VENDOR_NO = item_vendorinp.
CALL FUNCTION 'WSRS_O_VENDOR_GET_DETAIL'
EXPORTING
PE_LFA1 = PE_LFA2
PE_ADDR1 = PE_ADDR2
PE_ADRPRT = PE_ADRPRT2
PE_RETURN =PE_RETURN2
PE_LFM1 = PE_LFM2
PE_LFB1 = PE_LFB2
IMPORTING
PI_VENDOR_NO = VENDOR_NO.
My Error is :
Note
The following error text was processed in the system HE6 : Function parameter "PE_LFA1" is unknown.
The error occurred on the application server hsdnt24s11_HE6_00 and in the work process 5 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: ONACTIONFETCH_VENDOR_DETAILS of program /1BCWDY/A8XPPCRFM5I0CTSGLFDT==CP
Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/A8XPPCRFM5I0CTSGLFDT==CP
Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
Please help.Hi,
I will ask this way, from where did you get list of parameters for this FM? Try using pattern to call this FM, than you will be proposed with correct interface.
EDIT:
After checking it in system you should switch IMPORTING and EXPORTING
CALL FUNCTION 'WSRS_O_VENDOR_GET_DETAIL'
EXPORTING
PI_VENDOR_NO = '99'
* PI_ACCEPT_NOTFOUND =
* PI_PURCH_ORG =
* PI_COMP_CODE =
IMPORTING
PE_LFA1 = lv
* PE_ADDR1 =
* PE_ADRPRT =
* PE_RETURN =
* PE_LFM1 =
* PE_LFB1 =
Best regards
Marcin Cholewczuk
Edited by: Marcin Cholewczuk on Apr 12, 2011 1:20 PM -
Pass a record type vaiable in out parameter of a function in a package
Hi All,
1.I have created a ecod inside a package.
2.Then created a function which has a out parameter of the above record.
3.Now package body i'm creating a dynamic cursor .
4.My equirement is to fetch this dynamic cursor's value into the out parameter of the function.
I have created the below code for 1,2 and 3 but not getting how to achive the point 4.
create package pkg
type t_rec is recod (id number,id_name varchar2(10));
type t_data is table of t_rec index by binary_integer;
act_data t_data;
funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean;
end pkg;
create package body pkg
funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean is
p_cur sys_refcursor;
l_text varchar2(100);
begin
-- As per my requirement i have built a dynamic l_text which contains where clause by taking dept and region values.In actual i have nearly 10 in paramaters with >which i'm building a dynamic where clause in l_text. So i'm using a ref cursor.
open p_cur for 'select id,id_name from tab1'||l_text';
fetch p_cur bulk collect into act_data;
exception ....
end pkg;Now as per the code snippet i could fetch all the rows returned by p_cur into act_data.
But how i will pass it though out parameter in the function which i will use somewhere in front end to show data.
Please help me in this.
Thanks in advance.bp wrote:
i need to create the where clause one the basis of the values of IN parameters.Sometimes i need to take count of the data on the basis of the IN parameters and if one of the conditions return value i will build where clause with those parameters.Please google and read up on the importance of creating shareable SQL - which needs to be done using bind variables.
The ref cursor interface in PL/SQL only support a static/fixed number of bind variables. So if you want to create cursors with variable number of bind values, you need to use conditional processing. E.g.
SQL> create or replace procedure EmpFilter( c OUT sys_refcursor, nameFilter varchar2, jobFilter varchar2 ) is
2 sqlSelect varchar2(32767);
3 begin
4 --// we pretend to built a dynamic SQL statement - so the table
5 --// name and so on is "unknown"
6 sqlSelect := 'select * from emp ';
7 case
8 when nameFilter is null and jobFilter is null then
9 open c for sqlSelect;
10
11 when nameFilter is null and jobFilter is not null then
12 sqlSelect := sqlSelect||'where job like :filter';
13 open c for sqlSelect using jobFilter;
14
15 when nameFilter is not null and jobFilter is null then
16 sqlSelect := sqlSelect||'where ename like :filter';
17 open c for sqlSelect using nameFilter;
18
19 when nameFilter is not null and jobFilter is not null then
20 sqlSelect := sqlSelect||'where ename like :filter1 and job like :filter2';
21 open c for sqlSelect using nameFilter, jobFilter;
22
23 end case;
24
25 DBMS_OUTPUT.put_line( 'Dynamic SQL: '||sqlSelect );
26 end;
27 /
Procedure created.
SQL>
SQL>
SQL> var c refcursor
SQL> begin
2 EmpFilter( :c, 'A%', null );
3 end;
4 /
Dynamic SQL: select * from emp where ename like :filter
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7499 ALLEN SALESMAN 7698 1981/02/20 00:00:00 1600 300 30
7876 ADAMS CLERK 7788 1987/05/23 00:00:00 1100 20
SQL>
SQL> begin
2 EmpFilter( :c, null, 'ANALYST' );
3 end;
4 /
Dynamic SQL: select * from emp where job like :filter
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7788 SCOTT ANALYST 7566 1987/04/19 00:00:00 3000 20
7902 FORD ANALYST 7566 1981/12/03 00:00:00 3000 20
SQL>And this approach is for external clients - where a Visual Basic or Java client program calls the database, executes the stored procedure, and receives a cursor handle in turn. And the client then fetches the output of this cursor and process it.
There is no need to return a record type of any sorts. The client wants the cursor handle as that is the optimal and best interface for the client to receive database data.
If the caller is not an external client, but another PL/SQL procedure, then this approach does not make much sense.
It is important that you understand basic Oracle concepts and fundamentals. What a cursor is. What the best way is to process Oracle data. How to best use the basic features of Oracle. Without that basic understanding, you as good as a low hour Cessna pilot getting into an Airbus A400M - where the Cessna pilot would not even be able to start a single engine, never mind get the plane in the air.
Likewise, without a basic understanding of Oracle cursors and fundamentals, you will be unable to code even a single line of sensible code. Not because you are a bad programmer. Even the best programmer in the world will be unable to write decent code, if the programmer has no idea how the environment works, what the concepts and fundamentals are. But it is fair to expect that a good programmer will no write such code, understand that there is a lack of knowledge, and address that accordingly. -
Passing record type into function [error: identifier must be declared]
Hi,
I have a record type defined in my procedure
type chk_tab is record(
effect date,
count number(9)
type chk_typ is table of chk_tab index by binary integer;
chk_typ_rec chk_typ;
I have to pass the effect and count into another function, i tried doin as below:
function name: func_chk_typ
func_chk_typ(effect, count);
this returns an saying "identifier effect needs to be declared"
I am required to pass these values from the record type into the function, How can i over come this??
Any help is very much appreciated.Hi Hemz,
Find below code.
Function Code:
CREATE OR REPLACE FUNCTION fetch_band(eff in date,ineff in date)
return number
is
lu_cb_sysid NUMBER;
BEGIN
select fk_cb_sysid
into lu_cb_sysid
from ia_for_icon
where cr_ans_date >= eff
and cr_ans_date < ineff;
RETURN lu_cb_sysid;
END fetch_band;Procedure code. Here I have embedded the function.
CREATE OR REPLACE procedure abc(a varchar, b number) is
type cns_tab_record is record(
eff date,
ineff date);
type cns_tab_typ is table of cns_tab_record index by binary_integer;
cns_tab cns_tab_typ;
v_lu_cb_sysid NUMBER;
BEGIN
-- Here you have to assign the values to your table type record.
-- For example I am passing two values SYSDATE and SYSDATE - 10
cns_tab(1).eff := SYSDATE;
cns_tab(1).ineff := SYSDATE - 10;
v_lu_cb_sysid:= fetch_band(cns_tab(1).eff, cns_tab(1).ineff);
END abc;But I am just wondering why you are using table type datatype here.
Hope above code will help you.
Thanks,
Suri -
How to pass "EnterpriseManagementObject" Type as Function parameter?
Hello, dear Colleagues.
I'm trying to pass "EnterpriseManagementObject" as Function parameter.
Here is the piece of code:
$SCSM = 'SERVER_NAME'
function Add-Comment {
param (
[parameter(Mandatory=$true,Position=0)][Alias('Id')][String]$pSRId,
[parameter(Mandatory=$true,Position=1)][Alias('Comment')][String]$pComment,
[parameter(Mandatory=$true,Position=2)][Alias('EnteredBy')][String]$pEnteredBy,
[parameter(Mandatory=$true,Position=3)][Alias('IsAnalyst')][Bool]$AnalystComment,
[parameter(Mandatory=$true,Position=4)][Alias('IRObject')][EnterpriseManagementObject]$IRObject
if ($IRObject) {
$NewGUID = ([guid]::NewGuid()).ToString()
if ($AnalystComment)
$Projection = @{__CLASS = "System.WorkItem.Incident";
__SEED = $IRObject;
AnalystComments = @{__CLASS = "System.WorkItem.TroubleTicket.AnalystCommentLog";
__OBJECT = @{"Id" = $NewGUID;
Comment = $pComment;
DisplayName = $NewGUID;
EnteredBy = $pEnteredBy;
EnteredDate = (Get-Date).ToUniversalTime();
IsPrivate = $false
New-SCSMObjectProjection -Type System.WorkItem.IncidentPortalProjection -Projection $Projection -ComputerName $SCSM -ErrorAction stop
} else {
Write-Host $pSRId "could not be found"
$IncidentClass = Get-SCSMClass -name System.WorkItem.Incident$ -ComputerName $SCSM
$Incident = Get-SCSMObject -Class $IncidentClass -Filter "name -eq $c" -ComputerName $SCSM
Add-Comment -Id $c -Comment $text -EnteredBy $name -IsAnalyst $False -IRObject $Incident -ErrorAction stop
With GetType() I watched $Incident is "EnterpriseManagementObject":
IsPublic IsSerial Name BaseType
True True EnterpriseManagementObject Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectBaseWithProperties
But PS script returns error TypeNotFound:
Add-Comment : Unable to find type [EnterpriseManagementObject]. Make sure that the assembly that contains this type is loaded.
At C:\script.ps1:146 char:13
+ Add-Comment -Id $c -Comment $text -EnteredBy $name -IsAnalyst $True ...
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (EnterpriseManagementObject:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
Is there a way to pass "EnterpriseManagementObject" as Function parameter?
Thanks.First of all the error indicates that you haven't loaded the assembly which contains the class you're trying to load.
Try loading the assembly by running:
[Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.Core") | Out-Null
Secondly if you want to use type based parameters restrictions you should use full type name, which can be found with the command:
$SomeObject.GetType().FullName
You should end up with: Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject -
Invalid length parameter passed to the LEFT or SUBSTRING function, error on INSERT
I have a stored procedure that does a BULK INSERT of a csv file into myCSVTable then INSERTs records from
myCSVTable into myTable. The INSERT statement is giving me this error:
Invalid length parameter passed to the LEFT or SUBSTRING function.
CSV File:
3,020000007,OR,051,97205,02020005,41075,19470721,2,0,,0,0,0,0,0,1,0,0,,,,,,,,,0,2,,334418,334418,334418,13,,0,,0,0,0,0,0,1,0,0,1,20100217,,,,,20100304,20121030,1,1,,,0,0,0,0,0,,,,,0,0,0,0,9,0,0,0,1,1,0,0,0,3,00,20100304,20100426,20100922,20101011,20100304,20100922,20101011,,20101011,20100819,,20100326,20100326,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0,,,1,1,,9,9,1,1,1,1,0,0,111150,111150,111150,999999,5586.25,4714.01,5884.28,7055.89,11097.89,10839.39,0.00,2,,,,,20120617,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,The
Workforce Investment Board for the City of xxxxxxxx and xxxxxxxxx and W,020005,,mstr: 1000000000000000017 js: 372651 epi: 1,Jane Doe
4,020000007,OR,051,97205,02020005,41075,19470721,2,0,,0,0,0,0,0,1,0,0,,,,,,,,,0,2,,334418,334418,334418,13,,0,,0,0,0,0,0,1,0,0,1,20100217,,,,,20100304,20121030,1,1,,,0,0,0,0,0,,,,,0,0,0,0,9,0,0,0,1,1,0,0,0,3,00,20100304,20100426,20100922,20101011,20100304,20100922,20101011,,20101011,20100819,,20100326,20100326,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0,,,1,1,,9,9,1,1,1,1,0,0,111150,111150,111150,999999,5586.25,4714.01,5884.28,7055.89,11097.89,10839.39,0.00,2,,,,,20120617,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,The
Workforce Investment Board for the City of xxxxxxxx and xxxxxxxxx and W,020005,,mstr: 1000000000000000017 id: 020000007 epi: 1,Jane Doe
There is no LEFT or SUBSTRING function used in the procedure and there are no triggers on either table.
The procedure had been working fine until today, when I altered one of the CSV fields. The code which triggers the error is this:
INSERT [myTable]
SELECT * FROM [myCSVTable]
The weird thing is, the 1st record containing the changed field (mstr: 1000000000000000017 js: 372651 epi: 1) triggers the error, but the 2nd record containing
the old field value (mstr: 1000000000000000017 id: 020000007 epi: 1), does not.
There are only blank spaces in the 2 strings, no non-printable characters or anything like that. I'm confused.A View of myTable was causing the problem.
Hi LoriCazares,
Do you mean that you have solved this issue? If so, please close this thread.
Regards,
Elvis Long
TechNet Community Support -
Pass rowtype as function parameter, as a Object like type. How?
Hi.
I have the following question.
I have 3 tables:
TAB1
TAB2
TAB3
I declare 3 rowtypes variables, one for each table:
v_tab1 TAB1%ROWTYPE;
v_tab2 TAB2%ROWTYPE;
v_tab3 TAB3%ROWTYPE;
I want to pass a rowtype as a function parameter, but i want the function to allow any rowtype to be passed as parameter, and then inside the function convert that "object" to the correct rowtype.
Is that possible?
In another language like C# for example, i would pass the rowtype as a object type, and then cast it to the correct data type.
I hope you can help me.
Cheers.To do this they would have to be object types, and have a common supertype.Alternatively unrelated object types could be abstracted away with ANYDATA.
There is no such functionality exposed / documented for records - although the signatures of several built-in packages suggest that a mechanism for passing ADTs as formal parameters does actually exist. -
Error passing in RECORD type into API
Gurus,
Getting the following error when I try and pass a RECORD type into an API. Am I passing it in properly?
Any help is appreciated.
Thanks,
-Scott
Here's my error:
fnd_descr_flex_col_usage_pkg.load_row
ERROR at line 21:
ORA-06550: line 21, column 4:
PLS-00306: wrong number or types of arguments in call to 'LOAD_ROW'
ORA-06550: line 21, column 4:
PL/SQL: Statement ignored
Here's my anon block:
declare
TYPE who_type IS RECORD
created_by NUMBER,
creation_date DATE,
last_updated_by NUMBER,
last_update_date DATE,
last_update_login NUMBER
v_who_type who_type;
v_sysdate date;
begin
select sysdate
into v_sysdate
from dual;
v_who_type.created_by := 0;
v_who_type.creation_date := v_sysdate;
v_who_type.last_updated_by := 0;
v_who_type.last_update_date := v_sysdate;
v_who_type.last_update_login := 0;
fnd_descr_flex_col_usage_pkg.load_row
(x_application_short_name => 'SPL',
x_descriptive_flexfield_name => 'HR_LOCATIONS' ,
x_descriptive_flex_context_cod => '441',
x_application_column_name => 'ATTRIBUTE5',
x_who => v_who_type,
x_end_user_column_name => 'District',
x_column_seq_num => 10,
x_enabled_flag => 'Y',
x_required_flag => 'N',
x_security_enabled_flag => 'N',
x_display_flag => 'Y',
x_display_size => 50,
x_maximum_description_len => 50,
x_concatenation_description_le => 25,
x_flex_value_set_name => '50 Characters',
x_range_code => '',
x_default_type => '',
x_default_value => '',
x_runtime_property_function => '',
x_srw_param => '',
x_form_left_prompt => 'District',
x_form_above_prompt => 'District',
x_description => '');
...I followed Tubby's advice and called the package to which the RECORD type was defined, however, I'm getting a "no data found" error in the called package. The purpose of "internally" definining the record type inside my Anon block was so that I could assign variables locally.
Help from you gurus would be greatly appreciated!
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "APPS.FND_DESCR_FLEX_COL_USAGE_PKG", line 508
ORA-06512: at line 21
Please do not refer me to any more EBS forums or links. This is a coding question, not an EBS question.
For the guy who asked, here is the procedure definition:
PROCEDURE load_row
(x_application_short_name IN VARCHAR2,
x_descriptive_flexfield_name IN VARCHAR2,
x_descriptive_flex_context_cod IN VARCHAR2,
x_application_column_name IN VARCHAR2,
x_who IN fnd_flex_loader_apis.who_type,
x_end_user_column_name IN VARCHAR2,
x_column_seq_num IN NUMBER,
x_enabled_flag IN VARCHAR2,
x_required_flag IN VARCHAR2,
x_security_enabled_flag IN VARCHAR2,
x_display_flag IN VARCHAR2,
x_display_size IN NUMBER,
x_maximum_description_len IN NUMBER,
x_concatenation_description_le IN NUMBER,
x_flex_value_set_name IN VARCHAR2,
x_range_code IN VARCHAR2,
x_default_type IN VARCHAR2,
x_default_value IN VARCHAR2,
x_runtime_property_function IN VARCHAR2,
x_srw_param IN VARCHAR2,
x_form_left_prompt IN VARCHAR2,
x_form_above_prompt IN VARCHAR2,
x_description IN VARCHAR2) -
Pass PL/SQL collection as function parameter over DBLink
Hi all,
I am trying to do the following;
---Remote database
--create SQL type
create type attributeidarray as table of varchar2(255);
--create a package specs
CREATE OR REPLACE PACKAGE testp
AS
TYPE ref_res IS REF CURSOR;
FUNCTION foo (i NUMBER)
RETURN NUMBER;
FUNCTION foo1 (i NUMBER, j attributeidarray)
RETURN NUMBER;
END;
--create package body
CREATE OR REPLACE PACKAGE BODY testp
IS
--Function does nothing other than return number
FUNCTION foo (i NUMBER)
RETURN NUMBER
IS
res ref_res;
a array_n;
BEGIN
OPEN res
FOR
SELECT *
FROM DUAL;
RETURN 1;
END;
--Function takes the collection as imput and does nothing with it. Function just returns number
FUNCTION foo1 (i NUMBER, j attributeidarray)
RETURN NUMBER
IS
res ref_res;
a array_n;
BEGIN
OPEN res
FOR
SELECT *
FROM DUAL;
RETURN 1;
END;
END;
--"Near" Database ..
--create a SQL type
--This is the exactly the same as in remote database
create type attributeidarray as table of varchar2(255);
--create a DBLink
create database link con_to_remote_db
connect to remotedbuser
identified by "swordfish"
using 'remotedb'
--call the remote functions and pass a collection object
SQL> DECLARE
2 a attributeidarray;
3 BEGIN
4 SELECT CAST (attributeidarray (1, 2) AS attributeidarray)
5 INTO a
6 FROM DUAL;
7
8 :b := testp.foo@con_to_remote_db (2);
9 END;
10 /
PL/SQL procedure successfully completed.
SQL> print b
B
1
SQL>
--so far so good...
SQL> DECLARE
2 a attributeidarray;
3 BEGIN
4 SELECT CAST (attributeidarray (1, 2) AS attributeidarray)
5 INTO a
6 FROM DUAL;
7
8 :b := testp.foo1@con_to_remote_db (2, a);
9 END;
10 /
:b := testp.foo1@con_to_remote_db (2, a);
ERROR at line 8:
ORA-06550: line 8, column 10:
PLS-00306: wrong number or types of arguments in call to 'FOO1'
ORA-06550: line 8, column 4:
PL/SQL: Statement ignored
--Oops...doesn't seem to recognize the collection type :( /b]
So I wish to know the following;
- Even though the definition for type is the same, why is the remote DB not recognizing my type?
- It would be helpful if any one can let me know the correct method to pass a collection type with a example.
I would appreciate any help in resolving this issue.
Thanks,
prashantNot possible. For valid technical reasons.
Definitions are local to a database. You can define a SQL user type called TMyType in your database. I can define one in mine with the same name.
Can you now call my database, passing a collection of your TMyType to me? How do we (or Oracle) know that your definition and my definition is the same? Or if they were the same when you compiled your code (and your Oracle checked my Oracle to confirm), that they still are the same and that I did not in the meantime altered the type? Or even dropped it?
For types/collections to be transparently passed across to database links, we need something along the lines of:
a) global types
b) runtime checking of types
Both are problematic to implement and maintain. With (a) there is the issue of dependencies. The global type cannot be changed before all dependencies on all subscribers have been resolved. With (b) there is the issue of performance, checking the type definitions with every single call on the local & remote instances to compare.
It would be a nice feature to have... but it would fail to live up to expectation if not implemented in a robust and performant way.
Alternative. "Insert" data via a remote proc into a remote collection. This allows you to push data into a PGA memory structure on the remote side and when done, allows you to tell that remote proc to "flush" (forall insert/update/delete) the contents of that structure to disk. -
Passing range-value into a parameter of a subreport
Hello all
I've a problem with passing a formula into a parameter of the subreport.
I'm using a SAP BW query with a data range parameter. So I have to provide a range value first for executing this query.
I'd like to execute the query with a data range between the last two weeks. For this purpose if created a formula with following code:
[dateadd('d',-14,currentdate),currentdate]
This means, the result is an array. And exactly this is the problem. Because Crystal Reports doesn't support an array as a result of a formula.
Is there an other possibility for passing the array/data range to the parameter in the subreport?
I'm using Crystal Reports for enterprise (v.14.0.2).
Kind regards,
GregThanks, kglad. I was wondering about that. I thought that
putting a variable data type of :Number would have made it a
number, but I never got an error in the debugger so I thought it
was ok. I traced the data type and figured out it was actually a
string and changed the line like follows which turned the string to
an integer and made it work:
var image01ClosedPosition:Number =
parseInt(RootNode1.attributes.imageChangeX); -
How to load properties from csv file directly into a .dll parameter in a test step
Hi,
I would like to take values from a property file and plug them directly into parameter used to invoke dll calls.
I have looked at examples on how to use the property loader to input test limits, but I cannot figure out how to pipe into the params.
I have tried. <step name>.Module.<param name>
step.propertieslist[0].
Any ideas?
Thanks,
m
Solved!
Go to Solution.I agree that it would be nice. The difference between limits and parameters though is that parameters are set dynamically. What I mean by that is you never know how many parameters a step will have until you define the module. Whereas the Limits are always set in stone. The only difference is the MultiNumeric Limit Test which is just an array that get's appended too with the same datatype. And the only acess to a parameters value is through the API unless it is a variable.
The other hard part is that you don't know the datatype of parameters. Any step can have any number of parameters as well as any datatype being passed to each individual parameter.
I think if you are set on NOT creating Locals or FileGlobals then you would need to create custom step types with subproperties that get assigned to the parameters. This could be even more painful though because now you have to maintain and support the custom step types.
The other option would be to create your own property loader step that could call in and set things in the API. HMMM now that would be an interesting project...
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~ -
What type of out put parameter should i have to pass here?
Hi all,
I'm working on a custom function module. In that i have to call a standard function module "SAPWL_READ_STATISTIC_FILES".
This standard FM is returning the values in changing parameter "ALL_STATS" of type "SAPWL_ALLSTATS". SAPWL_ALLSTATS is a structure in a pool structure "sapwl".
My problem is when i'm testing the standard FM with some input parameters its throughing some values into changing parameter "ALL_STATS", but in my custom FM for the same standard FM i'm passing the same values its not throughing any values into that changing parameter "ALL_STATS".
So can anybody check this standard FM and suggest me how to declare the output parameter type and pass? Its a pool structure there i'm getting problem to define it. Help me out please.
Thanks & Regards
NaiduHello Naidu
Using the sample report ZUS_SDN_READ_STATISTICAL_FILES I can fetch a couple of records from the system (ERP 6.0).
If your selection does not work within your custom function module then perhaps there is some conversion problem with the input data (keep in mind that the SAP-GUI takes care of all conversions, e.g. a date '10.11.2008' is automatically converted into '20081110').
*& Report ZUS_SDN_READ_STATISTICAL_FILES
*& Thread: What type of out put parameter should i have to pass here?
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1119462"></a>
REPORT zus_sdn_read_statistical_files.
TYPE-POOLS: sapwl.
DATA: gt_stats TYPE STANDARD TABLE OF sapwl_statrec.
DATA: gd_msg TYPE bapi_msg.
START-OF-SELECTION.
CALL FUNCTION 'SAPWL_READ_STATISTIC_FILES'
EXPORTING
read_client = syst-mandt
* READ_TIME = '001000'
* READ_TIME_DELTA = '000200'
* READ_EXCLUDE_USERNAME =
* READ_START_DATE = SY-DATUM
* READ_START_TIME = ' '
* READ_USERNAME =
* READ_WORKPROCESS = 'FFFF'
* STATISTIC_FILE = ' '
* AS_STATISTIC_FILE = ' '
* NO_BUFFER_FLUSH = ' '
* WAIT_FACTOR = 150
* INCLUDE_APPL_STAT = ' '
* IMPORTING
* PROBLEMS =
* TOTAL_RECS_READ =
* TABLES
* PROTOCOL =
* RFC_RETURNS =
* SERVER_LIST =
CHANGING
all_stats = gt_stats.
DESCRIBE TABLE gt_stats.
WRITE syst-tfill TO gd_msg NO-ZERO.
CONDENSE gd_msg NO-GAPS.
CONCATENATE gd_msg 'Records found' INTO gd_msg
SEPARATED BY space.
MESSAGE gd_msg TYPE 'I'.
END-OF-SELECTION.
Regards
Uwe -
Table parameter Types for this Function module
I am using K_HIERARCHY_TABLES_READ to get the profit centers for a given profit center group.
I have the following declarations for the parameters of this FM:
TYPE-POOLS: gseth.
Declarations for Profit Center Group
DATA: g_pcgrp TYPE rgsbs-class,
g_setid TYPE rgsbs-setnr,
g_info TYPE grphinfo,
g_overwrite TYPE sy-datar.
DATA:
i_nodes TYPE STANDARD TABLE OF gseth_node_tab,
i_values TYPE STANDARD TABLE OF gseth_val_tab,
i_masterdata TYPE STANDARD TABLE OF grpmdline.
When this is run, its taking me into a dump and it says:
The reason for the exception is:
The system tried to pass internal table "I_NODES" to the formal
parameter "T_NODES", but a type conflict occurred between the
formal and the actual parameter.
Pl help me to correct this dump and error.
Thanks
KiranDATA:
i_nodes TYPE STANDARD TABLE OF gseth_node_tab,
i_values TYPE STANDARD TABLE OF gseth_val_tab,
i_masterdata TYPE STANDARD TABLE OF grpmdline.
change your declarations
to the below...
DATA:
i_nodes TYPE gseth_node_tab,
i_values TYPE gseth_val_tab,
i_masterdata TYPE STANDARD TABLE OF grpmdline. -
I have Flex 3.0.214193 and CF 8,0,0,176276 and Oracle
10.2.0.3.
I've been search for several days for an answer to this one.
There is very little out there about this type of error, but then
there is very little about any problems with Flex and ColdFusion.
In Flex, I have two comment fields. the .cfc has two update
functions that update the comments, because they are in two
different tables. The first update works like a champ. The second
one consistantly shows this error in the CF application log: The
NEWENGREMARK parameter to the updateEng function is required but
was not passed in. I've used to Alert.Show to verify that Flex does
have a value in that variable when it calls the .cfc. I've even
tried passing the first variable that worked in the first update,
and then a litteral value. Everything yields the same cryptic error
message. I must be looking at the wrong thing.
The only things I've found on the web about this, say the
variables should have a scope (is that a scope in Flex or in the
.cfc) and the column names should be in upper case (because it's
Oracle).
Here's the .cfc code (is that where the error is, or is it in
Flex?). The UpdateDescription function works, but the UpdateEng
doesn't.
Thanks for any help, or spelling errors you can point out.
ScottBKBK,
That is part of my thrashing about, trying to either make it
work or get a real error message. I changed the Flex and .cfc to
pass the previously missing parameter to the descriptionUpdate
function. If I pass the newENGRemark variable to the first update
function, everything is fine; if I pass it to the second update
function, it is missing.
I changed the Flex and .cfc be all upper case and all lower
case, but there was no difference.
I created a .cfm page to cfinvoke the same .cfc; then I
passed some hardwired literals to the .cfc - everything was fine.
I put the Flex code back to only pass two parameter to each
update function, but in the .cfc, in the second update, I added the
default option to both of the parameters. That worked; it went
ahead and updated the record with the defaults. (That's not really
what I wanted to do for production) . I changed the .cfc so the
newENGRemark was not required. Then it said the second parameter
was missing. In the Flex code, you can see that I am passing a
litteral, 925001, to the .cfc. The parameter exists in Flex, but
when it gets to the .cfc, it doesn't exist.
This problem has been beating me for too long. I think I
will restructure the database so that I can do what I need to with
one update function call. The initial test seems to show this will
work.
Basically I am floored by this problem. Everything I've
tried to get around it or get a real error hasn't worked. Could it
be something to do with Oracle CLOB data type? Because I was able
to make it work by using a .cfm to cfinvoke the .cfc, it seems that
the problem would have to be in Flex. But the Flex only seems to
have a problem with the second update, UpdateEng. So I deleted the
second update, copied the first, and changed the the minimum to
make it work, but it didn't. Then I switched the order in the Flex
and .cfc to have the second update first - same difference. Then I
even took out the descriptionUpdate altogether, but it still gave
that same error.
Does anyone know of some diagnostic tool that can catch what
is being passed on the AMF channel? Can you do a dump or a debug of
a .cfc that is called by Flex?
Scott
Maybe you are looking for
-
Personal Domain - Can I get rid of my iWeb site's name in the URL?
Hey everyone, I just set up my iWeb site (called "This is Out of Context") to point to a personal domain name (www.thisisoutofcontext.com). Problem is, now my homepage URL reads: http://www.thisisoutofcontext.com/THISIS_OUT_OFCONTEXT/HOME.html Is the
-
Mac App Store doesn't load on new 27" iMac
I have a new 27" iMac purchased 1/31/13 loaded with Mountain Lion 10.8.2. Everything came up fine when I got it home and I migrated data from my time machine backup from a Lion iMac. When I tried to download software updates, the App Store came up
-
Hi, We have a scenario PROXY(ABAP)->XI->JDBC. The source structure is Partners(occurance n),Line items(occurence n). The target structure is Details(Occurance n). For "n" number of Partners and "m" number of Line items in source we need m*n(i.e, m mu
-
Hi, How to catch or solve the 404 error in application. Some time we are giving some file name but that file is not avialable at that time it will give 404 error. how to avoid this error. If 404 error comes i want call some other file. Is it posible.
-
OBIEE 11.1.1.6 not installing on RHEL 6
Hi, I'm not able to install OBIEE11.1.1.6 on RHEL 6.It says required packages are missing. I have installed all the necessary packages needed But still not able to succeed.Please Help me out. Thanks In Advance Janani