Inserire il numero di errori in un array durante l'esecuzio​ne di un programma
Salve,
ho fatto un programma in Labview che interroga 88 dispositivi collegati in serie tramite rs 485. Durante il ciclo del programma vorrei contare il numero di ERRORI (se presenti) inserendoli internamente ad un ARRAY.
Come posso fare?
Grazie della cortesia
Buon giorno,
ho guardato l'immagine del VI e la ringrazio. Nel dettaglio allego le immagini del pannello operatore e della struttura che ho creato.
In pratica devo interrogare un numero di dispositivi che va da 0 ad 88 funzionanti tramite protocollo rs485. Il ciclo è un For Loop ed il numero di volte che deve funzionare lo inserisco nella casella "N° indirizzi validi" nel pannello operatore.
Sempre nel pannello operatore è presente un array denominato "Errori". li vorrei inserire per il numero di errori (se presenti) per ogni ciclo.
Posso inserire la VI da lei inviata all'interno del mio ciclo For?
Grazie della cortesia
Allegati:
Interrogo la rs485.jpg 147 KB
Pannello operatore.jpg 76 KB
Similar Messages
-
Getting error-ORA-24381: error(s) in array DML
Hi i have written the following code to bulk insert into a database table.
I am getting an error while returning the result of the bulk insert query into the collection
I have tried to track it by using sql%bulk_exceptions.error_code.
But the error code that it is showing is just 1.
I trapped it using sqlerrm.
and that is showing-error(s) in array DML
What do i do?
DECLARE
CURSOR temp_rec_tap_cur
IS
SELECT *
FROM temp_records_tap;
TYPE temp_rec_tab IS TABLE OF temp_rec_tap_cur%ROWTYPE;
v_test_tab temp_rec_tab;
v_rec_num num_tab;
v_filename temp_records_tap.file_name%TYPE;
v_error_code tap_reject.error_code%type;
v_rej_value tap_reject.field_rej%type;
v_errors number;
BEGIN
SELECT file_name
INTO v_filename
FROM table1
WHERE ROWNUM<2;
OPEN temp_rec_tap_cur;
LOOP
BEGIN
FETCH temp_rec_tap_cur
BULK COLLECT INTO v_test_tab LIMIT 1000;
FORALL i IN v_test_tab.FIRST .. v_test_tab.LAST SAVE EXCEPTIONS
INSERT INTO tapdetail_tapin
VALUES v_test_tab (i)
RETURNING record_num
BULK COLLECT INTO v_rec_num;
EXCEPTION
WHEN DUP_VAL_ON_INDEX
THEN
NULL;
WHEN OTHERS
THEN
v_errors:=sql%bulk_exceptions.count;
for i in 1..v_errors
loop
dbms_output.put_line(sql%bulk_exceptions(i).error_code);
p3_errorlog ('TAPINDETAWARE', SQLERRM, v_filename);
end loop;
END;
--RAISE;
EXIT WHEN temp_rec_tap_cur%NOTFOUND;
END LOOP;
INSERT INTO table2
SELECT file_id, file_name, sender_pmn, recipient_pmn, call_date,
call_date_only, call_type, call_number, FIRST_RECORD,
service_type, service_code, home_bid, serve_bid,
chargeable_subs_type, imsi_min, msisdn_mdn, air_charges,
air_charges_sdr, air_time, national_call_charges,
national_call_charges_sdr, national_call_time,
international_call_charges, international_call_charges_sdr,
international_call_time, dir_assist_charges,
dir_assist_charges_sdr, dir_assist_time, other_charges,
other_charges_sdr, other_time, volume_charges,
volume_charges_sdr, volume_units, tot_charges, tot_charges_sdr,
tot_duration, state_tax, state_tax_sdr, local_tax,
local_tax_sdr, state_and_use_tax, state_and_use_tax_sdr, va_tax,
va_tax_sdr, other_tax, other_tax_sdr, charge_refund_indicator,
advised_charge_currency, advised_charge, advised_charge_sdr,
advised_charge_commission, advised_charge_commission_sdr,
exchange_rate, mcc, mnc, process_date, chargeable_units,
record_num, mscid,null,null,decode(call_type,0,'250',1,'251',5,'255'),null,'Duplicate Call'
from temp_records_tap
where record_num not in (select column_value from table(v_rec_num)) ;
EXCEPTION
WHEN OTHERS THEN
p3_errorlog ('TAP', SQLERRM, v_filename);
END;Edited by: user8731258 on Sep 14, 2010 2:58 AM
Edited by: user8731258 on Sep 14, 2010 3:01 AMWhat is the type declaration of num_tab and how is record_num defined?
ORA-24381: error(s) in array DML
Cause: One or more rows failed in the DML.indicates that you fail on the insert itself. Are the table definitions the same? Same primary/unique keys?
Edited by: MBr on 14-Sep-2010 03:16 -
ORA-24381: error(s) in array DML - Reasons
Hi all,
Do you know when we could recieve this exceptions?
I found one case - if we deal with FORALL and sparse collection.
Any other cases?
Thanks
PS: We are talking for Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit
:)Do you know when we could recieve this exceptions?e.g. all kind of constraint violations would raise this error:
SQL> DECLARE
TYPE emp_tab IS TABLE OF emp%ROWTYPE
INDEX BY BINARY_INTEGER;
e_tab emp_tab;
BEGIN
e_tab (1).empno := 7900;
FORALL i IN 1 .. 1 SAVE EXCEPTIONS
INSERT INTO emp
VALUES e_tab (i);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SQLERRM (SQLCODE));
END;
ORA-24381: error(s) in array DML
ORA-00001: unique constraint (PK_EMP) violated -
ORA-24381: error(s) in array DML
Hi,
I encountered error during mya testing. The script run thru several cases, until it encouter this error ORA-24381: error(s) in array DML.
What could be the possible reason for this and can anyone give an idea to resolve this issue.
Bulk collect was used with a limit of 1000.
I used dblink to access database.
Thanks in advance.The documentation tells you all about it: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2201
Regards,
Rob. -
ATL COM server error (0x800706C6 The array bounds are invalid) in Windows 2012 server
Hi,
We have a ATL COM server application which was developed using Visual Studio 6.0. This was ported to Visual Studio 2003 later.
The application was running without any problems on Windows 2008 server. When we installed it on Windows 2012 server the services would not start at all. On contacting MS support we can to know that the code needs to be built using Visual Studio 2013. The
same was done wherein we ported the application to be built using Visual Studio 2013.
The application is still failing. On debugging I could trace it to CoResumeClassObjects() call. This call returns error "0x800706C6 The
array bounds are invalid.". The same works perfectly fine on windows 2008.
Does anyone know what has changed between 2008 server and 2012 R2 server with respect to COM implementation.Hi Amit,
Please try call CoResumeClassObjects to register classes in ServiceMain function.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Error while pasing arrays to pl/sql procedure
Hi,
I am trying to pass an array from java to pl/sql procedure.
I tried this code:
CREATE OR REPLACE TYPE HEADER_UPLOAD IS OBJECT
(VENDOR_NAME VARCHAR2(240) --hr_all_organization_units.name%TYPE
,BILL_TO_CUSTOMER_NAME VARCHAR2(240)-- hz_parties.party_name%TYPE
,BILL_TO_CUSTOMER_NUMBER VARCHAR2(240) --hz_cust_accounts.account_number%TYPE
,BILL_TO_SITE_USE_ID VARCHAR2(240) --hz_cust_site_uses_all.site_use_id%TYPE
,RESELLER_NAME VARCHAR2(240) --hz_parties.party_name%TYPE
,RESELLER_ADDRESS_1 VARCHAR2(240)--hz_locations.address1%TYPE
,RESELLER_ADDRESS_2 VARCHAR2(240)--hz_locations.address2%TYPE
,RESELLER_ADDRESS_3 VARCHAR2(240)--hz_locations.address3%TYPE
,RESELLER_ADDRESS_4 VARCHAR2(240)--hz_locations.address4%TYPE
,RESELLER_COUNTRY VARCHAR2(240)--hz_locations.country%TYPE
,RESELLER_STATE VARCHAR2(240) --hz_locations.state%TYPE
,RESELLER_CITY VARCHAR2(240)--hz_locations.city%TYPE
,RESELLER_POSTAL_CODE VARCHAR2(240)--hz_locations.postal_code%TYPE
,FEDERAL_GOVT_END_USER VARCHAR2(240)
,END_USER_NAME VARCHAR2(240)--hz_parties.party_name%TYPE
,END_USER_ADDRESS_1 VARCHAR2(240)--hz_locations.address1%TYPE
,END_USER_ADDRESS_2 VARCHAR2(240)--hz_locations.address2%TYPE
,END_USER_ADDRESS_3 VARCHAR2(240)--hz_locations.address3%TYPE
,END_USER_ADDRESS_4 VARCHAR2(240)--hz_locations.address4%TYPE
,END_USER_COUNTRY VARCHAR2(240)-- hz_locations.country%TYPE
,END_USER_STATE VARCHAR2(240) --hz_locations.state%TYPE
,END_USER_CITY VARCHAR2(240) --hz_locations.city%TYPE
,END_USER_POSTAL_CODE VARCHAR2(240)--hz_locations.postal_code%TYPE
,END_USER_CONTACT_NAME VARCHAR2(240)
,END_USER_EMAIL VARCHAR2(2000)
,SHIP_TO_CUSTOMER_NAME VARCHAR2(240)--ra_customers.customer_name%TYPE
,SHIP_TO_ADDRESS_1 VARCHAR2(240) --hz_locations.address1%TYPE
,SHIP_TO_ADDRESS_2 VARCHAR2(240) --hz_locations.address2%TYPE
,SHIP_TO_ADDRESS_3 VARCHAR2(240) --hz_locations.address3%TYPE
,SHIP_TO_ADDRESS_4 VARCHAR2(240) --hz_locations.address4%TYPE
,SHIP_TO_COUNTRY VARCHAR2(240) --hz_locations.country%TYPE
,SHIP_TO_STATE VARCHAR2(240) --hz_locations.state%TYPE
,SHIP_TO_CITY VARCHAR2(240)--hz_locations.city%TYPE
,SHIP_TO_POSTAL_CODE VARCHAR2(240)--hz_locations.postal_code%TYPE
,SHIP_TO_CONTACT_NAME VARCHAR2(240)
,SHIP_TO_CONTACT_PHONE VARCHAR2(50)
,SHIPPING_INSTRUCTIONS VARCHAR2(240)--oe_order_headers_all.shipping_instructions%TYPE
,SHIPPING_METHOD VARCHAR2(240) --fnd_lookup_values.meaning%TYPE
,ALERT_EMAIL VARCHAR2(2000)
,LICENSE_EMAIL VARCHAR2(2000)
,ORDER_CONTACT_FIRST_NAME VARCHAR2(150)
,ORDER_CONTACT_LAST_NAME VARCHAR2(150)
,ORDER_CONTACT_PHONE VARCHAR2(50)
,ORDER_CONTACT_FAX_NUMBER VARCHAR2(50)
,ORDER_CONTACT_EMAIL VARCHAR2(2000)
,NOTES VARCHAR2(4000)
,CURRENCY_CODE VARCHAR2(240) --fnd_currencies.currency_code%TYPE
,SERVICE_RENEWAL_ORDER varchar2(10)
,CUSTOMER_PO_NUMBER VARCHAR2(240) --oe_order_headers_all.cust_po_number%TYPE
,RESUBMITTED_ORDER VARCHAR2(10)
,PREV_CUSTOMER_PO_NUMBER VARCHAR2(240) --oe_order_headers_all.cust_po_number%TYPE
,END_USER_PO_NUMBER VARCHAR2(50)
,PO_NET_TOTAL NUMBER
,FOB VARCHAR2(240) --fnd_lookup_values.meaning%TYPE
,FREIGHT_TERMS VARCHAR2(240) --fnd_lookup_values.meaning%TYPE
,FREIGHT_ACCOUNT_NUMBER VARCHAR2(200)
create or replace type header_upload_tab is table of header_upload;
java code is: this is a java class which first inserts the csv file data into array headerdata
public static String[] parseCSV(long l)
throws SQLException, FrameworkException, IOException
String s = "parseCSV";
String lResult[] = new String[3];
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Start");
OracleConnection oracleconnection = (OracleConnection)TransactionScope.getConnection();
OraclePreparedStatement oraclepreparedstatement = null;
OracleResultSet oracleresultset = null;
BLOB blob = null;
long l1 = System.currentTimeMillis();
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before fetching the File data from FND_LOBS");
oraclepreparedstatement = (OraclePreparedStatement)oracleconnection.prepareStatement(" SELECT FILE_DATA FROM FND_LOBS WHERE FILE_ID = :1 ");
oraclepreparedstatement.defineColumnType(1, 2004);
oraclepreparedstatement.setLong(1, l);
try
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before Executing the query");
oracleresultset = (OracleResultSet)oraclepreparedstatement.executeQuery();
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After Executing the query");
while(oracleresultset.next())
blob = (BLOB)oracleresultset.getObject(1);
finally
if(oracleresultset != null)
oracleresultset.close();
if(oraclepreparedstatement != null)
oraclepreparedstatement.close();
if(oracleconnection != null)
TransactionScope.releaseConnection(oracleconnection);
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Time taken to get the BLOB object(" + (System.currentTimeMillis() - l1) + " milliseconds)");
l1 = System.currentTimeMillis();
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Get the stream from the BLOB");
InputStreamReader inputstreamreader = new InputStreamReader(blob.getBinaryStream());
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before creating the csvreader");
xxbcIbeOrderUploadCSVReader OrderUploadcsvreader = new xxbcIbeOrderUploadCSVReader(inputstreamreader);
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After creating the csvreader");
OrderUploadcsvreader.setFieldSeparator(",");
OrderUploadcsvreader.setHandleEscapes(true);
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before getting the headers");
// Fetch the Header Record
ArrayList arraylistH = OrderUploadcsvreader.getHeaders();
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After getting the headers");
String s1 = (String)arraylistH.get(0);
if ("HEADER".equals(s1))
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Parse and Create the Header Record");
// Fetch the Header Data. This data will be inserted into Staging table, XXBC_IBE_ORDER_HEADER_IFACE
ArrayList arraylistHData = OrderUploadcsvreader.readRecord();
String headerData[] = new String[60];
for(int i = 1; i < arraylistH.size(); i++) {
headerData[i] = "";
for(int i = 1; i < arraylistH.size(); i++)
String h_element = (String)arraylistH.get(i);
String h_value = (String)arraylistHData.get(i);
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, h_element);
if ("VENDOR NAME*".equals(h_element)) headerData[1] = h_value;
if ("BILL TO CUSTOMER*".equals(h_element)) headerData[2] = h_value;
if ("BILL TO CUSTOMER NUMBER*".equals(h_element)) headerData[3] = h_value;
if ("BILL TO SITE NUMBER*".equals(h_element)) headerData[4] = h_value;
if ("RESELLER*".equals(h_element)) headerData[5] = h_value;
if ("RESELLER ADDRESS LINE 1*".equals(h_element)) headerData[6] = h_value;
if ("RESELLER ADDRESS LINE 2".equals(h_element)) headerData[7] = h_value;
if ("RESELLER ADDRESS LINE 3".equals(h_element)) headerData[8] = h_value;
if ("RESELLER ADDRESS LINE 4".equals(h_element)) headerData[9] = h_value;
if ("RESELLER COUNTRY*".equals(h_element)) headerData[10] = h_value;
if ("RESELLER STATE*".equals(h_element)) headerData[11] = h_value;
if ("RESELLER CITY*".equals(h_element)) headerData[12] = h_value;
if ("RESELLER POSTAL CODE*".equals(h_element)) headerData[13] = h_value;
if ("FEDERAL GOVT END USER".equals(h_element)) headerData[14] = h_value;
if ("END USER*".equals(h_element)) headerData[15] = h_value;
if ("END USER ADDRESS LINE 1*".equals(h_element)) headerData[16] = h_value;
if ("END USER ADDRESS LINE 2".equals(h_element)) headerData[17] = h_value;
if ("END USER ADDRESS LINE 3".equals(h_element)) headerData[18] = h_value;
if ("END USER ADDRESS LINE 4".equals(h_element)) headerData[19] = h_value;
if ("END USER COUNTRY*".equals(h_element)) headerData[20] = h_value;
if ("END USER STATE*".equals(h_element)) headerData[21] = h_value;
if ("END USER CITY*".equals(h_element)) headerData[22] = h_value;
if ("END USER POSTAL CODE*".equals(h_element)) headerData[23] = h_value;
if ("END USER CONTACT**".equals(h_element)) headerData[24] = h_value;
if ("END USER CONTACT EMAIL**".equals(h_element)) headerData[25] = h_value;
if ("SHIP TO CUSTOMER*".equals(h_element)) headerData[26] = h_value;
if ("SHIP TO ADDRESS LINE 1*".equals(h_element)) headerData[27] = h_value;
if ("SHIP TO ADDRESS LINE 2".equals(h_element)) headerData[28] = h_value;
if ("SHIP TO ADDRESS LINE 3".equals(h_element)) headerData[29] = h_value;
if ("SHIP TO ADDRESS LINE 4".equals(h_element)) headerData[30] = h_value;
if ("SHIP TO COUNTRY*".equals(h_element)) headerData[31] = h_value;
if ("SHIP TO STATE*".equals(h_element)) headerData[32] = h_value;
if ("SHIP TO CITY*".equals(h_element)) headerData[33] = h_value;
if ("SHIP TO POSTAL CODE*".equals(h_element)) headerData[34] = h_value;
if ("SHIP TO CONTACT**".equals(h_element)) headerData[35] = h_value;
if ("SHIP TO CONTACT PHONE NUMBER**".equals(h_element)) headerData[36] = h_value;
if ("SHIPPING INSTRUCTIONS".equals(h_element)) headerData[37] = h_value;
if ("SHIPPING METHOD*".equals(h_element)) headerData[38] = h_value;
if ("ALERT EMAIL*".equals(h_element)) headerData[39] = h_value;
if ("LICENSE EMAIL**".equals(h_element)) headerData[40] = h_value;
if ("ORDER CONTACT FIRST NAME*".equals(h_element)) headerData[41] = h_value;
if ("ORDER CONTACT LAST NAME*".equals(h_element)) headerData[42] = h_value;
if ("ORDER CONTACT PHONE NUMBER*".equals(h_element)) headerData[43] = h_value;
if ("ORDER CONTACT FAX NUMBER".equals(h_element)) headerData[44] = h_value;
if ("ORDER CONTACT EMAIL*".equals(h_element)) headerData[45] = h_value;
if ("NOTES".equals(h_element)) headerData[46] = h_value;
if ("CURRENCY*".equals(h_element)) headerData[47] = h_value;
if ("SERVICE RENEWAL ORDER".equals(h_element)) headerData[48] = h_value;
if ("CUSTOMER PO NUMBER*".equals(h_element)) headerData[49] = h_value;
if ("RESUBMISSION*".equals(h_element)) headerData[50] = h_value;
if ("PREVIOUS CUSTOMER PO NUMBER**".equals(h_element)) headerData[51] = h_value;
if ("END USER PO NUMBER".equals(h_element)) headerData[52] = h_value;
if ("PO NET TOTAL*".equals(h_element)) headerData[53] = h_value;
if ("FOB*".equals(h_element)) headerData[54] = h_value;
if ("FREIGHT TERMS*".equals(h_element)) headerData[55] = h_value;
if ("FREIGHT ACCOUNT NUMBER".equals(h_element)) headerData[56] = h_value;
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, (String)headerData);
} // End of processing Header Data
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Insert the Header Record into Interface Table");
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, (String)headerData[1]);
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, (String)headerData[2]);
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "checkpoint");
oracleconnection = (OracleConnection)TransactionScope.getConnection();
oracleconnection.setAutoCommit(true);
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After getting connection");
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "HEADER_UPLOAD_TAB", oracleconnection );
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "before new array");
ARRAY array_to_pass = new ARRAY( descriptor, oracleconnection, headerData );
if(IBEUtil.logEnabled())
IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "calling procedure");
OraclePreparedStatement ps =
(OraclePreparedStatement)oracleconnection.prepareStatement ( "BEGIN insert_data(:1); END;" );
ps.setARRAY( 1, array_to_pass );
ps.execute();.......continued
the above code executes till the message :---IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "before new array");
after that it gives error as :---Exception=java.sql.SQLException: Fail to convert to internal representation
Kindly Help....
Thanks in advance
GauravGaurav,
Just a guess, but try the following:
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "SCOTT.HEADER_UPLOAD_TAB", oracleconnection );In other words, prefix the data-type name, HEADER_UPLOAD_TAB, with its schema owner name.
Good Luck,
Avi. -
Hi,
I am facing issues like Type Mismatch while passing Array of interfaces from .NET to VBA and vice versa using VSTO technology.
My requirement is that ComInterfaceType needs to be InterfaceIsIDispatch.
My Interface definition is somewhat like this
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("AAF48FBC-52B6-4179-A8D2-944D7FBF264E")]
public interface IInterface1
[DispId(0)]
IInterface2[] GetObj();
[DispId(1)]
void SetObj(ref IInterface2[] obj);
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("CDC06E1D-FE8C-477E-97F1-604B73EF868F")]
public interface IInterface2
IF i am passing array of above interface (created in C#.Net) to VBA using GetObj API,i am getting type mismatch error in VBA while assigning the value to variable in VBA.Even assigning to variant type variable gives TypeMismatch.
Also while passing Array of interfaces from VBA using SetObj API,excel crashes and sometimes it says method doesn't exists.
Kindly provide some assistance regarding the same.
ThanksHi,
I am facing issues like Type Mismatch while passing Array of interfaces from .NET to VBA and vice versa using VSTO technology.
My requirement is that ComInterfaceType needs to be InterfaceIsIDispatch.
My Interface definition is somewhat like this
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("AAF48FBC-52B6-4179-A8D2-944D7FBF264E")]
public interface IInterface1
[DispId(0)]
IInterface2[] GetObj();
[DispId(1)]
void SetObj(ref IInterface2[] obj);
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("CDC06E1D-FE8C-477E-97F1-604B73EF868F")]
public interface IInterface2
IF i am passing array of above interface (created in C#.Net) to VBA using GetObj API,i am getting type mismatch error in VBA while assigning the value to variable in VBA.Even assigning to variant type variable gives TypeMismatch.
Also while passing Array of interfaces from VBA using SetObj API,excel crashes and sometimes it says method doesn't exists.
Kindly provide some assistance regarding the same.
Thanks -
Error in a array populated using jsp in client-side in java-script
hii ,
I have this problem.
I have populated an array with records in jsp.The array is being populated correctly ..i hav check it .
Now I need to get back this array in client side in a java-script function.
I need this bcoz i need to check whether the value entered in a particular field in the form is there in the table before the form is submitted...hence the need of array.
Surprisingly in my java-script function i can get back the length of array,but as soon as i am writing something like arr[0] where arr is the name of array populated in server side using jsp,i am get scripting error.
i.e a code like
funtion partynamecheck()
var n=<%arr[0]%>
alert (n) ;
is giving scripting error.i.e showing error in page at the bottom left -side of browser.
but code like
funtion partynamecheck()
var n=<%arr.length%>
alert (n) ;
} is working fine.
Please help ..all wrk stuck.
ArnabHi,
i cann't help you with javascript, but the jsp-expression must have this syntax
var n=<%=arr[0]%>
Hope this help!
Roland -
Hi, I am trying to load an array with the code below but I keep on getting an "illegal start of expression" message from the compiler and I'm not sure what I'm doing wrong or what to change, any help would be appreciated.
Object[][] data = new Object[itemList.size()][numberOfColumns];
for(int i = 0; i<itemList.size(); i++)
item = itemList.get(i);
for(int j=0; j<numberOfColumns; j++)
data[i][j] = {{new Integer(item.getItemID()), item.getItemName()}}; //this is where the error occurs
}But how would the compiler or runtime know what exact type of array to create?Object[] array;
array = { "This won't work." };Should the compiler create a Object[] or String[] array the second line? The language designers couldn't decide, so it's up to you to specify the type you want:array = new Object[] { "This will." }; -
Error passing byte array in soap request
Hi,
i am trying to pass byte arrays (and also java.lang.Byte array) as parameter in
a soap request.
to do so i have defined a simple web service under weblogic 7.0.
then i test it through the WebLogic Webservice standard testing home page.
the value field for testing my web service is already filled by weblogic with:
<bytes xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xsd:base64Binary">aopd</bytes>
i only need to invoke my web service to test it.
then an exception is raised:
javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.schema.binding.DeserializationException:
error decoding base64binary - with nested exception: [java.io.IOException: Error
in encoded stream] javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.schema.binding.DeserializationException:
error decoding base64binary - with nested exception: [java.io.IOException: Error
in encoded stream] at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:301)
at weblogic.webservice.tools.pagegen.SampleInstance.getJavaObject(SampleInstance.java:130)
at weblogic.webservice.server.servlet.ServletBase.getJavaParams(ServletBase.java:296)
at weblogic.webservice.server.servlet.ServletBase.invokeOperation(ServletBase.java:239)
at weblogic.webservice.server.servlet.WebServiceServlet.invokeOperation(WebServiceServlet.java:306)
at weblogic.webservice.server.servlet.ServletBase.handleGet(ServletBase.java:198)
at weblogic.webservice.server.servlet.ServletBase.doGet(ServletBase.java:124)
at weblogic.webservice.server.servlet.WebServiceServlet.doGet(WebServiceServlet.java:224)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5412)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:744)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
any idea?Hi,
Looks like a known bug (CR087883).
Thanks,
Bruce
cyrille puget wrote:
Hi,
i am trying to pass byte arrays (and also java.lang.Byte array) as parameter in
a soap request.
to do so i have defined a simple web service under weblogic 7.0.
then i test it through the WebLogic Webservice standard testing home page.
the value field for testing my web service is already filled by weblogic with:
<bytes xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xsd:base64Binary">aopd</bytes>
i only need to invoke my web service to test it.
then an exception is raised:
javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.schema.binding.DeserializationException:
error decoding base64binary - with nested exception: [java.io.IOException: Error
in encoded stream] javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.schema.binding.DeserializationException:
error decoding base64binary - with nested exception: [java.io.IOException: Error
in encoded stream] at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:301)
at weblogic.webservice.tools.pagegen.SampleInstance.getJavaObject(SampleInstance.java:130)
at weblogic.webservice.server.servlet.ServletBase.getJavaParams(ServletBase.java:296)
at weblogic.webservice.server.servlet.ServletBase.invokeOperation(ServletBase.java:239)
at weblogic.webservice.server.servlet.WebServiceServlet.invokeOperation(WebServiceServlet.java:306)
at weblogic.webservice.server.servlet.ServletBase.handleGet(ServletBase.java:198)
at weblogic.webservice.server.servlet.ServletBase.doGet(ServletBase.java:124)
at weblogic.webservice.server.servlet.WebServiceServlet.doGet(WebServiceServlet.java:224)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5412)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:744)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
any idea? -
Null out of bounds error in single array
I have created this program but I am getting a null out of bounds error. What have I done wrong?I would appreciate your expert opinions. I have commented the error points.
import javax.swing.JOptionPane;
import java.text.NumberFormat; //Imports class for currency formating
public class VillageDataSort {
//Data fields
private HouseHolds[] Village;
private double totIncome;
private double avgAnulIncm;
private double povertyLvl;
//Method to create memory allocations for Village array
public void HouseholdData(){
Village = new HouseHolds[13];
int index = 0;
for(index = 0; index < Village.length; index++);
Village[index] = new HouseHolds(); //Error point
Village[index].dataInput(); //Error point
//Calculates the average annual income
public double avgIncome(){
totIncome = 0;
int index = 0;
for(index = 0; index < Village.length; index++);
totIncome += Village[index].getAnnualIncome();
avgAnulIncm = totIncome / Village.length;
return avgAnulIncm;
//Displays households with above average income
public void displayAboveAvgIncome(){
int index = 0;
for(index = 0; index < Village.length; index++);
if (Village[index].getAnnualIncome() >= avgIncome())
System.out.println("Households that are above the average income : " + avgIncome());
System.out.println("Household ID " + "\t" + "Annual Income " + "\t" + "Household Members");
System.out.println(Village[index].getIdNum() + "\t" + Village[index].getAnnualIncome() + "\t" + Village[index].getFamilyMems());
//Calculates and displays the households that fall below the poverty line
public void povertyLevel(){
int index = 0;
povertyLvl = 0;
for(index = 0; index < Village.length; index++);
povertyLvl = 6500 + 750 * (Village[index].getFamilyMems() - 2);
if (Village[index].getAnnualIncome() < povertyLvl)
System.out.println("Households that are below the poverty line");
System.out.println("Household ID " + "\t" + "Annual Income " + "\t" + "Household Members");
System.out.println(Village[index].getIdNum() + "\t" + Village[index].getAnnualIncome() + "\t" + Village[index].getFamilyMems());
}Thanks again scsi, I see where it gets together. I
even found the Class interface error started in the
previous method to calculate the average. The program
compiled but it outputted nothing just a bunch of
zero's. I know I haven't referenced correctly yet
again why does it not grab the data.I changed the
array to 4 numbers for testing purposesis this a question or a statement?
well there are problems in you HouseHolds class.
import javax.swing.JOptionPane;
public class HouseHolds{
// Data
private int idNum;
private double anlIncm;
private int famMems;
//This method gets the data from the user
public void dataInput(){
// if you are trying to set the int idNum here you are not doing this.
String idNum =
JOptionPane.showInputDialog("Enter a 4 digit household ID number");
// same with this
String anlIncm =
JOptionPane.showInputDialog("Enter the households annual income");
// and also this one.
String famMems =
JOptionPane.showInputDialog("Enter the members of the family");
} as a service to you look at these two API links.
http://java.sun.com/j2se/1.3/docs/api/java/lang/Integer.html
and
http://java.sun.com/j2se/1.3/docs/api/java/lang/Double.html
now here is the revised code for one of your variable settings.
you will have to do the rest on your own.
String idString = JOptionPane.showInputDialog("Enter a 4 digit household ID number");
idNum = Integer.parseInt(idString); -
BUG: 10.1.3 EA1 - Refactor errors when handling arrays
Hi,
I declare my arrays like this:
int n[];
Rather than the way JDeveloper likes it:
int[] n;
So when JDeveloper refactors my code I either get too many [] or not enough.
E.g, JDeveloper makes a method out of some code, or moves definitions up the class hierarchy and it ends up like this:
int[] n[];
Its like it knows it's an array so it writes "int[]" then it writes the variable as it originally found it "n[]". I have also seen it drop the [] in a method parameter argument that was an array.
JDeveloper should preserve my definitions the way they were or at least get them right if it insists on changing it to its own style.
Regards,
Simon.Thanks for looking into it.
You have to split the array definition from the method code so that it has to pass the array as a parameter.
E.g.
String s;
Object i[] = new Object[3];
if(i==null || i.length == 0)
s = "i is null";
System.out.println(s + i.toString());
Leave the definitions behind and just make a method of just the if statement. Mine generated:
String s;
Object i[] = new Object[3];
s = test(i);
System.out.println(s + i.toString());
and
private String test(Object i)
String s;
// TODO type initialisation here
if(i==null || i.length == 0)
s = "i is null";
return s;
Note that 'int i' is wrong and causes the syntax errors.
If you change the definition to "int[] i;" it works OK.
It also works if you include the definition (as it was) in the refactor code.
The indenting of the new method was mucked up too. Not as shown here because this forum strips out all leading blanks. Indenting appears to get mucked up if you have set the tabstop and indent set to 4 in the preferences. A 'reformat' fixes it.
Cheers,
Simon. -
Out of bounds error with an array.
Dear all,
java.lang.ArrayIndexOutOfBoundsException: 1
I keep getting this error message when I try and use a for loop to step through an array of which the upper bound is 'count'.
I feel as if I have tried all permutations of spelling out the possible values of the vertices, using .length etc but all to no avail.
Here is one bit of code that is getting this error:
public String toString(){
int i = 0;
for (i = 0; i == count; i++);{
System.out.println (+ vertices.getX() + + vertices[i].getY());
return "";
The reason for the return "" is to get rid of another error that used to say no return value.
I'll happily try any suggestions, I just want to get my program working.
Thanks
PS I have read through the recent postings on this but I can't see how they answer my query.Thanks for spotting the semi colon in the wrong place it seems to have sorted out that bit, but I've now got another array out of bounds exception 0 on a different bit.
public double perimeter (){
double perimeter = 0;
//int i = 0;
for ( int i = 0; i < (count -1) ; i++){
perimeter = perimeter + ( vertices.distance(vertices[i + 1]));
perimeter = perimeter + ( vertices[0].distance(vertices[count]));
return perimeter;
This bit of code is supposed to calculate the perimeter of any polygon. So my algorithm was to start at vertices[0] use the distance method to calculate the distance between that one and the next one all the way up to the last one in the array vertices[count]. And then calculate the distance from the first vertice to the last and add that on to make the total.
The line that is being spat out is
perimeter = perimeter + ( vertices.distance(vertices[i + 1]));
I can't see why. -
Hello,
I am getting this error when i am trying to execute a PL/SQL script using an Oracle API
We are using Oracle 10g release 2 database. I am getting this error only on some instances. This script is running fine in Development instances.
Script:
SET VERIFY OFF;
SET serveroutput on size 100000;
SET linesize 300;
EXEC FND_STATS.GATHER_COLUMN_STATS ('AR', 'HZ_LOCATIONS', 'COUNTRY');
SELECT
hl.location_id,hl.state, hl.country,
hcasa.org_id
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';
--PROMPT Dropping Table pmr13286_temptable
DROP TABLE pmr13286_temptable;
CREATE TABLE pmr13286_temptable AS (SELECT
hp.attribute_category , hl.address_lines_phonetic,
hps.party_site_number,hca.cust_account_id,
hcsua.site_use_code, hcsua.primary_flag, hcsua.status,
hl.address1, hl.address2, hl.address3, hl.address4,
hl.city, hl.state, hl.postal_code, hl.country,
hl.county, hl.province, hcasa.org_id,
hl.creation_date
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%');
DECLARE
l_location_rec hz_location_v2pub.location_rec_type;
l_object_version_number hz_locations.object_version_number%TYPE;
p_status_code NUMBER;
l_api_status VARCHAR2 (2000);
l_msg_count NUMBER (15);
l_msg_data VARCHAR2 (2000);
v_total_count NUMBER (15);
v_prvi_count NUMBER (15);
v_countr_count NUMBER (15);
v_null_count NUMBER (15);
v_rem_recs NUMBER (15);
v_status_code VARCHAR2 (2000);
l_sql_errmsg VARCHAR2 (500);
CURSOR c_cust_addr
IS
SELECT
hl.*
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';
BEGIN
v_total_count := 0;
v_prvi_count := 0;
v_countr_count := 0;
v_null_count := 0;
dbms_output.put_line('Total Count'||v_total_count );
dbms_output.put_line('PR/VI Conversion Count'||v_prvi_count );
dbms_output.put_line('PR/VI to US Conversion Count'||v_countr_count );
dbms_output.put_line('Non US/CA State Null Count'||v_null_count );
FOR i IN c_cust_addr
LOOP
l_location_rec := NULL;
v_total_count := v_total_count + 1;
l_location_rec.location_id := i.location_id;
l_location_rec.state := i.state;
l_location_rec.country := i.country;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
BEGIN
SELECT hl.object_version_number
INTO l_object_version_number
FROM hz_locations hl
WHERE hl.location_id = l_location_rec.location_id;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
raise_application_error (
-20059,
'object_version_number not found for location = '
|| TO_CHAR (l_location_rec.location_id)
END;
Update 1 - Update Addresses of 3 records that have wrong country names
BEGIN
IF (l_location_rec.location_id IN (1436720,119456,604649)) THEN
dbms_output.put_line(' 3 records Location_id '||l_location_rec.location_id);
IF ( l_location_rec.location_id = 1436720) THEN
l_location_rec.state := 'OH';
l_location_rec.country := 'US';
ELSIF ( l_location_rec.location_id = 119456) THEN
l_location_rec.country := 'US';
ELSIF ( l_location_rec.location_id = 604649) THEN
l_location_rec.country := 'PK';
END IF;
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
END IF;
END;
Update 2 - Update state to 'VI','PR' where country is in 'VI','PR'
BEGIN
IF (i.country = 'PR' AND (i.state <> 'PR' OR i.state IS NULL))
OR (i.country = 'VI' AND (i.state <> 'VI'OR i.state IS NULL)) THEN
v_prvi_count := v_prvi_count + 1;
dbms_output.put_line(' State to PR/VI Location_id '||l_location_rec.location_id);
SELECT DECODE (i.country,'PR','PR','VI', 'VI') INTO l_location_rec.state
FROM apps.hz_locations WHERE
location_id = l_location_rec.location_id;
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
END IF;
END;
Update 3 - Update Country code to 'US' where state code is either 'PR' or 'VI'
BEGIN
IF l_location_rec.state = 'PR' OR l_location_rec.state = 'VI'
THEN l_location_rec.country := 'US';
v_countr_count := v_countr_count + 1;
dbms_output.put_line('PR/VI country to US Location_id '||l_location_rec.location_id);
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
END IF;
END;
Update 4 - Update state code to NULL where state code is NOT NULL and country code is not in US or CA
IF l_location_rec.country NOT IN ('US','CA') AND l_location_rec.state IS NOT null
THEN l_location_rec.state := FND_API.G_NULL_CHAR;
v_null_count := v_null_count + 1;
dbms_output.put_line('Non US/CA to Null Location_id '||l_location_rec.location_id);
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
END IF;
END LOOP;
v_countr_count := v_countr_count +2;
dbms_output.put_line('Total Count'||v_total_count );
dbms_output.put_line('PR/VI Conversion Count'||v_prvi_count );
dbms_output.put_line('PR/VI to US Conversion Count'||v_countr_count );
dbms_output.put_line('Non US/CA State Null Count'||v_null_count );
BEGIN
SELECT
count(*) into v_rem_recs
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';
dbms_output.put_line('remaining count '||v_rem_recs );
END;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in Program: ' ||' Error Message ' || SQLERRM);
ROLLBACK;
END;
SELECT
hl.location_id,hl.state, hl.country,
hcasa.org_id
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';You may want to zero in on the part of the code that throws this error.
(i)
Try executing a small part of your code, while commenting out the rest. If that is successful, execute a slightly bigger part of the code, and so on successively. Once you know, where exactly the code is failing, it should be easier to create a small testcase against your data and investigate the problem.
(ii)
Check those local variables and the values that get assigned to them. It is a good practice to anchor local variables to database columns. That way, there will be less surprises when the table structures are altered.
(iii)
The script as such does not show any glaring error, but you may want to check those procedure calls e.g. -
hz_Location_v2Pub.Update_Location(fnd_aPi.g_True,l_Location_rec,l_Object_Version_Number,
l_aPi_Status,l_msg_Count,l_msg_Data);It's quite possible that the procedure is assigning a value to an output parameter that is too small to store that.
Note that, given such a huge script and not knowing your database, we are not particularly inclined to debug it. The only person who can make things easier for himself/herself is you.
HTH,
isotope -
Getting error in the array : help
Hi i have written following code and getting this error
String srcdir = new String("C:\\projects\\xml\\rwjf-org\\closedgrants\\finalxml\\grr\\");
File fileDir = new File(srcdir);
String[] fileList = new String[100];
fileList = fileDir.list();
for(int i=0; fileList.length>0; i++){
String currFile = srcdir + fileList;
//String fname = new String(fileList[i]);
System.out.print("String file name is " + currFile);
//System.out.print("file name is " + fileList[i]);
ERROR : java.lang.ArrayIndexOutOfBoundsException
I'm new to java.
Please tell me where i'm going wrong.
any help would be great.
PoojaThere are several errors in your code:
String[] fileList = new String[100];
fileList = fileDir.list();
Here you point the fileList reference to a String[] object, and then immediately point the reference to another object. This is a useless creation of an object... the #1 cause of slow Java code.
Write just this instead:
String[] fileList = fileDir.list();
for(int i=0; fileList.length>0; i++){
The condition fileList.length > 0 will forever be true or false. the condition should be i < fileList.length.
I think those suggestions should get you started...
Maybe you are looking for
-
Spry collapsible panel - repeating region
Hi, I'm trying to make a repeating region that contains a spry collapsable panel. The problem is that i need to develop a way to automatically increase the ID of the spry panel. The problem I am encountering is that only the first Collapsible Panel w
-
Want to Dual Boot Tiger and Snow Leopard
I have 4 internal SATA drives on my 2007 Mac Pro, and my boot drive is Tiger 10.4.11. I just purchased Snow Leopard (Box Set), with the intention of creating a second internal boot drive that boots Snow Leopard. I mentioned this in passing to a senio
-
QuickTime Crashes All Programs Using Plugin
Hello Everybody! I'm having trouble with my QuickTime plugin. It crashes anything that uses the plugin. Facebook Chat, which apparently uses QuickTime somehow (apparently), crashes my browser. I have Safari 4.0, and I also use the Beta version of Ope
-
XML Forms: save form in "Show Form" Mode
Hi All, Is there a way to have 2 edit screens in XML Forms? My scenario: 1) user creates form 2) admin reads form and changes the property "status" to "form read" (a field that the user does not see) and saves. Is this possible? I can add the contro
-
Web pages are taking an extremely long time to load. Sometimes they don't load at all. This is especially true with video sites like YouTube. I scanned my entire computer with Ad-Aware, Malwarebytes, Iobit Malware Fighter, SuperAntiSpyware, Windows D