ORABPEL-11811 on creation of DB adapter returning record
Hi,
I have been getting some really frustrating results from using the database adapter with some PL/SQL function calls which have input or output %ROWTYPE paramerters.
On creation of the DB adapter, I get notification that a wrapper package is to be created. I confirm this, deploy the process and everything runs fine.
The next day, I start the dev server, only to find the same process generate the following error:
<bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>4063</code>
</part><part name="summary"><summary>file:/C:/soa_suite/bpel/domains/default/tmp/.bpel_fetchMedAssess_1.0_5e8d9ed419a39e6c3b8583856366f207.tmp/fetchMedicalAssess.wsdl [ fetchMedicalAssess_ptt::fetchMedicalAssess(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'fetchMedicalAssess' failed due to: Error while trying to prepare and execute an API.
An error occurred while preparing and executing the NHSSOA.BPEL_FETCHMEDICALASSESS.TOPLEVEL$NHSSOA_GET_MED_ASSES API. Cause: java.sql.SQLException: ORA-04063: package body "NHSSOA.BPEL_FETCHMEDICALASSESS" has errors
ORA-06508: PL/SQL: could not find program unit being called: "NHSSOA.BPEL_FETCHMEDICALASSESS"
ORA-06512: at line 1
[Caused by: ORA-04063: package body "NHSSOA.BPEL_FETCHMEDICALASSESS" has errors
ORA-06508: PL/SQL: could not find program unit being called: "NHSSOA.BPEL_FETCHMEDICALASSESS"
ORA-06512: at line 1
; nested exception is:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the NHSSOA.BPEL_FETCHMEDICALASSESS.TOPLEVEL$NHSSOA_GET_MED_ASSES API. Cause: java.sql.SQLException: ORA-04063: package body "NHSSOA.BPEL_FETCHMEDICALASSESS" has errors
ORA-06508: PL/SQL: could not find program unit being called: "NHSSOA.BPEL_FETCHMEDICALASSESS"
ORA-06512: at line 1
[Caused by: ORA-04063: package body "NHSSOA.BPEL_FETCHMEDICALASSESS" has errors
ORA-06508: PL/SQL: could not find program unit being called: "NHSSOA.BPEL_FETCHMEDICALASSESS"
ORA-06512: at line 1
Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
</summary>
</part><part name="detail"><detail>
Internal Exception: java.sql.SQLException: ORA-04063: package body "NHSSOA.BPEL_FETCHMEDICALASSESS" has errors
ORA-06508: PL/SQL: could not find program unit being called: "NHSSOA.BPEL_FETCHMEDICALASSESS"
ORA-06512: at line 1
Error Code: 4063</detail>
</part></bindingFault>
It looks like the wrapper package is erring somehow, although I have no idea what could be causing it. Could it be something to do with the %ROWTYPE parameters? No DDL has been changed between yesterday (working) and today (not working).
Im running JDev / SOA Suite 10.1.3.3
Edited by: Steve_Macleod on Sep 13, 2008 3:02 PM
Edited by: Steve_Macleod on Sep 13, 2008 6:32 PM
Edited by: Steve_Macleod on Sep 13, 2008 6:55 PM
Ok, Im replying to myself now... clearly loosing the plot!
I have noticed that the BPEL_GETPERSHISTDAT2.sql file (which is added when the DB adapter is created) looks like this:
-- Declare the SQL type for the PL/SQL type ROWTYPE_PL0
CREATE OR REPLACE TYPE ROWTYPE_SQL2 AS OBJECT (
ASSESS_FORM_ID NUMBER,
ASSESS_ID NUMBER,
PERS_HIST_DETS VARCHAR2(4000),
FORM_OWNER NUMBER,
ASSESS_UPDATED DATE,
ASSESS_ADDED DATE
show errors
-- Declare package containing conversion functions between SQL and PL/SQL types
CREATE OR REPLACE PACKAGE BPEL_GETPERSHISTDAT2 AS
-- Redefine a PL/SQL RECORD type originally defined via CURSOR%ROWTYPE
TYPE ROWTYPE_PL0 IS RECORD (
ASSESS_FORM_ID NUMBER,
ASSESS_ID NUMBER,
PERS_HIST_DETS VARCHAR2(4000),
FORM_OWNER NUMBER,
ASSESS_UPDATED DATE,
ASSESS_ADDED DATE);
-- Declare the conversion functions the PL/SQL type ROWTYPE_PL0
FUNCTION PL_TO_SQL5(aPlsqlItem ROWTYPE_PL0)
RETURN ROWTYPE_SQL2;
FUNCTION SQL_TO_PL5(aSqlItem ROWTYPE_SQL2)
RETURN ROWTYPE_PL0;
FUNCTION TOPLEVEL$NHSSOA_GET_PERS_HIST (P_ASSESS_FORM_ID NUMBER) RETURN ROWTYPE_SQL2;
END BPEL_GETPERSHISTDAT2;
show errors
CREATE OR REPLACE PACKAGE BODY BPEL_GETPERSHISTDAT2 IS
FUNCTION PL_TO_SQL5(aPlsqlItem ROWTYPE_PL0)
RETURN ROWTYPE_SQL2 IS
aSqlItem ROWTYPE_SQL2;
BEGIN
-- initialize the object
aSqlItem := ROWTYPE_SQL2(NULL, NULL, NULL, NULL, NULL, NULL);
aSqlItem.ASSESS_FORM_ID := aPlsqlItem.ASSESS_FORM_ID;
aSqlItem.ASSESS_ID := aPlsqlItem.ASSESS_ID;
aSqlItem.PERS_HIST_DETS := aPlsqlItem.PERS_HIST_DETS;
aSqlItem.FORM_OWNER := aPlsqlItem.FORM_OWNER;
aSqlItem.ASSESS_UPDATED := aPlsqlItem.ASSESS_UPDATED;
aSqlItem.ASSESS_ADDED := aPlsqlItem.ASSESS_ADDED;
RETURN aSqlItem;
END PL_TO_SQL5;
FUNCTION SQL_TO_PL5(aSqlItem ROWTYPE_SQL2)
RETURN ROWTYPE_PL0 IS
aPlsqlItem ROWTYPE_PL0;
BEGIN
aPlsqlItem.ASSESS_FORM_ID := aSqlItem.ASSESS_FORM_ID;
aPlsqlItem.ASSESS_ID := aSqlItem.ASSESS_ID;
aPlsqlItem.PERS_HIST_DETS := aSqlItem.PERS_HIST_DETS;
aPlsqlItem.FORM_OWNER := aSqlItem.FORM_OWNER;
aPlsqlItem.ASSESS_UPDATED := aSqlItem.ASSESS_UPDATED;
aPlsqlItem.ASSESS_ADDED := aSqlItem.ASSESS_ADDED;
RETURN aPlsqlItem;
END SQL_TO_PL5;
FUNCTION TOPLEVEL$NHSSOA_GET_PERS_HIST (P_ASSESS_FORM_ID NUMBER) RETURN ROWTYPE_SQL2 IS
RETURN_ ROWTYPE_SQL2;
BEGIN
RETURN_ := BPEL_GETPERSHISTDAT2.PL_TO_SQL5(NHSSOA_GET_PERS_HIST(P_ASSESS_FORM_ID));
return RETURN_;
END TOPLEVEL$NHSSOA_GET_PERS_HIST;
END BPEL_GETPERSHISTDAT2;
show errors
exit
The procedure that I am running from the DB adapter looks like this (I initially had this in a package, but simplified it into a stand-alone function):
create or replace FUNCTION NHSSOA_GET_PERS_HIST (p_assess_form_id NUMBER) RETURN nhssoa_a_types.pers_hist AS
CURSOR c_get_assess_dets IS
SELECT *
FROM nhscont_ass_pers_hist
WHERE assess_form_id = p_assess_form_id;
r_c_get_assess_dets c_get_assess_dets%ROWTYPE;
BEGIN
OPEN c_get_assess_dets;
FETCH c_get_assess_dets INTO r_c_get_assess_dets;
CLOSE c_get_assess_dets;
RETURN r_c_get_assess_dets;
END NHSSOA_GET_PERS_HIST;
The nhssoa_a_types.pers_hist type looks like this
TYPE pers_hist IS RECORD (
ASSESS_FORM_ID NUMBER,
ASSESS_ID NUMBER,
PERS_HIST_DETS VARCHAR2(4000 BYTE),
FORM_OWNER NUMBER,
ASSESS_UPDATED DATE,
ASSESS_ADDED DATE
I should add that the NHSSOA_GET_PERS_HIST function has been tested outside BPEL and works OK.
Similar Messages
-
Issue with DB Adapter - ORABPEL-11811
Hi,
I'm invoking a custom API using Db adapter and the process throws ORABPEL-11811 error at runtime. As per the error, I'd verified if the value passed is of incorrect datatype and its not so. I'm able to get the valid response if I test the custom API from an SQL prompt for the same input I pass in the BPEL process.
The error goes as this:
file:/app/orclas/esbdev03/bpel/domains/otm/tmp/.bpel_mytestpos_1.1_31f21ec7a8445e747f7c896429362b74.tmp/mydba.wsdl [ mydba_ptt::mydba(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'mydba' failed due to: Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.BPEL_MYDBA.XX_ONT_POS_SHIP_CONF_PKG$OD_P API. Cause: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at line 1
[Caused by: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at line 1
; nested exception is:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.BPEL_MYDBA.XX_ONT_POS_SHIP_CONF_PKG$OD_P API. Cause: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at line 1
[Caused by: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at "APPS.BPEL_MYDBA", line 1
ORA-06512: at line 1
Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
I'm using JDev 10.1.3.1.0. Can someone point out if this a valid error or a bug which needs a patch to be applied. I did verify for a similar issue in the forum but wasnt able to get a resolution to mine.
Thanks in advance,
GayathriHi,
Even after changing the OUT parameters to IN OUT parameters we encounter the same error.
The error is..
<2007-06-11 22:29:28,796> <ERROR> <default.collaxa.cube.ws> <AdapterFramework::O
utbound> file:/E:/NewBPEL/product/10.1.3.1/OraBPEL_1/bpel/domains/default/tmp/.b
pel_BPELProcess2_1.0_926648afbf81509a7362b645586f22f7.tmp/Apps.wsdl [ Apps_ptt::
Apps(InputParameters,OutputParameters) ] - Could not invoke operation 'Apps' aga
inst the 'Oracle Applications Resource Adapter' due to:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.XX_BPEL_APPS.XX_OM_POAC
KINT_PKG$VALIDATE_P API. Cause: java.sql.SQLException: ORA-06502: PL/SQL: numeri
c or value error
ORA-06512: at "APPS.XX_BPEL_APPS", line 1
ORA-06512: at "APPS.XX_BPEL_APPS", line 1
ORA-06512: at line 1
[Caused by: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "APPS.XX_BPEL_APPS", line 1
ORA-06512: at "APPS.XX_BPEL_APPS", line 1
ORA-06512: at line 1
Check to ensure that the API is defined in the database and that the parameters
match the signature of the API. Contact oracle support if error is not fixable.
<2007-06-11 22:29:28,812> <INFO> <default.collaxa.cube.ws> <AdapterFramework::Ou
tbound> Change logging level for Logger 'default.collaxa.cube.ws' to DEBUG to se
e full error stack
<2007-06-11 22:29:28,812> <ERROR> <default.collaxa.cube.ws> <AdapterFramework::O
utbound> file:/E:/NewBPEL/product/10.1.3.1/OraBPEL_1/bpel/domains/default/tmp/.b
pel_BPELProcess2_1.0_926648afbf81509a7362b645586f22f7.tmp/Apps.wsdl [ Apps_ptt::
Apps(InputParameters,OutputParameters) ] - Rolling back JCA LocalTransaction
Any help in this regard would be highly appreciated. -
ORABPEL-11811 - Error while calling PL/Sql API Into BPEL Process
Hi,
I have created a BPEL Process for creating a Order in Oracle using the synchronous process.
I have followed the below steps.
1) Created a Stored procedure using the Order Creation API's by passing Recard Type IN parameters.
2) Created Synchronous BPEL Process and called the above Procedure using APPS Adapter.
3) Created a xsd file and mapped the input and output parameter values using Transform Activity.
After the above steps, when I try to run the BPEL process I am getting the below error:
An error occurred while preparing and executing the APPS.PROC_PROC_NAME API. Cause: java.sql.SQLException: ORA-06531: Reference to uninitialized collection
ORA-06512: at "APPS.PROC_PROC_NAME ", line 149
ORA-06512: at line 1
[Caused by: ORA-06531: Reference to uninitialized collection
ORA-06512: at "APPS.PROC_NAME", line 149
ORA-06512: at line 1
; nested exception is:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.PROC_PROC_NAME API. Cause: java.sql.SQLException: ORA-06531: Reference to uninitialized collection.
Can anybody help in resolving the error?
Thanks,
Mastanvali.Here is the API Code..
CREATE OR REPLACE PROCEDURE XXMAST_PRC(
arg_in_p_header_rec IN HeaderObject,
arg_in_p_line_tbl IN arrayLines,
arg_out_x_return_status OUT VARCHAR2,
arg_out_order_number OUT NUMBER,
arg_out_header_id OUT NUMBER,
arg_out_flow_status_code OUT VARCHAR2
) AS
p_api_version_number NUMBER;
x_return_status VARCHAR2(2);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
v_msg_data VARCHAR2(8000);
v_msg_index_out NUMBER(10);
p_header_rec OE_ORDER_PUB.HEADER_REC_TYPE;
p_old_header_rec OE_ORDER_PUB.HEADER_REC_TYPE;
p_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type;
p_old_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type;
p_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type;
p_old_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type;
p_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type;
p_old_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type;
p_Header_price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type;
p_old_Header_Price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type;
p_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type;
p_old_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type;
p_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type;
p_old_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type;
p_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type;
p_old_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type;
p_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type;
p_old_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type;
p_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
p_old_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
p_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type;
p_old_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type;
p_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type;
p_old_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type;
p_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type;
p_old_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type;
p_Line_price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type;
p_old_Line_Price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type;
p_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type;
p_old_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type;
p_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type;
p_old_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type;
p_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type;
p_old_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type;
p_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type;
p_old_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type;
p_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type;
p_old_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type;
p_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type;
p_old_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type;
p_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type;
x_header_rec OE_ORDER_PUB.Header_Rec_Type;
x_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type;
x_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type;
x_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type;
x_Header_price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type;
x_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type;
x_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type;
x_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type;
x_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type;
x_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
x_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type;
x_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type;
x_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type;
x_Line_price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type;
x_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type;
x_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type;
x_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type;
x_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type;
x_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type;
x_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type;
x_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type;
icount NUMBER :=0;
BEGIN
fnd_global.apps_initialize(1318,21623,660);
fnd_client_info.set_org_context(204);
p_header_rec:= OE_ORDER_PUB.G_MISS_HEADER_REC;
SELECT OE_ORDER_HEADERS_S.NEXTVAL INTO p_header_rec.header_id FROM DUAL;
dbms_output.put_line('Header ID = '|| p_header_rec.header_id);
p_api_version_number := 1.0;
------------------------------------------header code-----------------------------------------------------------------------
p_header_rec.order_type_id := arg_in_p_header_rec.order_type_id;
p_header_rec.sold_to_org_id := arg_in_p_header_rec.sold_to_org_id;
p_header_rec.ship_to_org_id := arg_in_p_header_rec.ship_to_org_id;
p_header_rec.transactional_curr_code:= arg_in_p_header_rec.transactional_curr_code;
p_header_rec.order_source_id := arg_in_p_header_rec.order_source_id;
p_header_rec.org_id := arg_in_p_header_rec.org_id;
p_header_rec.ship_from_org_id := arg_in_p_header_rec.ship_from_org_id;
p_header_rec.payment_term_id := arg_in_p_header_rec.payment_term_id;
p_header_rec.price_list_id := 1000;
p_header_rec.freight_terms_code := 'Due'; -- Prepay and Add
p_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
p_header_rec.pricing_date := SYSDATE;
p_header_rec.creation_date := SYSDATE;
p_header_rec.booked_flag := 'N';
p_header_rec.created_by := 1318;
p_header_rec.last_updated_by := 1318;
p_header_rec.last_update_date := SYSDATE;
p_header_rec.invoice_to_org_id := 1424;
p_header_rec.version_number := 1;
p_header_rec.open_flag := 'Y';
p_header_rec.ordered_date := SYSDATE;
p_header_rec.flow_status_code := 'ENTERED';
p_header_rec.tax_exempt_flag := 'S';
p_header_rec.salesrep_id := -3;
--------------------------------------------LINES CODE------------------------------------------------------------
icount := 0;
for icount in 1 .. arg_in_p_line_tbl.count loop
p_line_tbl(icount) := Oe_Order_Pub.G_MISS_LINE_REC;
SELECT OE_ORDER_LINES_S.NEXTVAL INTO p_line_tbl(icount).line_id FROM DUAL;
dbms_output.put_line('Line ID = '|| p_line_tbl(icount).line_id);
p_line_tbl(icount).inventory_item_id := arg_in_p_line_tbl(icount).inventory_item_id;
p_line_tbl(icount).ordered_quantity := arg_in_p_line_tbl(icount).ordered_quantity;
p_line_tbl(icount).pricing_quantity := arg_in_p_line_tbl(icount).pricing_quantity;
p_line_tbl(icount).line_type_id := arg_in_p_line_tbl(icount).line_type_id;
p_line_tbl(icount).line_number := icount;
p_line_tbl(icount).shipment_number := arg_in_p_line_tbl(icount).shipment_number;
p_line_tbl(icount).ship_to_org_id := arg_in_p_line_tbl(icount).ship_to_org_id;
p_line_tbl(icount).sold_to_org_id := arg_in_p_line_tbl(icount).sold_to_org_id;
p_line_tbl(icount).salesrep_id := arg_in_p_line_tbl(icount).salesrep_id;
p_line_tbl(icount).payment_term_id := arg_in_p_line_tbl(icount).payment_term_id;
p_line_tbl(icount).price_list_id := 1000;
p_line_tbl(icount).operation := OE_GLOBALS.G_OPR_CREATE;
p_line_tbl(icount).open_flag := 'Y';
p_line_tbl(icount).booked_flag := 'N';
p_line_tbl(icount).header_id := p_header_rec.header_id;
p_line_tbl(icount).line_category_code := 'ORDER';
p_line_tbl(icount).order_quantity_uom :='Ea';
p_line_tbl(icount).request_date := SYSDATE;
p_line_tbl(icount).schedule_ship_date := SYSDATE;
p_line_tbl(icount).ship_from_org_id := 204;
p_line_tbl(icount).flow_status_code := 'ENTERED';
p_line_tbl(icount).ship_to_customer_id := 1290;
p_line_tbl(icount).invoice_to_org_id := 1424;
p_line_tbl(icount).tax_exempt_flag := 'S';
p_line_tbl(icount).tax_date := '02-Mar-2005';
p_line_tbl(icount).tax_code := 'Location';
SELECT OE_PRICE_ADJUSTMENTS_S.NEXTVAL INTO p_Line_Adj_tbl(icount).price_adjustment_id FROM DUAL;
dbms_output.put_line('Price Adjustment ID = '|| p_Line_Adj_tbl(icount).price_adjustment_id);
p_Line_Adj_tbl(icount).created_by := 1318;
p_Line_Adj_tbl(icount).header_id := p_header_rec.header_id;
p_Line_Adj_tbl(icount).line_id := p_line_tbl(icount).line_id;
p_Line_Adj_tbl(icount).percent := 10;
p_Line_Adj_tbl(icount).operation := OE_GLOBALS.G_OPR_CREATE;
p_Line_Adj_tbl(icount).list_header_id := 8988;
p_Line_Adj_tbl(icount).list_line_id := 16596;
p_Line_Adj_tbl(icount).list_line_type_code := 'DIS';
p_Line_Adj_tbl(icount).arithmetic_operator := 'AMT';
p_Line_Adj_tbl(icount).updated_flag := 'Y';
p_Line_Adj_tbl(icount).update_allowed := 'Y';
p_Line_Adj_tbl(icount).applied_flag := 'Y';
p_Line_Adj_tbl(icount).automatic_flag := 'N';
p_Line_Adj_tbl(icount).OPERAND := 10;
end loop;
oe_msg_pub.initialize;
oe_order_pub.process_order
( p_api_version_number => p_api_version_number
, p_init_msg_list => FND_API.G_FALSE
, p_return_values => FND_API.G_FALSE
, p_action_commit => FND_API.G_FALSE
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
, p_header_rec => p_header_rec
, p_old_header_rec => p_old_header_rec
, p_header_val_rec => p_header_val_rec
, p_old_header_val_rec => p_old_header_val_rec
, p_Header_Adj_tbl => p_Header_Adj_tbl
, p_old_Header_Adj_tbl => p_old_Header_Adj_tbl
, p_Header_Adj_val_tbl => p_Header_Adj_val_tbl
, p_old_Header_Adj_val_tbl => p_old_Header_Adj_val_tbl
, p_Header_price_Att_tbl => p_Header_price_Att_tbl
, p_old_Header_Price_Att_tbl => p_old_Header_Price_Att_tbl
, p_Header_Adj_Att_tbl => p_Header_Adj_Att_tbl
, p_old_Header_Adj_Att_tbl => p_old_Header_Adj_Att_tbl
, p_Header_Adj_Assoc_tbl => p_Header_Adj_Assoc_tbl
, p_old_Header_Adj_Assoc_tbl => p_old_Header_Adj_Assoc_tbl
, p_Header_Scredit_tbl => p_Header_Scredit_tbl
, p_old_Header_Scredit_tbl => p_old_Header_Scredit_tbl
, p_Header_Scredit_val_tbl => p_Header_Scredit_val_tbl
, p_old_Header_Scredit_val_tbl => p_old_Header_Scredit_val_tbl
, p_line_tbl => p_line_tbl
, p_old_line_tbl => p_old_line_tbl
, p_line_val_tbl => p_line_val_tbl
, p_old_line_val_tbl => p_old_line_val_tbl
, p_Line_Adj_tbl => p_Line_Adj_tbl
, p_old_Line_Adj_tbl => p_old_Line_Adj_tbl
, p_Line_Adj_val_tbl => p_Line_Adj_val_tbl
, p_old_Line_Adj_val_tbl => p_old_Line_Adj_val_tbl
, p_Line_price_Att_tbl => p_Line_price_Att_tbl
, p_old_Line_Price_Att_tbl => p_old_Line_Price_Att_tbl
, p_Line_Adj_Att_tbl => p_Line_Adj_Att_tbl
, p_old_Line_Adj_Att_tbl => p_old_Line_Adj_Att_tbl
, p_Line_Adj_Assoc_tbl => p_Line_Adj_Assoc_tbl
, p_old_Line_Adj_Assoc_tbl => p_old_Line_Adj_Assoc_tbl
, p_Line_Scredit_tbl => p_Line_Scredit_tbl
, p_old_Line_Scredit_tbl => p_old_Line_Scredit_tbl
, p_Line_Scredit_val_tbl => p_Line_Scredit_val_tbl
, p_old_Line_Scredit_val_tbl => p_old_Line_Scredit_val_tbl
, p_Lot_Serial_tbl => p_Lot_Serial_tbl
, p_old_Lot_Serial_tbl => p_old_Lot_Serial_tbl
, p_Lot_Serial_val_tbl => p_Lot_Serial_val_tbl
, p_old_Lot_Serial_val_tbl => p_old_Lot_Serial_val_tbl
, p_action_request_tbl => p_action_request_tbl
, x_header_rec => x_header_rec
, x_header_val_rec => x_header_val_rec
, x_Header_Adj_tbl => x_Header_Adj_tbl
, x_Header_Adj_val_tbl => x_Header_Adj_val_tbl
, x_Header_price_Att_tbl => x_Header_price_Att_tbl
, x_Header_Adj_Att_tbl => x_Header_Adj_Att_tbl
, x_Header_Adj_Assoc_tbl => x_Header_Adj_Assoc_tbl
, x_Header_Scredit_tbl => x_Header_Scredit_tbl
, x_Header_Scredit_val_tbl => x_Header_Scredit_val_tbl
, x_line_tbl => x_line_tbl
, x_line_val_tbl => x_line_val_tbl
, x_Line_Adj_tbl => x_Line_Adj_tbl
, x_Line_Adj_val_tbl => x_Line_Adj_val_tbl
, x_Line_price_Att_tbl => x_Line_price_Att_tbl
, x_Line_Adj_Att_tbl => x_Line_Adj_Att_tbl
, x_Line_Adj_Assoc_tbl => x_Line_Adj_Assoc_tbl
, x_Line_Scredit_tbl => x_Line_Scredit_tbl
, x_Line_Scredit_val_tbl => x_Line_Scredit_val_tbl
, x_Lot_Serial_tbl => x_Lot_Serial_tbl
, x_Lot_Serial_val_tbl => x_Lot_Serial_val_tbl
, x_action_request_tbl => x_action_request_tbl
IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
COMMIT;
dbms_output.put_line('Return Status - '|| SUBSTR (x_return_status,1,255));
dbms_output.put_line('------------------------------------');
dbms_output.put_line('Order Number ==== '|| x_header_rec.order_number);
dbms_output.put_line('------------------------------------');
arg_out_x_return_status := x_return_status;
arg_out_order_number := x_header_rec.order_number;
arg_out_header_id := p_header_rec.header_id;
arg_out_flow_status_code := p_header_rec.flow_status_code;
ELSE
dbms_output.put_line('Return Status = '|| SUBSTR (x_return_status,1,255));
dbms_output.put_line('Msg Count = '|| TO_CHAR(x_msg_count));
dbms_output.put_line('Msg Data = '|| SUBSTR (x_msg_data,1,255));
IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count LOOP
Oe_Msg_Pub.get(
p_msg_index => i
,p_encoded => Fnd_Api.G_FALSE
,p_data => v_msg_data
,p_msg_index_out => v_msg_index_out
DBMS_OUTPUT.PUT_LINE('v_msg_index_out '|| v_msg_index_out);
DBMS_OUTPUT.PUT_LINE('v_msg_data '|| v_msg_data);
END LOOP;
END IF;
END IF;
END;
/ -
DB adapter returning 0 rows = Error
Im using the database adapter to recieve multiple rows. The BPEL process works ok when the supplied ID has records (ie when the procedure call returns rows in the table). When there are no records returned however, my db adapter call gives me an error:
<bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>6502</code>
</part><part name="summary"><summary>file:/C:/soa_suite/bpel/domains/default/tmp/.bpel_GetAssessmentsForMultiPxReferral_1.0_ec761d48116898da9d36c7401e882f66.tmp/getAssessmentsForPxReferral.wsdl [ getAssessmentsForPxReferral_ptt::getAssessmentsForPxReferral(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'getAssessmentsForPxReferral' failed due to: Error while trying to prepare and execute an API.
An error occurred while preparing and executing the NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR.NHSSOA_GET_ASSESS_TAB$GETPXAS API. Cause: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at line 1
[Caused by: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at line 1
; nested exception is:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR.NHSSOA_GET_ASSESS_TAB$GETPXAS API. Cause: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at line 1
[Caused by: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at line 1
Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
</summary>
</part><part name="detail"><detail>
Internal Exception: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at "NHSSOA.BPEL_GETASSESSMENTSFORPXREFERR", line 1
ORA-06512: at line 1
Error Code: 6502</detail>
</part></bindingFault>
I suspect that this could be handled either way (through PL/SQL, or BPEL - error handling perhaps?) my question is; what is the recomended way to approach a db adapter call not returning any records? Ive checked the XSD and the minoccurs for the record is set to 0.
The PL/SQL db adapter code is as follows:
FUNCTION getPxAssessTab (p_ref_id NUMBER) RETURN assessTabType
IS
CURSOR c_get_px_assess IS
SELECT *
FROM nhscont_assess
WHERE ref_id = p_ref_id;
r_c_get_px_assess c_get_px_assess%ROWTYPE;
v_new_tab assessTabType;
x PLS_INTEGER := 0;
BEGIN
OPEN c_get_px_assess;
LOOP
FETCH c_get_px_assess INTO r_c_get_px_assess;
EXIT WHEN c_get_px_assess%NOTFOUND;
x := x + 1;
v_new_tab(x) := r_c_get_px_assess;
END LOOP;
CLOSE c_get_px_assess;
RETURN v_new_tab;
END;One possible cause for this may be due to a version incompatibility between JDeveloper and SOA. Make sure that both components are version 10.1.3.3 or above. From the stack trace, it looks like the use of JPublisher is involved. There were several fixes added for 10.1.3.3/10.1.3.4 to address problems like yours. We've seen this issue posted in the BPEL and SOA forums before.
-
Data service (DB adapter) returns XML with missing collection's content
Hello.
I am facing problem with DB adapter connected to MySQL database.
When I use select from 1-2 tables (connected by master-detail relationship) adapter works fine.
When I use more than 2 tables adapter returns only master table and empty detail collections.
This is example of 2 tables (master-detail) response
<BasketItemCollection>
<BasketItem>
<basketItemId>234</basketItemId>
<loggedUserId>126</loggedUserId>
<itemTitle>itemTitle</itemTitle>
<itemPartNo/>
<itemPrice>301.26</itemPrice>
<itemVat>0.0</itemVat>
<itemQty>1</itemQty>
<itemNote/>
<dateInsert>2009-10-08T16:07:30.000+02:00</dateInsert>
<basketInvoiceId>44</basketInvoiceId>
<documents>
<docId>560</docId>
<dateCreated>2011-08-23T09:14:52.000+02:00</dateCreated>
<available>false</available>
<passwordProtected xsi:nil="true"/>
</documents>
</BasketItem>
</BasketItemCollection>
This is example of response after adding 1 master table
<BasketInvoiceCollection>
<BasketInvoice>
<basketInvoiceId>44</basketInvoiceId>
<browserId>371</browserId>
<loggedUserId>126</loggedUserId>
<createDate>2009-10-08T16:08:17.000+02:00</createDate>
<statusId>7</statusId>
<deliveryCompany xsi:nil="true"/>
<deliveryName>Alena Molnarova</deliveryName>
<deliveryStreet>fgh</deliveryStreet>
<deliveryCity>fgh</deliveryCity>
<deliveryZip>9054</deliveryZip>
<deliveryCountry>fghfgh</deliveryCountry>
<internalInvoiceId xsi:nil="true"/>
<userNote>fghfgh</userNote>
<userLng>sk</userLng>
<paymentMethod>cash_on_delivery</paymentMethod>
<deliveryMethod>Prevzatie tovaru osobne</deliveryMethod>
<htmlCode xsi:nil="true"/>
<currency>skk</currency>
<basketItemCollection/>
</BasketInvoice>
</BasketInvoiceCollection>
basketItemCollection is here empty.
Where can be a problem hidden?
Thanks in advance for any helpHi.
JDeveloper use aliase names for tables by default so aliases t0, t1, t3 are used for tables basketinvoice, basketitem, documents.
I think there is some connection to table. Collection of basketinvoicepayments table is missing when 3 tables select and 2 tables select too.
Table basketinvoicepayments is child table and it's element is missing even when relationship is 1:M or 1:1 (Foreign Key on Child table). -
Database adapter returns result different to SQL
Hi,
I created Database adapter for master-detail select:
SELECT DISTINCT t1.INSTANCE_ID, t1.SERVICE_ID, t0.CONFIGURATION_KEY, t0.CONFIGURATION_VALUE, t0.INSTANCE_ID FROM SRVINSTANCECONF t0, SERVICE_INSTANCE t1
WHERE (((t0.CONFIGURATION_KEY = #key) AND (t1.SERVICE_ID = #serviceID)) AND (t0.INSTANCE_ID = t1.INSTANCE_ID))
This select in our database return 2 rows. This is what I want.
But when I call webservice with database adapter this returns 2 master tags but all detail tags. It looks like t0.CONFIGURATION_KEY = #key where condition is not taken into SQL statement.
Thankspk of detail is t0.CONFIGURATION_VALUE, t0.INSTANCE and row are not duplicated. Problem is that rows are not filtered.
There are all rows with SERVICE_ID = 2
INSTANCE_ID, SERVICE_ID, CONFIGURATION_KEY
3,2,"instanceType"
3,2,"keyName"
3,2,"device"
3,2,"tebs"
3,2,"size"
3,2,"imageId"
3,2,"securityGroups"
3,2,"dir"
2,2,"imageId"
Adapter returns for CONFIGURATION_KEY = "imageId" AND SERVICE_ID = 2 this XML
<top:ServiceInstanceCollection xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/InstancesConfigurationAdapter">
<top:ServiceInstance>
<top:instanceId>2</top:instanceId>
<top:serviceId>2</top:serviceId>
<top:srvinstanceconfCollection>
<top:Srvinstanceconf>
<top:configurationKey>imageId</top:configurationKey>
</top:Srvinstanceconf>
</top:srvinstanceconfCollection>
</top:ServiceInstance>
<top:ServiceInstance>
<top:instanceId>3</top:instanceId>
<top:serviceId>2</top:serviceId>
<top:srvinstanceconfCollection>
<top:Srvinstanceconf>
<top:configurationKey>instanceType</top:configurationKey>
</top:Srvinstanceconf>
<top:Srvinstanceconf>
<top:configurationKey>securityGroups</top:configurationKey>
</top:Srvinstanceconf>
<top:Srvinstanceconf>
<top:configurationKey>size</top:configurationKey>
</top:Srvinstanceconf>
<top:Srvinstanceconf>
<top:configurationKey>dir</top:configurationKey>
</top:Srvinstanceconf>
<top:Srvinstanceconf>
<top:configurationKey>imageId</top:configurationKey>
</top:Srvinstanceconf>
<top:Srvinstanceconf>
<top:configurationKey>tebs</top:configurationKey>
</top:Srvinstanceconf>
<top:Srvinstanceconf>
<top:configurationKey>keyName</top:configurationKey>
</top:Srvinstanceconf>
<top:Srvinstanceconf>
<top:configurationKey>device</top:configurationKey>
</top:Srvinstanceconf>
</top:srvinstanceconfCollection>
</top:ServiceInstance>
</top:ServiceInstanceCollection> -
Adapter Return Value Truncated
I am trying to understand what is going on with an adapter return value. Why would the return value be truncated to 1 character and then the result be "null" when the actual value the script returns is shown as "SUCCESS"?
The web console shows the task a failed with a Response and Task Status of null.
Class/Method: tcAdpEvent/setAdpRetVal entered.
Class/Method: tcAdpEvent/getRetValString entered.
Class/Method: tcAdpEvent/getRetValString - Data: class - Value: java.lang.String
Class/Method: tcAdpEvent/getRetValString - Data: poRetVal.toString() - Value: SUCCESS
Class/Method: tcAdpEvent/getRetValString - Data: Returning:sRetVal - Value: SUCCESS
Class/Method: tcAdpEvent/getRetValString left.
Class/Method: tcAdpEvent/setAdpRetVal - Data: Setting Adapter Return Value to SUCCESS - Value:
Class/Method: tcAdpEvent/setAdpRetVal left.
Class/Method: tcAdpEvent/finalizeProcessAdapter entered.
Class/Method: tcAdpEvent/finalizeProcessAdapter - Data: Truncating to 1 characters - Value:
Class/Method: tcAdpEvent/finalizeProcessAdapter - Data: Mapped to Response Code - Value:
Class/Method: tcAdpEvent/updateSchItem entered.
Class/Method: tcAdpEvent/updateSchItem - Data: event - Value: adpRUNCOMMAND
Class/Method: tcAdpEvent/updateSchItem - Data: New Status - Value:
Class/Method: tcAdpEvent/updateSchItem - Data: SchData - Value: null
Class/Method: tcAdpEvent/updateSchItem - Data: Reason - Value:
Class/Method: tcAdpEvent/updateSchItem left.
Class/Method: tcAdpEvent/finalizeProcessAdapter left.
Adapter: adpRUNCOMMAND has completed for the task: Final Update.
-----------------------------------------------------Hi
Have you got a solution for this?
I'm having the same extrange behaviour with my adapter.
In my case I'm using same adapter to enable/disable a user. One adapter variable determines if the action to perform is enable or disable.
This adapter is integrated in two process tasks (Enable User and Disable User). What I can't understand is why it returns correct responses when disabling users, but returns just the first char of the response code when enablig users...
Any hint?
Thks -
Creation of Data Control for custom java method which will return records
Hi Guys,
I have a requirement of creating a a custom java method in App module which will return a record set taking an id as input.In case of single return type it works fine but in case of returning record set it is not working.In my case i have to combine two tables and return it as a single entity as a view in Data Control.
Warm Regards,
Srinivas.Why don't you just create a custom view object? There's even an example or 2 in the docs:
http://docs.oracle.com/cd/E16162_01/web.1112/e16182/intro_tour.htm#CHDGDIEC (check out "View object on refcursor" example)
Edit: you are aware that you can create a View Object based on more than one table?
John -
Implementing oracle.tip.adapter.api.record.XMLRecord
I have a working custom JCA adapter, except it is not returning objects which implement the oracle.tip.adapter.api.record.XMLRecord class. I would do this except I cannot find that library anywhere to include in my classpath, so I cannot implement it.
Where can I get this so I can implement it? Any help would be much appreciated.In case anybody else runs into this issue... I included jar files of my oracle installation until I found the right one. I think the orabpel.jar had this, or the orablpel-thirdparty.jar.
-
Oracle.tip.adapter.api.record
I am producing an XMLRecord converter class which needs the oracle.tip.adapter.api.record.XMLRecord interface definition. Can anyone tell me where to find the library with this class?
Does anyone have an example of a XMLRecordConverter implementation class?In case anybody else runs into this issue... I included jar files of my oracle installation until I found the right one. I think the orabpel.jar had this, or the orablpel-thirdparty.jar.
-
Return records from Stored Procedure to Callable Statement
Hi All,
I am createing a web application to display a students score card.
I have written a stored procedure in oracle that accepts the student roll number as input and returns a set of records as output containing the students scoring back to the JSP page where it has to be put into a table format.
how do i register the output type of "records" from the stored function in oracle in the "registerOutParameter" method of the "callable" statement in the JSP page.
if not by this way is there any method using which a "stored function/procedure" returning "record(s)" to the jsp page called using "callable" statement be retrieved to be used in the page. let me know any method other that writing a query for the database in the JSP page itself.I have a question for you:
If the stored procedure is doing nothing more than generating a set of results why are you even using one?
You could create a view or write a simple query like you mentioned.
If you're intent on going the stored procedure route, then I have a suggestion. Part of the JDBC 2.0 spec allows you to basically return an object from a CallableStatement. Its a little involved but can be done. An article that I ran across a while back really helped me to figure out how to do this. There URL to it is as follows:
http://www.fawcette.com/archives/premier/mgznarch/javapro/2000/03mar00/bs0003/bs0003.asp
Pay close attention to the last section of the article: Persistence of Structured Types.
Here's some important snippets of code:
String UDT_NAME = "SCHEMA_NAME.PRODUCT_TYPE_OBJ";
cstmt.setLong(1, value1);
cstmt.setLong(2, value2);
cstmt.setLong(3, value3);
// By updating the type map in the connection object
// the Driver will be able to convert the array being returned
// into an array of LikeProductsInfo[] objects.
java.util.Map map = cstmt.getConnection().getTypeMap();
map.put(UDT_NAME, ProductTypeObject.class);
super.cstmt.registerOutParameter(4, java.sql.Types.STRUCT, UDT_NAME);
* This is the class that is being mapped to the oracle object.
* There are two methods in the SQLData interface.
public class ProductTypeObject implements java.sql.SQLData, java.io.Serializable
* Implementation of method declared in the SQLData interface. This method
* is called by the JDBC driver when mapping the UDT, SCHEMA_NAME.Product_Type_Obj,
* to this class.
* The object being returned contains a slew of objects defined as tables,
* these are retrieved as java.sql.Array objects.
public void readSQL(SQLInput stream, String typeName) throws SQLException
String[] value1 = (String[])stream.readArray().getArray();
String[] value2 = (String[])stream.readArray().getArray();
public void writeSQL(SQLOutput stream) throws SQLException
}You'll also need to create Oracles Object. The specification for mine follows:
TYPE Detail_Type IS TABLE OF VARCHAR2(1024);
TYPE Product_Type_Obj AS OBJECT (
value1 Detail_Type,
value2 Detail_Type,
value3 Detail_Type,
value4 Detail_Type,
value5 Detail_Type,
value6 Detail_Type,
value7 Detail_Type,
value8 Detail_Type);Hope this helps,
Zac -
Query returns record in SQL Developer but not in iSQLPlus
... back in a minute, I may not have done a commit at the end of the insert.
The problem I was having was I hadnt commited the record in SQL Developer but the queries where returning records in this environment but not in iSQLPlus or Apex and it was confusing me.
Message was edited by:
Benton
Message was edited by:
BentonFinally got to know the reason why Timezone Abbr woudn't show up in SQL Plus.
I ran below query in SQL PLUS
SELECT SESSIONTIMEZONE, CURRENT_TIMESTAMP, systimestamp, LOCALTIMESTAMP FROM DUAL;
SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
-05:00 08-SEP-12 12.00.31.575228 AM -05:00 08-SEP-12 12.00.31.575223 AM -05:00 08-SEP-12 12.00.31.575228 AM
Now executed the same query in SQL Developer:
SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
America/Chicago 08-SEP-12 12.08.32.072424000 AM AMERICA/CHICAGO 08-SEP-12 12.08.32.072420000 AM -05:00 08-SEP-12 12.08.32.072424000 AM
The difference between the 2 outputs is the way in which time_zones were respresented. In SQL PLUS, it is shown as an offset whereas in SQL Developer as a time zone region name. Now there are many "time sone regions" that follow an offset of -5:00. This confuses Oracle and a "UNK"(Unknown) for a query like the one below when trying to execute in SQL PLUS:
select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
EXTRACT(TI
UNK
Therefore we need to specify the exact Time Zone Region(TZR) in order to obtain the corresponding TZD(Daylight Savings Format i.e. CDT or CST). This we do by altering the session environment vaiable time_zone
alter session set time_zone='America/Chicago';
Now executing the queries to find the abbreviated time zone( in TZD format) will finally work to return a non-null char value.
select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
EXTRACT(TI
CDT
select to_char(CURRENT_TIMESTAMP, 'TZD') from dual;
TO_CHA
CDT -
Does a table/view still return records if the underlying VPD policy fails ?
Hi All,
I have one following question -
Does a table or view still return records if the underlying VPD policy fails?
I am adding one more thing here. Let us say security is being implemented using the application context and VPD.
What would happen when application context is not set ? Would the application apply any default privilege as VPD?
Thanks,
AshiAshiKD wrote:
Hi All,
I have one following question -
Does a table or view still return records if the underlying VPD policy fails?No, you get a standard error message if the VPD function is wrong and if you won't pass the conditions of the VPD, you get nothing. That's what in general happens and should happen as well.
>
I am adding one more thing here. Let us say security is being implemented using the application context and VPD.
What would happen when application context is not set ? Would the application apply any default privilege as VPD?This would be a wrong approach then. If you are truly setting a VPD, you have to make sure that the context is set and the condition variable are passed through it. This is normally done through a logon trigger so again, generically , its not possible that it would not be set. I didn't get at all what ever you said in the last line? What is "default priv for VPD" ?
HTH
Aman.... -
Join 3 tables, return records which no match found in table 1 as null
Hi Gurus,
I really need your expert advice. I am stuck in below query.
I have joined 3 tables,
table 2 is an information reference (to get the process code and process name)
table 1 have and table 3 have daily data (which will have the process code and its values/qty)
all values return from table 1 and 3(rtrwip00 and prdyld01) should refer to code in table 1.
There can be a scenario where on a day, a process was stop, so it dont have values/qty in table 1/3,
The problem is my query will return only rows which have records in table 1/3.
While I want all the records in table 2 to be returned no matter have data or not in table 1/3, in case no data in table 1/3, return qty as '0'.
Please advice me..thanks in advance :)
Select lot.rw_oper,
lot.rw_area_grp,
lot.rw_oper_name,
proc_out.proc_out,
lot.rw_qty
from
( SELECT UNIQUE a.rw_oper,a.rw_area_grp,a.rw_oper_name,SUM(CASE WHEN a.rw_qty_unit = 'CM' THEN a.rw_qty*10 ELSE rw_qty END )as rw_qty
From rtrwip00 a, oprinf99 b
WHERE a.rw_facility='MIPOPRD'
AND b.oi_facility = a.rw_facility AND b.oi_oper = a.rw_oper
GROUP BY a.rw_area_grp,a.rw_oper,a.rw_oper_name
ORDER BY a.rw_oper,a.rw_area_grp) lot,
( SELECT py_oper, SUM(CASE WHEN py_out_unit1 = 'CM' THEN py_proc_out1*10 ELSE py_proc_out1 END) proc_out
FROM prdyld01
WHERE py_facility = 'MIPOPRD'
AND py_trs_time between TO_CHAR(SYSDATE-1,'YYYYMMDD')||'070000' AND TO_CHAR(SYSDATE,'YYYYMMDD')||'070000'
group by py_oper
)proc_out
where lot.rw_oper NOT IN ('2900','6700' ,'9100' ,'9920' ,'9921','9940','9941','9300','9500','6700','8910', 'REJT')
and lot.rw_oper = proc_out.py_oper
order by lot.rw_operCREATE TABLE PRDYLD01
PY_FACILITY VARCHAR2(12 BYTE) NOT NULL,
PY_TRS_TIME VARCHAR2(14 BYTE) NOT NULL,
PY_LOT VARCHAR2(11 BYTE) NOT NULL,
PY_OPER VARCHAR2(4 BYTE) NOT NULL,
PY_PO VARCHAR2(12 BYTE) NOT NULL,
PY_PROC_IN1 NUMBER(10,2) DEFAULT 0 NOT NULL,
PY_PROC_IN2 NUMBER(10,2) DEFAULT 0 NOT NULL,
PY_PROC_OUT1 NUMBER(10,2) DEFAULT 0 NOT NULL,
PY_PROC_OUT2 NUMBER(10,2) DEFAULT 0 NOT NULL,
sample data 1
PY_OPER PROC_OUT
3000 481
3100 214
3200 642
3250 291
5250 519
5300 439
5350 476
CREATE TABLE RTRWIP00
RW_FACILITY VARCHAR2(12 BYTE) NOT NULL,
RW_LOT VARCHAR2(11 BYTE) NOT NULL,
RW_OPER VARCHAR2(4 BYTE) NOT NULL,
RW_OPER_NAME VARCHAR2(35 BYTE) NOT NULL,
RW_PO VARCHAR2(12 BYTE) NOT NULL,
RW_AREA_GRP VARCHAR2(12 BYTE) NOT NULL,
RW_QTY NUMBER(10,2) DEFAULT 0 NOT NULL,
RW_QTY_UNIT VARCHAR2(6 BYTE) NOT NULL,
sample data 2
RW_OPER RW_QTY
3000 1248
3100 324
3200 133
3250 357
4400 424
4500 821
4600 909
5050 689
5250 2472
5300 53
5350 166
CREATE TABLE OPRINF99
OI_FACILITY VARCHAR2(12 BYTE) NOT NULL,
OI_OPER VARCHAR2(4 BYTE) NOT NULL,
OI_OPER_SEQ NUMBER(5) NOT NULL,
OI_AREA_GRP VARCHAR2(12 BYTE),
OI_SHORT_DESC VARCHAR2(10 BYTE) NOT NULL,
OI_LONG_DESC VARCHAR2(35 BYTE),
sample data 3
RW_OPER RW_AREA_GRP RW_OPER_NAME
3000 MOD ROD MOUNT
3100 MOD WIRE SAW
3200 MOD AS-CUT CLEANER
3250 MOD BEAM REMOVAL
4400 POL ESE-II
4500 POL EDGE OXIDE STRIP
4600 POL LTO INSPECTION
5050 POL DOUBLE SIDE BUFFER
5250 POL ACCUMULATION
5300 POL FINAL POLISHER
5350 CLN POST POLISH CLEANER
ABove is the DLL for the table and its mock data.
Sample output should be like below; where when no data found in sample data 1, it will return '0'
RW_OPER RW_AREA_GRP RW_OPER_NAME PROC_OUT RW_QTY
3000 MOD ROD MOUNT 481 1248
3100 MOD WIRE SAW 214 324
3200 MOD AS-CUT CLEANER 642 133
3250 MOD BEAM REMOVAL 291 357
4400 POL ESE-II 0 424
4500 POL EDGE OXIDE STRIP 0 821
4600 POL LTO INSPECTION 0 909
5050 POL DOUBLE SIDE BUFFER 0 689
5250 POL ACCUMULATION 519 2472
5300 POL FINAL POLISHER 439 53
5350 CLN POST POLISH CLEANER 476 166
mY current output is below; only return record that have match to all table.
RW_OPER RW_AREA_GRP RW_OPER_NAME PROC_OUT RW_QTY
3000 MOD ROD MOUNT 481 1248
3100 MOD WIRE SAW 214 324
3200 MOD AS-CUT CLEANER 642 133
3250 MOD BEAM REMOVAL 291 357
5250 POL ACCUMULATION 519 2472
5300 POL FINAL POLISHER 439 53
5350 CLN POST POLISH CLEANER 476 166
Really appreciate your response, sorry for taking time to reply.
Thanks in advance :) -
[HELP] Procedure return records
Hi All,
I want to create a procedure that will return records (not only single record) base on some parameters. Is it possible?
While i used MS SQL Server, it is just a simple way. In the body of procedure i just need to call select query with some parameters in where clause. For example:
Create procedure GetEmployee
@grade char(1)
As
Select * From Employee Where EMP_Grade=@grade
Please help me!First off, what are you going to do with the records that are returned here?
Second, you can return a REF CURSOR
CREATE OR REPLACE PACKAGE refcursor_demo
AS
TYPE emp_refcursor_strong IS REF CURSOR RETURN emp%rowtype;
TYPE emp_refcursor_weak IS REF CURSOR;
-- You can define either procedures that have the strongly typed
-- REF CURSOR as an OUT parameter or you can define a function that
-- returns the REF CURSOR.
PROCEDURE refCursorProc( employees OUT emp_refcursor_strong );
FUNCTION refCursorFunc RETURN emp_refcursor_weak;
END;
CREATE OR REPLACE PACKAGE BODY refcursor_demo
AS
PROCEDURE refCursorProc( employees OUT emp_refcursor_strong )
AS
BEGIN
OPEN employees FOR
SELECT * FROM emp;
END;
FUNCTION refCursorFunc RETURN emp_refcursor_weak
IS
out_cursor emp_refcursor_weak;
BEGIN
OPEN out_cursor FOR
SELECT * FROM emp;
RETURN out_cursor;
END;
END;Alternately, you could return a collection, potentially in a pipelined table function.
Justin
Maybe you are looking for
-
Slider on 20GB Zen Touch stopped working
(Slider on 20GB Zen Touch stopped workinge I love my Zen so much, and the slider (touch pad) on my Zen Touch just stopped working. Last month, there was a couple of times where it stopped working, and it was fixed by turning it off and back on. That
-
Text shrinks if I change the resolution too many times
Hi, I have an strange issue, if i go to Document properties and I change the resolution from 4:3 to 16:9 everything is fine, if I go back to 4:3 the text looks smaller, if I do the same thing over and over again the text don't event fit in the boxes,
-
Hello everyone, I had an issue regarding performing quality check upon returing delivery. Let me explain the situation. My sales happen from Plant 2 (it is not the manufacturing plant or the plant wher QC happens) Manufacturing and QC happens in Pla
-
I can't electronically sign a PDF document
I have a PDF document (visa application) which requires an electronic signature however all the 'sign' options that are avaliable to me do not seem to work. When clicking on the 'Sign' option to the right side of the document all the options in the d
-
Canon MP Navigator Stopped Working (MX870)
Running Windows7, 64 bit Oper System Canon MX870 Scanning was not an issue prior to a few days ago. No new software or programs have been installed. Went to scan a document and scanning looked like it was working, then it greyed out and received erro