How to execute STP with Named type table as parameter through ODBC calls.
Hi All,
I am using Oracle 10g release 2. I am having a Stored function which takes Named Type Table as its parameter.
For example
CREATE OR REPLACE TYPE tblName is table of someUDT.
CREATE OR REPLACE function nestfunction(t tblName)
return NUMBER
as
//function body here.
end;
Now, I want to call this Stored function nestfunction through ODBC calls. Also want to add multiple rows in tblName parameter.
But am unable to perform the above mentioned task. If you have answers please, reply.
Thanks and regards
ftil555
Hi Arik,
Thanks for the reply. I got the solution by configuring a NonXA data source. The problem was with internal commits of the fnd_global.initialize api.
If the DB adapter is calling aPL/SQL procedure (written inside a pakcage) using the data source configured to support XA, will expect not to have any commits in side the procedure or anywhere, the XA driver will take of the commits and whole transactions. By default the FND_GLOBAL.INITIALIZE(...) procedure will have the internal commits, so it was throwing the errors.
The solution was configuring the a NonXA Data source in the databae adapter configuration will allow the commits inside the callings procedures. So we created Two data sources one for XA and another for NonXA and we are using the NonXA datasource whereever we are calling the EBS APIs which have the internal commits.
-- Khaleel
Similar Messages
-
How can I connect with the AspNetUsers table in MVC 5?
I have a model, in which I have used several foreign keys from other tables. The point is that I also need to get the Id of the user, from the AspNetUsers table, though, I don't know how. I have done something like this, but it doesn't seem to be working:
public class Message
public int MessageID { get; set; }
[Required(ErrorMessage="Please type a message to submit")]
[DataType(DataType.MultilineText)]
[Display(Name="Message")]
public string MessageText { get; set; }
public DateTime WrittenOn { get; set; }
[Required(ErrorMessage="Please select a ticket")]
[ForeignKey("Ticket")]
[Display(Name="Ticket")]
public int TicketID { get; set; }
public virtual Ticket Ticket { get; set; }
[Required(ErrorMessage = "Please select a business")]
[ForeignKey("Business")]
[Display(Name = "Business")]
public int BusinessID { get; set; }
public virtual Business Business { get; set; }
[Required(ErrorMessage = "Please select a user")]
[ForeignKey("aspnetusers")]
[Display(Name = "User")]
public int Id { get; set; }
public virtual ApplicationUser ApplicationUser { get; set; }
When I try to create a controller using the Entity Framework with my model, I get an error message saying:
The ForeignKeyAttribute on property 'Id' on type ... is not valid. The navigation property 'aspnetusers' was not found on the dependent type ... The Name value should be a valid navigation property name.
If someone could help me solve the problem, I would be glad.Hi Toni,
I see that this particular query is been answered in the following thread.
http://stackoverflow.com/questions/25372436/how-can-i-connect-with-the-aspnetusers-table-in-mvc-5
You can also refer the following links, hope this helps.
http://stackoverflow.com/questions/20071282/aspnet-identity-and-mvc5
http://blogs.msdn.com/b/webdev/archive/2013/10/16/customizing-profile-information-in-asp-net-identity-in-vs-2013-templates.aspx
Regards,
Bharath -
NewSubprop​erty with named type in remote execution
Hello,
I have a problem in TestSTand 4.1 with using the NewSubProperty API call on a remote system. I use it to create a StationGlobal on the fly having a named type. The TestStand configuration is identical on both machines and it includes the TypePalette with the named type in question.
When executing the sequence locally on the remote computer (using the standard Operator Interface), it works. When executing it under the remote engine, it gives an error that the type is not known. Other NewSubProperty calls using built-in types work fine.
Any ideas?
Best regards
Peter
Solved!
Go to Solution.This is a known problem that will be corrected in a future version of TestStand. The remote engine does not load type palette files so that is why the type is not found. For a workaround you should be able to load the type palettes directly by calling the LoadTypePaletteFilesEx Engine API function in your remote sequence.
-
How to execute workflow with pl/sql?
My foregoing work has been done with owb including building dimension table, face table, mappings, and workflow process. if I don't install workflow server/client program module, how to execute the workflow process? Can PL/SQL do this and how to?
user13726880 wrote:
The original requirements were put together and given to me, an Oracle newbie. They expected the Java app to use something intrinsic to Oracle and Unix sendmail. To solve my problem, I use a JDBC connection to run some SQL commands. I take that data, format it and send the results by email to the user. By default the requirement is to send it as an HTML attachment using Unix 'sendmail'. So I do that using Runtime exec. I have also added JavaMail functionality as an alternative to sendmail. It works great and as expected.Sounds like a reasonable solution.
Note however that PL/SQL itself can send email. And PL/SQL can call unix sendmail too.
However myself I would have done it in java with JavaMail. -
How to execute Infopackage with an ABAP program
Dear All,
I would like to execute an infopackage every 6th day of the month.
Therefore I would like to integrate a program in a process chain executed on a daily basis, and call with this program the execution of the infopackage if day = 6.
Do you know how to execute an infopackage inside an ABAP program ? Which function module use ?
Thanks,
GregHello luminy13,
Just to answer your question on how to start an InfoPackage inside an ABAP program: you can use function module BAPI_IPAK_START. You might also need to use FM BAPI_IPAK_CHANGE to change the scheduling.
However, if the only reason you are creating the ABAP program is to run the InfoPackage at the 6th day of the month, then I don't recommend that you create the ABAP program at all. You can simply schedule the InfoPackage (or the process chain that contains it) on the 6th day of the month. Here's how to do it:
In the scheduling dialog, click the ">>" button. Enter the factory calendar, put 6 is in the workday and then choose "beginning of the month".
Hope this helps. -
How can build BMM with multiple fact tables
HI Gurus,
I have 4 fact tables and 18 Dimension table. Dimension tables have links with multiple fact tables. i have created physical joins in Physical layer. Now my questions is how can i create Business Model with multiple fact tables.
i mean should i create 4 fact tables as logical tables and logical keys ? Then i have to move all dimension tables in to Business model?
i am new to OBIEE. i gone through tutorial it is showing with one fact and multi dimension table. Should i do follow same style with multi fact tables.
Please help me. Thanks in advance for your support.Thanks for your response.
I had drag all tables from the phisical layer to Business Model. then i have deleted all links and recreated complex joins with default values.
now i have some revenue amont columns in fact tables.
my question is should i should i create aggregation ( like Sum..) for those columns? is it must ?
please let me know thank you very much -
Executing MCE7 with Material Type as a selection criteria
Dear Experts,
Is there a way to execute MCE7 by material type?
Thank you in advance
Regards.not directly, but with a trick.
If your material type has its own number range, then you may inoput this range.
Alternativly you can click multiple selection button and then again multiple selection
There you change to search help Material by material type, enter your material type and execute.
Then you select all found materials and click copy, then again copy.
Now you are back at initial selection screen and can execute your selection -
How do fix problem with iPages - type does not enter - ?
How do I fix this problem with Pages - type from keyboard does not enter ? If I need to re-install, How do I do that?
Hello DonAndNorma,
You may need to uninstall, then reinstall the Pages application. Steps for doing so can be found in the article linked below.
OS X Mavericks: Install, update, and uninstall apps
http://support.apple.com/kb/PH14299
Cheers,
Allen -
Opening an Access table in Oracle through ODBC
Hi all,
Is it possible to open a linked table (Access or similar, or any other ODBC accessible table), similar to how one can make an ODBC table accessible as a linked table within an Access database.
If not, is there an easy method to download an ODBC table into an Oracle table, other than through programming, i.e VB not SQL.
Thanks in advance.
DavidAny luck? I want to do the same thing. I need to pull info out of an Access database and put it in Oracle and do not want to do a flat file transfer. I looked at the Gateways mentioned in the first response but, have not found one for Access.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by David Andrews:
Hi all,
Is it possible to open a linked table (Access or similar, or any other ODBC accessible table), similar to how one can make an ODBC table accessible as a linked table within an Access database.
If not, is there an easy method to download an ODBC table into an Oracle table, other than through programming, i.e VB not SQL.
Thanks in advance.
David<HR></BLOCKQUOTE>
null -
Can somebody help...
I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
PROCEDURE p_save (example IN OUT xyz_obj)
my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.user13026549 wrote:
Can somebody help...
I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
PROCEDURE p_save (example IN OUT xyz_obj)
my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.
It ISN'T possible. How could it be? Each attribute has to be set to something don't you think?
A common way to handle that is to define a public package variable that is an instance of the object type and has ALL elements set to null. As Odie suggested a custom constructor function can be used for that.
Then you create your procedure instance by starting with an instance of the package variable (where everything is null) and setting values for the attributes you need. -
How to upload data with dynamic internal table
Hi,
I have to upload the basic , sales, purchasing view data by using bapi depend on check box selected for views.
i have filled fieldcatalog for selected views and pass the field catalog structure to dynamic int table and
import it into the field symbol <fs_data>. this field symbol assigned to <fs_1>.
then callED the 'GUI_UPLOAD ' and when i pass field symbo for function module i am getting first 10 rows 0f the file .
flat file has basic data,sales ,purchase fields data
ex: i was selected basicview and purchase view and execute i am getting basic,sales view data.
how can i get only basic and purchase data.hi ,
please find code.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcatalog
IMPORTING
ep_table = <fs_data>
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0. "#EC NEEDED
ENDIF.
So <FS_1> now points to our dynamic internal table.
ASSIGN <fs_data>->* TO <fs_1>.
Next step is to create a work area for our dynamic internal table.
CREATE DATA new_line LIKE LINE OF <fs_1>.
A field-symbol to access that work area
ASSIGN new_line->* TO <fs_2>.
ASSIGN new_line->* TO <fs_3>.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_f
filetype = 'DAT'
TABLES
data_tab = <fs_1>
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. -
Dynamic table with field type table
Hi,
I´m using "cl_alv_table_create=>create_dynamic_table" to create a dynamic table for ALV Grid.
But...I need to use colors in ALV, then I need to declare a field type LVC_S_SCOL in dynamic table from "cl_alv_table_create=>create_dynamic_table".
How can I declare this in fieldcat?
The code:
Creating dynamic table
DATA: table_agrup TYPE REF TO data,
line_agrup TYPE REF TO data.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fieldcat
IMPORTING
ep_table = table_agrup
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN table_agrup->* TO .
Printing ALV
CALL METHOD obj_grid->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = 'A'
is_layout = w_layout
CHANGING
it_outtab =
it_fieldcatalog = t_fieldcat
it_sort = t_sort
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
Thanks.It is not possible with the METHOD cl_alv_table_create=>create_dynamic_table to include another table inside that newly generated table.
I have tried to do it with the code and I got the dynamic table created after at the end of the program.
In the code,
<DYN_TABLE> has same effect as your <table> variable
<DYN_WA> has same effect as your <HEADER>
REPORT ZTEST_NP_DYNAMIC.
DATA: DY_TABLE TYPE REF TO DATA,
DY_LINE TYPE REF TO DATA.
FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
<DYN_WA>,
<DYN_FIELD>.
FIELD-SYMBOLS: <FS> TYPE ANY.
* To generate the Dyanmic table with the COLOR
DATA: LS_SOURCE TYPE STRING.
DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.
DATA: L_NAME LIKE SY-REPID.
DATA: L_MESSAGE(240) TYPE C,
L_LINE TYPE I,
L_WORD(72) TYPE C.
DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.
LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
APPEND LT_SOURCE.
LT_SOURCE = 'FORM TABLE_CREATE USING I_FS TYPE ANY.'.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
APPEND LT_SOURCE.
* you can add your fields here.....
LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
APPEND LT_SOURCE.
LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
APPEND LT_SOURCE.
LT_SOURCE = 'I_FS = POINTER.'.
APPEND LT_SOURCE.
LT_SOURCE = 'ENDFORM. '.
APPEND LT_SOURCE.
L_NAME = 'ZTEST_SUBROUTINE_POOL'.
CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD. "#EC CI_GENERATE
ENDCATCH.
IF NOT L_MESSAGE IS INITIAL.
MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
ENDIF.
ASSIGN DY_TABLE TO <FS>.
PERFORM (L_FORM) IN PROGRAM (L_NAME) USING <FS>.
ASSIGN DY_TABLE->* TO <DYN_TABLE>.
* Create dynamic work area and assign to FS
CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
ASSIGN DY_LINE->* TO <DYN_WA>.
Write: 'bye'.
Regards,
Naimesh Patel -
Executing procedure with collection TYPE as IN param
Hi ,
I am using Oracle Version 10.2.0.4.0.
I have created a TYPE AE_SEQ_TAB1 IS TABLE OF number;
This is my SP header:
PROCEDURE test_data
ip_table_nm IN VARCHAR2,
ip_ae_seq_no IN AE_SEQ_TAB1,
op_error_cd OUT VARCHAR2,
op_error_desc OUT VARCHAR2,
op_active_data OUT SYS_REFCURSOR
I want to pass multiple values to ip_ae_seq_no while testing this SP. So I am doing like.
DECLARE
REF_CUR SYS_REFCURSOR;
ERR VARCHAR2(1000);
ERR1 VARCHAR2(1000);
ip_ae_seq_no ae_seq_tab1;
BEGIN
ip_ae_seq_no :=ae_seq_tab1(1,2,3);
test_data('CP_TBL',ip_ae_seq_no,ERR,ERR1,REF_CUR);
END;
This gives me the error with :
ORA-06550: line 8, column 1:
PLS-00306: wrong number or types of arguments in call to test_data
Whats the mistake I am doing in this?
Also can I check the count of elements from this table at run time something like
SELECT COUNT(1) INTO l_tab_type_cnt from TABLE(ip_ae_seq_no);
Rgds,
Aashish
Edited by: Aashish S. on Jan 27, 2010 1:41 PMJust initialize you collection...
Without values:
SQL> DECLARE
2 REF_CUR SYS_REFCURSOR;
3 ERR VARCHAR2(1000);
4 ERR1 VARCHAR2(1000);
5 ip_ae_seq_no ae_seq_tab1:=ae_seq_tab1();
6 BEGIN
7 test_data('CP_TBL',ip_ae_seq_no,ERR,ERR1,REF_CUR);
8 END;
9 /
collection size=0
PL/SQL procedure successfully completed.or with values:
SQL> DECLARE
2 REF_CUR SYS_REFCURSOR;
3 ERR VARCHAR2(1000);
4 ERR1 VARCHAR2(1000);
5 ip_ae_seq_no ae_seq_tab1:=ae_seq_tab1(1,2,3,4);
6 BEGIN
7 test_data('CP_TBL',ip_ae_seq_no,ERR,ERR1,REF_CUR);
8 END;
9 /
collection size=4
PL/SQL procedure successfully completed.Max
[My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]
Edited by: Massimo Ruocchio on Jan 27, 2010 9:20 AM
Added second example -
Problem with a procedure with a type table varchar2
Hey,
I can't seem to call my function with a custom type:
The function:
FUNCTION f_get_urls(v_table IN t_table)
RETURN VARCHAR2
IS
v_urls VARCHAR2(600);
BEGIN
FOR i IN 1..v_table.count LOOP
v_urls := CONCAT(v_urls,v_table(i));
END LOOP;
RETURN v_urls;
END f_get_urls;
t_table is declared in the package header:
TYPE t_table is table of VARCHAR2(100) index by binary_integer;
All goes well if i call the fucntion from within the package, but when i call it from an other package I get the next error:
Error(12,11): PLS-00306: wrong number or types of arguments in call to 'F_GET_URLS'
This is the procedure where i'm caling the fucntion:
PROCEDURE temp1
IS
TYPE t_table is table of VARCHAR2(100) index by binary_integer;
v_tab t_table;
v_temp VARCHAR2(100);
BEGIN
v_tab(1):='test';
v_tab(2):='test2';
v_temp:=pkg_print.f_get_urls(v_tab);
dbms_output.PUT_LINE(v_temp);
END temp1;
Any idea if i made an error or is this just not possible?
ThanksHey,
I can't seem to call my function with a custom type:
The function:
FUNCTION f_get_urls(v_table IN t_table)
RETURN VARCHAR2
v_urls VARCHAR2(600);
GIN
FOR i IN 1..v_table.count LOOP
v_urls := CONCAT(v_urls,v_table(i));
D LOOP;
RETURN v_urls;
END f_get_urls;
t_table is declared in the package header:
TYPE t_table is table of VARCHAR2(100) index by
binary_integer;
All goes well if i call the fucntion from within the
package, but when i call it from an other package I
get the next error:
Error(12,11): PLS-00306: wrong number or types of
arguments in call to 'F_GET_URLS'
This is the procedure where i'm caling the fucntion:
PROCEDURE temp1
IS
TYPE t_table is table of VARCHAR2(100) index by---Dont declare new collection
binary_integer;
> v_tab Yourpackagename.collectionname;
v_temp VARCHAR2(100);
EGIN
v_tab(1):='test';
v_tab(2):='test2';
v_temp:=pkg_print.f_get_urls(v_tab);
dbms_output.PUT_LINE(v_temp);
END temp1;
Any idea if i made an error or is this just not
possible?
ThanksTry it
PROCEDURE temp1
IS
-- TYPE t_table is table of VARCHAR2(100) index by---Dont declare new collection
-- binary_integer;
v_tab Yourpackagename.collectionname;
v_temp VARCHAR2(100);
BEGIN
v_tab(1):='test';
v_tab(2):='test2';
v_temp:=pkg_print.f_get_urls(v_tab);
dbms_output.PUT_LINE(v_temp);
END temp1;
colection types are not compatible even you created 2 diffrent types with the exact defination.
Please paste yours full code here....
Khurram
Whats that
v_temp:=pkg_print.f_get_urls(v_tab);
Message was edited by:
Khurram Siddiqui -
How to execute procedure with dynamic where condition.
Hi All,
I am facing a probelem
Issue :
I am having a parameter p_id in my procedure based on the value of this parameter i want to change the where condition.
How to do so?
Code:---------
create or replace procedure p_1
( p_id in emp_dummy.empno%type)
is
parameter_1 varchar2(2000);
v_sal number;
begin
if p_id = 1 then
parameter_1 := 'where empno = 1';
else
parameter_1 := 'where 1=1';
end if;
select salary into v_sal from emp_dummy||' '||parameter_1;
end;Dynamic SQL is not the best of ideas, but if you must...
EXECUTE IMMEDIATE 'select salary from emp_dummy where empno=nvl(:x,empno)' into v_sal using p_id;Then if you pass in the p_id to the procedure it will select the salary for that employee and if null is passed in then it will select the salary for all employees. Now here's a problem because you are trying to return a single value and if you don't specify the employee then it will try and return multiple values from that select, so you probably want to do something like give the sum of the salaries...
EXECUTE IMMEDIATE 'select sum(salary) from emp_dummy where empno=nvl(:x,empno)' into v_sal using p_id;
Maybe you are looking for
-
How to backup external hard drive to another external hard drive using time machine ?
Hello, i have an external hard drive which i store all my drum samples and sound library on and files are contantly changing, adding new sounds, deleting old ones etc .. So my method of back up as of now is to just copy all the edited files and click
-
Needing to add keep pool to SGA, sizing and checking for room?
Hi all, I'm needing to experiment with pinning a table and index (recommended by COTS product vendor) to see if it helps performance. I'm trying to set up a keep pool...and put the objects in it I've gone into the database, and found that I will need
-
Re: Rubbish Broadband & Rubbish Customer Service
I totally understand you. Joining BT is also the biggest mistake in my life!! Those Indian everytime promised to call back, but never. And always took ages to get some one answer, today no answer after 40 min's waiting on the phone. I am really fed u
-
[SOLVED]Unable to run Graphical applications as root/sudo
Ok so ive been working on getting my very first Arch install up and running and I need to get the catalyst drivers running for my HD6850 because I plan on doing some wine gaming. So I followed the instructions here on the wiki for ATI catalyst and I
-
We need your experience with bc4j
Hello, if you have worked with BC4J (Business Components for Java ) from Oracle, please divide your experience and opinions with us. We intend to implement a large project with BC4J for client and server sides. Regards & Thanks Vu Son-Lam Siemens AG