Convert oracle cursor statements along with validations to XML
Hi Gurus/Odie,
I've one current in pl/sql report which is generating output as text format, but users are expecting to see the same output in excel format. In oracle apps we can generate XML tags and those tags can be produced to template so as to generate them in excel file.
My current procedure as shown below.Currently it is displaying output in one line concatenating all the data. But i want keep the same logic like that and change into xml tags. How can we do that. Please provide me your valueable inputs in this regard.
CREATE OR REPLACE PROCEDURE APPS.ACCTALS (
errbuf OUT VARCHAR2,
retcode OUT NUMBER,
p_st_date IN VARCHAR2,
p_end_date IN VARCHAR2,
p_set_of_book IN NUMBER,
p_chart_of_acnt IN NUMBER,
p_min_flex IN VARCHAR2,
p_max_flex IN VARCHAR2,
p_transaction_type IN VARCHAR2
IS
TYPE flex_tbl_type IS TABLE OF VARCHAR2 (10)
INDEX BY BINARY_INTEGER;
CURSOR c_acct (
p_period_num_low NUMBER,
p_period_num_high NUMBER,
p_min_flex_tbl flex_tbl_type,
p_max_flex_tbl flex_tbl_type
IS
SELECT gjh.period_name period_name,
sat.user_je_source_name SOURCE,
cat.user_je_category_name CATEGORY,gjb.NAME batch_name,
gjh.NAME journal_name, gcc.segment1, gcc.segment2, gcc.segment3,
gcc.segment4, gcc.segment5, gcc.segment6, gcc.segment7,
gcc.segment8, gjl.je_line_num,
gjl.description je_line_description, gjl.reference_1 party_name,
(SELECT pv.segment1
FROM ap_invoices_all aia, po_vendors pv
WHERE aia.invoice_id =TO_NUMBER(DECODE(NVL(LENGTH(LTRIM (TRANSLATE (gjl.reference_2,'1234567890','3'),'3')),0),0, TO_NUMBER (gjl.reference_2),-999))
AND pv.vendor_id = aia.vendor_id) party_number,
NULL trx_number, -- invoice_num,
NULL trx_line_number, -- invoice_line_num,
CASE
WHEN gjh.je_category = 'Purchase Invoices'
THEN (SELECT pha.segment1
FROM apps.ap_invoice_distributions_all aid,
apps.po_headers_all pha,
apps.po_lines_all pla,
apps.po_distributions_all pda
WHERE aid.po_distribution_id =
pda.po_distribution_id
AND pda.po_line_id = pla.po_line_id
AND pla.po_header_id = pha.po_header_id
AND aid.invoice_id = TO_NUMBER (gjl.reference_2)
AND aid.distribution_line_number =
TO_NUMBER (gjl.reference_3))
ELSE ''
END po_number,
CASE
WHEN gjh.je_category = 'Purchase Invoices'
AND gjl.reference_3 IS NOT NULL
THEN (SELECT pla.line_num
FROM apps.ap_invoice_distributions_all aid,
apps.po_headers_all pha,
apps.po_lines_all pla,
apps.po_distributions_all pda
WHERE aid.po_distribution_id =
pda.po_distribution_id
AND pda.po_line_id = pla.po_line_id
AND pla.po_header_id = pha.po_header_id
AND aid.invoice_id = TO_NUMBER (gjl.reference_2)
AND aid.distribution_line_number =
TO_NUMBER (gjl.reference_3))
ELSE TO_NUMBER ('')
END po_line,
CASE
WHEN gjh.je_category = 'Purchase Invoices'
AND gjl.reference_3 IS NOT NULL
THEN (SELECT mc.segment1
FROM apps.ap_invoice_distributions_all aid,
apps.po_headers_all pha,
apps.po_lines_all pla,
apps.po_distributions_all pda,
apps.mtl_categories mc
WHERE aid.po_distribution_id =
pda.po_distribution_id
AND pda.po_line_id = pla.po_line_id
AND mc.category_id = pla.category_id
AND pla.po_header_id = pha.po_header_id
AND aid.invoice_id = TO_NUMBER (gjl.reference_2)
AND aid.distribution_line_number =
TO_NUMBER (gjl.reference_3))
ELSE ''
END po_category,
gjl.accounted_dr debit, gjl.accounted_cr credit,
NVL (gjl.accounted_dr, 0) - NVL (gjl.accounted_cr, 0)
net_amount,
-- Added by Murali for bug 10405
gjh.currency_code entered_currency,
gjl.entered_dr entered_debit, gjl.entered_cr entered_credit,
NVL (gjl.entered_dr, 0)
- NVL (gjl.entered_cr, 0) net_entered_amount,
gjl.attribute1 bank_account_number,
gjl.attribute2 bank_account_name,
gjl.attribute3 it2_nl_posting_ref,
gjl.attribute4 bank_transaction_date,
gjl.attribute5 it2_transaction_number,
gjl.attribute6 funds_subtype_name,
CASE
WHEN gjh.je_category = 'Purchase Invoices'
THEN
CASE
WHEN (SELECT NVL (aid.po_distribution_id,-999)
FROM ap_invoice_distributions_all aid
WHERE aid.invoice_id =TO_NUMBER (gjl.reference_2)
AND aid.distribution_line_number =
TO_NUMBER (gjl.reference_3)) =
-999
THEN
(SELECT aia.attribute5
FROM apps.ap_invoices_all aia
WHERE aia.invoice_id =
TO_NUMBER(DECODE(NVL(LENGTH(LTRIM(TRANSLATE(gjl.reference_2,'1234567890','3'),'3')),0),0, TO_NUMBER(gjl.reference_2),-999))
AND ROWNUM = 1)
ELSE
--For PO Matched Invoice ,Pickup Proj code from PO header project DFF
(SELECT pha.attribute1
FROM apps.ap_invoice_distributions_all aid,
apps.po_headers_all pha,
apps.po_lines_all pla,
apps.po_distributions_all pda
WHERE aid.po_distribution_id = pda.po_distribution_id
AND pda.po_line_id = pla.po_line_id
AND pla.po_header_id = pha.po_header_id
AND aid.invoice_id = TO_NUMBER (gjl.reference_2)
AND aid.distribution_line_number =
TO_NUMBER (gjl.reference_3)
AND ROWNUM = 1)
END
ELSE
-- Invoice (Header) is not PO-Matched, so pickup Proj Code from invoice DFF --CHG0030444
(SELECT aia.attribute5
FROM apps.ap_invoices_all aia
WHERE aia.invoice_id =TO_NUMBER(DECODE(NVL(LENGTH(LTRIM (TRANSLATE (gjl.reference_2,'1234567890','3'),'3')),0),0, TO_NUMBER (gjl.reference_2),-999))
AND ROWNUM = 1)
END proj_code,
gjh.posted_date post_date, gjl.effective_date gl_date,
DECODE (gjh.je_category,
'Purchase Invoices', 'AP Invoice',
'Payments', 'AP Payment'
) transaction_class,
gjl.reference_3, gjl.reference_4, gjl.reference_5,
gjl.reference_1, gjl.reference_7,
gjl.attribute7, gjl.attribute8,
gjl.attribute9
FROM apps.gl_code_combinations gcc,
apps.gl_je_lines gjl,
apps.gl_je_headers gjh,
apps.gl_je_batches gjb,
apps.gl_period_statuses per,
apps.gl_je_categories_tl cat, -- Added by Murali for Bug 10405
apps.gl_je_sources_tl sat -- Added by Murali for Bug 10405
WHERE gcc.segment1 >= p_min_flex_tbl (1)
AND gcc.segment1 <= p_max_flex_tbl (1)
AND gcc.segment2 >= p_min_flex_tbl (2)
AND gcc.segment2 <= p_max_flex_tbl (2)
AND gcc.segment3 >= p_min_flex_tbl (3)
AND gcc.segment3 <= p_max_flex_tbl (3)
AND gcc.segment4 >= p_min_flex_tbl (4)
AND gcc.segment4 <= p_max_flex_tbl (4)
AND gcc.segment5 >= p_min_flex_tbl (5)
AND gcc.segment5 <= p_max_flex_tbl (5)
AND gcc.segment6 >= p_min_flex_tbl (6)
AND gcc.segment6 <= p_max_flex_tbl (6)
AND gjl.set_of_books_id = NVL (p_set_of_book, 1001)
AND per.effective_period_num BETWEEN p_period_num_low
AND p_period_num_high
AND gjl.code_combination_id = gcc.code_combination_id
AND gjl.status || '' = 'P'
AND gjb.average_journal_flag = 'N'
AND gjh.actual_flag =
DECODE (p_transaction_type,
'Actual', 'A',
'Budget', 'B',
gjh.actual_flag
AND gjh.je_header_id = gjl.je_header_id
AND gjb.je_batch_id = gjh.je_batch_id
AND per.application_id = 101
AND per.set_of_books_id = gjl.set_of_books_id
AND per.period_name = gjl.period_name
AND gjh.period_name = gjl.period_name
AND per.period_name = gjb.default_period_name
AND gjb.set_of_books_id = per.set_of_books_id
AND gjh.je_source = 'Payables'
AND cat.je_category_name = gjh.je_category
AND cat.LANGUAGE = 'US'
AND sat.je_source_name = gjh.je_source
AND sat.LANGUAGE = 'US'
main_rec c_acct%ROWTYPE;
l_min_flex_tbl flex_tbl_type;
l_max_flex_tbl flex_tbl_type;
l_min_flex VARCHAR2 (100);
l_max_flex VARCHAR2 (100);
min_flex_count NUMBER;
max_flex_count NUMBER;
i NUMBER;
v_display_str VARCHAR2 (1000);
v_header_str VARCHAR2 (1000);
l_proj_code VARCHAR2 (240);
rf_period_cur sys_refcursor;
l_period_num_low NUMBER := '';
l_period_num_high NUMBER := '';
-- l_vendor_name varchar2(1000);
l_party_name VARCHAR2 (1000);
l_party_number VARCHAR2 (1000);
l_trx_number VARCHAR2 (1000);
l_trx_line_number VARCHAR2 (50);
--Added by Bharat.K for CHG0035496
l_contract_number VARCHAR2 (30);
l_contract_modified VARCHAR2 (30);
l_order_number VARCHAR2 (30);
l_statement_date VARCHAR2 (30);
l_billed_from VARCHAR2 (30);
l_billed_to VARCHAR2 (30);
l_start_date VARCHAR2 (30);
l_reference_number VARCHAR2 (30);
BEGIN
fnd_file.put_line (fnd_file.LOG, 'set of book id: ' || p_set_of_book);
l_min_flex := p_min_flex;
i := 1;
LOOP
IF INSTR (l_min_flex, '-') = 0
THEN
EXIT;
END IF;
l_min_flex_tbl (i) := SUBSTR (l_min_flex, 1, INSTR (l_min_flex, '-') - 1);
l_min_flex :=SUBSTR (l_min_flex,INSTR (l_min_flex, '-') + 1,LENGTH (l_min_flex) - INSTR (l_min_flex, '-'));
i := i + 1;
END LOOP;
l_min_flex_tbl (i) := l_min_flex;
min_flex_count := i;
l_max_flex := p_max_flex;
i := 1;
LOOP
IF INSTR (l_max_flex, '-') = 0
THEN
EXIT;
END IF;
l_max_flex_tbl (i) := SUBSTR (l_max_flex, 1, INSTR (l_max_flex, '-') - 1);
l_max_flex :=SUBSTR (l_max_flex,INSTR (l_max_flex, '-') + 1,LENGTH (l_max_flex) - INSTR (l_max_flex, '-'));
i := i + 1;
END LOOP;
l_max_flex_tbl (i) := l_max_flex;
max_flex_count := i;
v_header_str := '';
v_header_str :=
'Period'|| '^'|| 'Source'|| '^'|| 'Category'|| '^'|| 'Batch Name'|| '^'|| 'Journal Name'|| '^'|| 'Company'|| '^'|| 'IBX'|| '^'|| 'Dept'|| '^'|| 'Account'
|| '^'|| 'Intercompany'|| '^'|| 'Product'|| '^'|| 'Future2'|| '^'|| 'Future3'|| '^'|| 'JE Line Num'|| '^'|| 'Description'|| '^'|| 'GL Date'|| '^'|| 'GL Post Date'
|| '^'|| 'Party Name'|| '^'|| 'Party Number'|| '^'|| 'Transaction Class'|| '^'|| 'Transaction Number'|| '^'|| 'Transaction Line Number' --bug#9819
|| '^'|| 'PO Number'|| '^'|| 'PO Line Num'|| '^'|| 'PO Category'|| '^'|| 'Project Code'|| '^'|| 'Converted Debit'|| '^'|| 'Converted Credit'
|| '^'|| 'Converted Net Amount (Dr - Cr)'|| '^'|| 'Entered Currency'|| '^'|| 'Entered Debit'|| '^'|| 'Entered Credit'|| '^'
|| 'Entered Net Amount (Dr - Cr)'|| '^'|| 'BANK ACCOUNT NUMBER'|| '^'|| 'BANK ACCOUNT NAME'|| '^'
|| 'IT2 NL POSTING REF'|| '^'|| 'BANK TRANSACTION DATE'|| '^'|| 'IT2 TRANSACTION NUMBER'|| '^'|| 'FUNDS SUBTYPE NAME'|| '^'
|| 'PCard Merchant Name'|| '^'|| 'PCard Posting Date'|| '^'|| 'PCard Transaction Date'|| '^'|| 'Contract Number'
|| '^'|| 'Contract Modified Number'|| '^'|| 'Order Number'|| '^'|| 'Statement Date'|| '^'|| 'Billed From'
|| '^'|| 'Billed To'|| '^'|| 'Start Date'|| '^'|| 'Reference Number';
fnd_file.put_line (fnd_file.output, v_header_str);
fnd_file.put_line (fnd_file.LOG, 'get effective period number');
OPEN rf_period_cur FOR
SELECT MIN (effective_period_num), MAX (effective_period_num)
FROM gl_period_statuses
WHERE start_date >= fnd_date.canonical_to_date (p_st_date)
AND end_date <= fnd_date.canonical_to_date (p_end_date)
AND set_of_books_id = p_set_of_book
AND application_id = 101;
FETCH rf_period_cur
INTO l_period_num_low, l_period_num_high;
CLOSE rf_period_cur;
IF l_period_num_low IS NOT NULL AND l_period_num_high IS NOT NULL
THEN
fnd_file.put_line (fnd_file.LOG,'effective period number low: '|| l_period_num_low|| ' period number high: '|| l_period_num_high);
i := 0;
OPEN c_acct (l_period_num_low,l_period_num_high,l_min_flex_tbl,l_max_flex_tbl);
LOOP
FETCH c_acct
INTO main_rec;
EXIT WHEN c_acct%NOTFOUND;
l_contract_number := NULL;
l_contract_modified := NULL;
l_order_number := NULL;
l_statement_date := NULL;
l_billed_from := NULL;
l_billed_to := NULL;
l_start_date := NULL;
l_reference_number := NULL;
--Do All the Processing for customer number and customer name--bug#9819
IF main_rec.CATEGORY = 'Adjustment'
THEN
BEGIN
SELECT hp.party_name, rc.account_number
INTO l_party_name, l_party_number
FROM ar_adjustments_all adj,
ra_customer_trx_all trx,
-- ra_customers rc
hz_cust_accounts rc,
hz_parties hp
WHERE adj.customer_trx_id = trx.customer_trx_id
AND trx.bill_to_customer_id = rc.cust_account_id
AND rc.party_id = hp.party_id
AND trx.set_of_books_id = NVL (p_set_of_book, 1001)
AND adj.adjustment_number = main_rec.reference_5;
EXCEPTION
WHEN OTHERS
THEN
l_party_name := NULL;
l_party_number := NULL;
END;
ELSIF main_rec.SOURCE = 'Payables'
THEN
l_party_name := main_rec.reference_1;
BEGIN
SELECT segment1
INTO l_party_number
FROM po_vendors
WHERE UPPER (vendor_name) = UPPER (l_party_name);
EXCEPTION
WHEN OTHERS
THEN
l_party_number := NULL;
END;
ELSIF main_rec.CATEGORY = 'Payments'
THEN
BEGIN
SELECT pv.vendor_name, pv.segment1
INTO l_party_name, l_party_number
FROM ap_checks_all ac, po_vendors pv
WHERE pv.vendor_id = ac.vendor_id
AND ac.check_id = main_rec.reference_3;
EXCEPTION
WHEN OTHERS
THEN
l_party_name := NULL;
l_party_number := NULL;
END;
-- Commented End for Bug 10405
ELSIF ( main_rec.CATEGORY = 'Debit Memos'
OR main_rec.CATEGORY = 'Credit Memos'
OR main_rec.CATEGORY = 'Sales Invoices'
THEN
BEGIN
SELECT hp.party_name, rc.account_number
INTO l_party_name, l_party_number
FROM apps.ra_cust_trx_line_gl_dist_all dist,
-- apps.ra_customer_trx_lines_all line,
apps.ra_customer_trx_all trx,
-- apps.ra_customers rc
apps.hz_cust_accounts rc,
hz_parties hp -- /*bug#7534 */
WHERE cust_trx_line_gl_dist_id = main_rec.reference_3
--and dist.CUSTOMER_TRX_LINE_ID=line.CUSTOMER_TRX_LINE_ID
AND trx.customer_trx_id = dist.customer_trx_id
AND trx.bill_to_customer_id = rc.cust_account_id
AND rc.party_id = hp.party_id
AND trx.set_of_books_id = NVL (p_set_of_book, 1001);
EXCEPTION
WHEN OTHERS
THEN
l_party_name := NULL;
l_party_number := NULL;
l_reference_number := NULL;
END;
ELSIF ( main_rec.CATEGORY = 'Misc Receipts'
OR main_rec.CATEGORY = 'Trade Receipts'
THEN
BEGIN
SELECT hp.party_name, hca.account_number
INTO l_party_name, l_party_number
FROM hz_parties hp, hz_cust_accounts hca
WHERE hp.party_id = hca.party_id
AND hca.cust_account_id = main_rec.reference_7;
EXCEPTION
WHEN OTHERS
THEN
l_party_name := NULL;
l_party_number := NULL;
END;
ELSE
l_party_name := main_rec.party_name;
l_party_number := main_rec.party_number;
l_reference_number := NULL;
END IF;
IF main_rec.SOURCE = 'Receivables' THEN
IF ( main_rec.CATEGORY = 'Debit Memos'
OR main_rec.CATEGORY = 'Credit Memos'
OR main_rec.CATEGORY = 'Sales Invoices'
THEN
BEGIN
SELECT DECODE (line.interface_line_context,
'OKS CONTRACTS', line.interface_line_attribute1, 'EQIX METERED POWER',line.interface_line_attribute3,
NULL
) contract_number,
DECODE (line.interface_line_context,
'OKS CONTRACTS', line.interface_line_attribute2,
NULL
) contract_modified,
DECODE (line.interface_line_context,
'ORDER ENTRY', line.interface_line_attribute1,
NULL
) order#,
(SELECT aci.cut_off_date
FROM apps.ar_cons_inv_all aci,
(SELECT DISTINCT customer_trx_id, cons_inv_id
FROM apps.ar_cons_inv_trx_lines_all) acit
WHERE aci.cons_inv_id = acit.cons_inv_id
AND dist.customer_trx_id = acit.customer_trx_id)
statement_date,
CASE line.interface_line_context
when 'OKS CONTRACTS' then
TO_CHAR
(TO_DATE (line.interface_line_attribute4,'YYYY/MM/DD' ),
'DD-MON-YYYY')
when 'EQIX METERED POWER' then line.interface_line_attribute4
else null
end as billed_from,
CASE line.interface_line_context
when 'OKS CONTRACTS' then
TO_CHAR
(TO_DATE (line.interface_line_attribute5,'YYYY/MM/DD' ),
'DD-MON-YYYY')
when 'EQIX METERED POWER' then line.interface_line_attribute5
else null
end as billed_to,
TO_CHAR(TO_DATE (DECODE (line.interface_line_context, 'OKS CONTRACTS', line.interface_line_attribute8, NULL ),'YYYY/MM/DD'),'DD-MON-YYYY') start_date
INTO l_contract_number,
l_contract_modified,
l_order_number,
l_statement_date,
l_billed_from,
l_billed_to,
l_start_date
FROM
apps.ra_customer_trx_all trx,
ra_customer_trx_lines_all line,
apps.ra_cust_trx_line_gl_dist_all dist,
apps.hz_cust_accounts rc,
hz_parties hp
WHERE cust_trx_line_gl_dist_id = main_rec.reference_3
AND trx.customer_trx_id = line.customer_trx_id
AND dist.customer_trx_line_id=line.customer_trx_line_id
AND trx.bill_to_customer_id = rc.cust_account_id
AND rc.party_id = hp.party_id
AND trx.set_of_books_id = NVL (p_set_of_book, 1001)
AND line.line_type = 'LINE';
EXCEPTION
WHEN OTHERS
THEN
l_contract_number := NULL;
l_contract_modified := NULL;
l_order_number := NULL;
l_statement_date := NULL;
l_billed_from := NULL;
l_billed_to := NULL;
l_start_date := NULL;
END;
END IF;
END IF;
--do processing to get line number , trx_number
IF ( main_rec.CATEGORY = 'Debit Memos'
OR main_rec.CATEGORY = 'Credit Memos'
OR main_rec.CATEGORY = 'Sales Invoices'
THEN
BEGIN
SELECT TO_CHAR (line_number), line.interface_line_attribute1
INTO l_trx_line_number, l_reference_number
FROM ra_cust_trx_line_gl_dist_all dist,
ra_customer_trx_lines_all line,
ra_customer_trx_all trx
WHERE cust_trx_line_gl_dist_id = main_rec.reference_3
AND dist.customer_trx_line_id = line.customer_trx_line_id
AND trx.customer_trx_id = line.customer_trx_id;
EXCEPTION
WHEN OTHERS
THEN
l_trx_line_number := NULL;
END;
l_trx_number := main_rec.reference_4;
ELSIF ( main_rec.CATEGORY = 'Misc Receipts'
OR main_rec.CATEGORY = 'Trade Receipts'
THEN
l_trx_number := main_rec.reference_4;
l_trx_line_number := NULL;
ELSIF main_rec.CATEGORY = 'Adjustment'
THEN
l_trx_number := main_rec.reference_5;
l_trx_line_number := NULL;
ELSIF main_rec.CATEGORY = 'Purchase Invoices'
THEN
l_trx_number := main_rec.reference_5;
l_trx_line_number := main_rec.reference_3;
ELSIF main_rec.CATEGORY = 'Payments'
THEN
--l_trx_number:=main_rec.reference_3;
l_trx_number := main_rec.reference_4;
-- change by dody CHG0030444
l_trx_line_number := NULL;
ELSE
l_trx_number := main_rec.trx_number;
l_trx_line_number := main_rec.trx_line_number;
END IF;
v_display_str :=
main_rec.period_name| '^'|| main_rec.SOURCE|| '^'|| main_rec.CATEGORY|| '^'|| main_rec.batch_name|| '^'|| main_rec.journal_name
|| '^'|| main_rec.segment1|| '^'|| main_rec.segment2|| '^'|| main_rec.segment3|| '^'|| main_rec.segment4|| '^'|| main_rec.segment5
|| '^'|| main_rec.segment6|| '^'|| main_rec.segment7|| '^'|| main_rec.segment8|| '^'| main_rec.je_line_num|| '^'|| main_rec.je_line_description
|| '^'|| main_rec.gl_date|| '^'|| main_rec.post_date|| '^'|| l_party_name|| '^'|| l_party_number|| '^'|| main_rec.transaction_class
|| '^'|| l_trx_number|| '^'|| l_trx_line_number|| '^'|| main_rec.po_number|| '^'|| main_rec.po_line|| '^'|| main_rec.po_category --Added for Bug # 11741
|| '^'|| main_rec.proj_code|| '^'|| main_rec.debit|| '^'|| main_rec.credit|| '^'|| main_rec.net_amount|| '^'|| main_rec.entered_currency
|| '^'|| main_rec.entered_debit|| '^'|| main_rec.entered_credit|| '^'|| main_rec.net_entered_amount|| '^'|| main_rec.bank_account_number
|| '^'|| main_rec.bank_account_name|| '^'|| main_rec.it2_nl_posting_ref|| '^'|| main_rec.bank_transaction_date|| '^'|| main_rec.it2_transaction_number
|| '^'|| main_rec.funds_subtype_name| '^'|| main_rec.attribute7|| '^'|| main_rec.attribute8|| '^'|| main_rec.attribute9|| '^'
|| l_contract_number|| '^'|| l_contract_modified|| '^'|| l_order_number|| '^'|| l_statement_date
|| '^'|| l_billed_from|| '^'|| l_billed_to|| '^'|| l_start_date|| '^'|| l_reference_number;
i := i + 1;
fnd_file.put_line (fnd_file.output, v_display_str);
END LOOP;
CLOSE c_acct;
ELSE
END IF;
EXCEPTION
WHEN OTHERS THEN
fnd_file.put_line (fnd_file.LOG, 'account analysis process error out - ' || SQLERRM );
retcode := 2;
errbuf := SUBSTR (SQLERRM, 1, 120);
RAISE;
END ACCTALS;
/Thanks in advance,
Nag
Edited by: 838961 on Apr 12, 2013 1:29 AM
Edited by: 838961 on Apr 12, 2013 2:02 AM
You are probably looking for the SQL/XML functions that have been in Oracle for several major releases now. Here is the latest Oracle documentation on them
[url http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb13gen.htm]Generating XML Data from the Database
You can also find some examples at [url http://www.oracle-base.com/articles/misc/sqlxml-sqlx-generating-xml-content-using-sql.php]SQL/XML (SQLX) : Generating XML using SQL in Oracle. There are plenty of examples on the forums and web in general.
Note: It is a lower case "code" in your formatting tags, not "CODE"
Similar Messages
-
How to use Write statement along with ALV output
Hi expert,
currently i have a requirement where i am first displaying message with write statement and after that ALV should be displayed ...something like below:
vendor number is wrong.
material number is wrong.
plant is wrong.
and then here ALV output -list of records updated in the database.
but as of now the ALV is shown first and when going back then the write message information is dispayed.
can anyone help how we can get this in only one screen?
Thanks!!!
RajeshMay below example give you some idea.
TYPE-POOLS: slis.
DATA: BEGIN OF it_kna1 OCCURS 0,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
ort01 TYPE kna1-ort01,
END OF it_kna1.
DATA: it_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
START-OF-SELECTION.
SELECT kunnr name1 ort01
FROM kna1 INTO TABLE it_kna1 UP TO 10 ROWS.
END-OF-SELECTION.
WRITE:/ 'Write Statement Display' HOTSPOT ON.
AT LINE-SELECTION.
CLEAR it_fcat.
it_fcat-fieldname = 'KUNNR'.
it_fcat-tabname = 'IT_KNA1'.
it_fcat-seltext_l = 'Customer'.
APPEND it_fcat.
CLEAR it_fcat.
it_fcat-fieldname = 'NAME1'.
it_fcat-tabname = 'IT_KNA1'.
it_fcat-seltext_l = 'Customer Name'.
APPEND it_fcat.
CLEAR it_fcat.
it_fcat-fieldname = 'ORT01'.
it_fcat-tabname = 'IT_KNA1'.
it_fcat-seltext_l = 'City'.
APPEND it_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fcat[]
TABLES
t_outtab = it_kna1[]. -
Oracle report server 10g with load balancer.
Hi All,
We are in very big trouble, Please help us out. Issue is
we have install oracle 10gApplication server along with Report Server stand alone, Application server and report server are working fine but when we put reports into physical load balaner its showing unable to connect report server, I try to dignose with help of some he writes me on command can you people clear me what this mean.
[oracle@rep bin]$ ./rwdiag.sh -findall
Broadcast mechanism used to locate servers
Channel address = 228.5.6.7
Channel port = 14021
(1) Name = rep_cbs_lhr : Type = server : Host = rep.mcb.com.pk
(2) Name = rep_rep_oracleas1 : Type = server : Host = rep.mcb.com.pk
(3) Name = rep_eoc12_oracleas1 : Type = server : Host = eoc12.mcb.com.pk
(4) Name = rep_lahore : Type = server : Host = eoc1.mcb.com.pk
(5) Name = rep_as1_as1 : Type = server : Host = as1.mcb.com.pk
(6) Name = lhr_rep : Type = server : Host = eoc1.mcb.com.pk
[oracle@rep bin]$
Regardshi,
./rwdiag.sh -findall
rwdiag is a utility used to find all the Reports Servers on the network.
./rwdiag.sh -find <report server-name>
and it monitors packets broadcasted on the network by the particular Reports Server.
THis link might help you,details about rwdiag.sh
http://download.oracle.com/docs/cd/B14099_19/bi.1012/b14048/pbr_rwdiag.htm
Regards
Fabian -
Hello all,
We have configured JDBC Sender Adapter which fetches around 10K records with poll interval 1hr from DB2 System .
It was working fine,suddenly it started throwing an exception in Adapter Monitoring :
Error during conversion of query result to XML: java.sql.SQLException: Cursor state not valid.
It is not fetching any records.
Without changing any configurations when we tried to fetch to around 1000 records it's working fine.
For 10K records same exception persists
What could be the reason ?How to resolve this issue?
regards
GangaPrasadHello Christophe ,
Trace in VA :::
Date : 05/09/2008
Time : 11:45:57:750
Message : Unexpected error converting database resultset to XML, reason: java.sql.SQLException: Cursor state not valid.
at java.lang.Throwable.<init>(Throwable.java:194)
at java.lang.Exception.<init>(Exception.java:41)
at java.sql.SQLException.<init>(SQLException.java:40)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:309)
at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
Severity : Error
Category : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
Location : com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(ResultSet, ResultSetMetaData)
Application :
Thread : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
Datasource : 12428950:/usr/sap/PXI/DVEBMGS01/j2ee/cluster/server0/log/applications/com.sap.xi/xi.log
Message ID : 00145E742794005E0014980B000000BE00044CC763766C4F
Source Name : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
Argument Objs : java.sql.SQLException: Cursor state not valid.
at java.lang.Throwable.<init>(Throwable.java:194)
at java.lang.Exception.<init>(Exception.java:41)
at java.sql.SQLException.<init>(SQLException.java:40)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:309)
at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
Arguments : java.sql.SQLException: Cursor state not valid.
at java.lang.Throwable.<init>(Throwable.java:194)
at java.lang.Exception.<init>(Exception.java:41)
at java.sql.SQLException.<init>(SQLException.java:40)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:309)
at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
Dsr Component :
Dsr Transaction : d1f629d01d9b11dd984200145e742794
Dsr User :
Indent : 0
Level : 0
Message Code :
Message Type : 1
Relatives : com.sap.aii.adapter.jdbc.JDBC2XI
Resource Bundlename :
Session : 0
Source : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
ThreadObject : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
Transaction : SAP J2EE Engine JTA Transaction : [0ffffffbdffffffa6ffffff960086]
User : J2EE_GUEST
Regards
Ganga Prasad -
Convert sql select statement to oracle
Hi All,
Can anyone help me converting this Sql select statement to oracle ....
-----------------------------------------Query--------------------------------------------------------------
select emp_master.emp_code ,
emp_master.dept_cd ,
attendance_master.daily_attn_code ,
attendance_master.linked_column ,
case when location.payroll_status <> 'N' and eDocsNetEmployeesLeave.StartDate < dateadd(mm, 1 , convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01'))
then
dateadd(mm, 1 , convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01'))
when eDocsNetEmployeesLeave.StartDate < convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01')
then convert(smalldatetime, datename(yy ,location.next_pay_date) + '/'+ datename(mm ,location.next_pay_date)+ '/01') else eDocsNetEmployeesLeaveDetails.StartDate
end ,
eDocsNetEmployeesLeaveDetails.NoOfDays,
case when eDocsNetEmployeesLeave.StartDate > location.next_pay_date
then convert(datetime , convert(varchar, dateadd(ss,-1, dateadd(mm, 1, convert(datetime , datename(yy,eDocsNetEmployeesLeave.StartDate)+ '/' + datename(mm,eDocsNetEmployeesLeave.StartDate)+ '/01') )),106) )
else
case when location.payroll_status <> 'N'
then dateadd(mm,1,location.next_pay_date)
else location.next_pay_date
end
end as PaymentDate ,
isnull(grade_master.leave_type,'C') ,
eDocsNetEmployeesLeave.StartDate ,
eDocsNetEmployeesLeaveDetails.LeaveType
from eDocsNetEmployeesLeave ,
eDocsNetEmployeesLeaveDetails ,
eDocsNetLeaveTypes ,
emp_master ,
grade_master ,
attendance_master ,
location
where eDocsNetEmployeesLeaveDetails.RequestID = eDocsNetEmployeesLeave.RequestID and
eDocsNetEmployeesLeave.EmployeeID = emp_master.emp_code and
eDocsNetEmployeesLeaveDetails.LeaveType = eDocsNetLeaveTypes.LeaveTypeID and
eDocsNetLeaveTypes.loc_cd = emp_master.loc_cd and
location.loc_cd = emp_master.loc_cd and
attendance_master.loc_cd = emp_master.loc_cd and
attendance_master.linked_column = eDocsNetLeaveTypes.LinkedAttendance and
grade_master.loc_cd = emp_master.loc_cd and
grade_master.grade_cd = emp_master.grade_cd and
eDocsNetEmployeesLeaveDetails.RequestID = @RequestID
order by eDocsNetEmployeesLeaveDetails.StartDate
Thanks in Advance
SmileySeems like you want to convert a SQL statement from the ??? dialect to the Oracle dialect. *(It would be useful to indicate the non-ANSI standard SQL you are starting with.)
Part of the problem is that you use several date related functions. Some are unnecessary in Oracle and some need to translated into Oracle functions as found in the Functions section (chapter 5) of the SQL Reference manual at http://www.oracle.com/pls/db102/homepage
Note that columns and expressions of type 'date' in ORacle always contain all of "yyyy mm dd hh mi ss" and you need to format and trauncate as necessary.
Also note that '09-JAN-31' is NOT an Oracle date, but rather a character representation of a date which must be converted to/from a date expression. You will often need to use the to_date() and to_char() functions with a format mask as the second parameter. This is also descreibed in the first 2 chapters of the SQL Reference manual. -
Convert the insert statement of an MS SQL server into an oracle statement
Hi ,
The insert statement in the ms sql server is
INSERT INTO #temp EXEC Procedurename @Id OUTPUT
where table temp
CREATE TABLE #temp(
Id varchar(10),
FNa varchar(40),
LNa varchar(40),
SId varchar(20),
Aid varchar(20),
Did varchar(20),
CCNa varchar(255),
CCId int,
ISu char(1),
IA char(1),
Dir char(1),
Ema varchar(60),
St char(2),
DId char(3)
I converted the insert statement like this
Procedurename(Id);
LOOP
FETCH cv_1 INTO v_temp;
EXIT WHEN cv_1%NOTFOUND;
INSERT INTO TEMP VALUES v_temp;
END LOOP;
CLOSE cv_1;
But i am receiving PL/SQL: ORA-00947: not enough values
Can anyone help on this?
Thanks1) Are you sure that you even need a temp table? Fetching all the rows from a cursor 1-by-1 and then inserting them into a temp table (I'm assuming the Oracle table TEMP is declared as a global temporary table) would seem rather unusual and most likely pointless. In Oracle, readers don't block writers, so there is generally no need to use temp tables to hold intermediate results.
2) If you do need to store a set of results into a table, it's going to be more efficient to do this in a single SQL statement rather than using a cursor. Something like
INSERT INTO my_table ( <<list of columns>> )
SELECT <<list of columns>>
FROM <<other tables>>
WHERE <<some conditions>>The SELECT part of the statement here is likely whatever SQL you use in declaring the cursor.
Justin -
Problem with fetch cursor statement
Hi,
I am using FETCH CURSOR statement to fetch the data from a database table with package size. For the fetched records I am doing parallel processing using parallel processing frame work in banking system.
Here the problem is for the first iteration it works fine but when it comes to FETCH NEXT CURSOR in the second iteration , programs gets dumping by saying that 'CURSOR already closed'.
I am not closing the cursor in the program but some how it got closed some where in the standard function module which I used for parallel processing.
I used WITHHOLD also along with FETCH CURSOR but no use. Please let me know how to avoid the cursor to get close.
Below is my code
IF NOT l_tab_product IS INITIAL.
OPEN CURSOR WITH HOLD lv_cursor FOR
SELECT contract_int prodint cn_currency mig_grp
INTO TABLE gt_cont
FROM bca_contract
FOR ALL ENTRIES IN l_tab_product
WHERE prodint = l_tab_product-prodint
AND mig_grp IN s_migrp.
DO.
FETCH NEXT CURSOR lv_cursor
INTO TABLE gt_cont
PACKAGE SIZE lv_size.
IF sy-subrc <> 0.
CLOSE CURSOR lv_cursor.
EXIT.
ELSE.
parallel processing logic
ENDDO.
ENDIF.Using Withhold will not make sure that the cursor will not get closed because of commits.
SAP Doc says
If the addition WITH HOLD is specified, the database cursor is not closed by a database commit executed using Native SQL. The addition does not have an influence, however, on implicit database commits or on any rollbacks which always close the database cursor.
You have to check the part written in your parallel processing logic.
As Brad said please donot dump your old threads like this. -
Import error imp-00017: following statement failed with oracle error 1659:
Hi all,
I am trying to import a file (dmp) which is of 1.63GB size,
when I type
imp
dbname/pwd@db
c:\filepath
30720
no
no
yes
yes
yes
I am getting the error imp-00017: following statement failed with oracle error 1659:
-- end it says Ora-01659 unable to allocate minextents beyond 1 in tablespace USERS
--unable to create INITIAL extent for segment in tablespace USERS
--import terminated successfully with warnings
when I looked into
select maxbytes,file_name from dba_data_files where tablespace_name='USERS';3.4360+10 c:\oracle\product\10.2.0\oradata\orcl\users01.dbf
kindly help me in solving this is.
Regards,
aak
Edited by: AAK 460425 on Apr 12, 2009 6:33 PMThanks,
select bytes from user_free_space where tablespace_name='USERS'
BYTES
458752
720896
458752
655360
43384832
is the size less?
My apology I have updated this in the below thread, which is same as this one.
Re: Import error -
I am having difficulty including text with iPhotos I want to share through email. I get a red exclamation mark along with a statement stating that the text doesn't fit into the designated text area. This is so frustrating. Before iLire11 I was easily able to share photos with email messages. Arghhhh!
In the iPhoto preferences you can set Apple Mail as your e-mail client and then it will work exactly as before
LN -
Need help with **** Invalid Cursor State ****
Hi,
can someone tell me why am i getting this error....
//******java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
Any help is greatly appreciated.....
Thanks in advance.
//***********this is the output on servlet side**************//
Starting service Tomcat-Standalone
Apache Tomcat/4.0.3
Starting service Tomcat-Apache
Apache Tomcat/4.0.3
init
DBServlet init: Start
DataAccessor init: Start
Accessor init: Loading Database Driver: sun.jdbc.odbc.JdbcOdbcDriver
DataAccessor init: Getting a connection to - jdbc:odbc:SCANODBC
username SYSDBA
password masterkey
DataAccessor init: Preparing searchPolicy
DataAccessor init: Prepared policySearch
DataAccessor init: Prepared ssnSearch
DataAccessor init: End
After the myDataAccessor
Database Connection...
in doGet(...)
SSSSSSSGetpolicynumber
In GetPolicyInformation
b05015195
Getting Policy Informaton for = b05015195
okay, building vector for policy
in GetPolicyInformation for = b05015195
starting query... policy Information
finishing query... Policy Information
Inside the while(next) loop
sun.jdbc.odbc.JdbcOdbcResultSet@4db06e
sun.jdbc.odbc.JdbcOdbcResultSet@4db06e
b05015195
policy information constructor with resultset
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3266)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:
5398)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:326)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:383)
at viewscreenappletservlet.policyinformation.<init>(policyinformation.ja
va:56)
at viewscreenappletservlet.DatabaseAccessor.getPolicyInformation(Databas
eAccessor.java:145)
at viewscreenappletservlet.Servlet.policyDisplay(Servlet.java:108)
at viewscreenappletservlet.Servlet.doGet(Servlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
et.java:446)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java
:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
r.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
va:1107)
at java.lang.Thread.run(Thread.java:484)
result set closed
1
sending response
Sending policy vector to applet...
Data transmission complete.1) JDBC-ODBC driver is buggy
2) Some drivers (truly speaking most of them) doesn't
support cursors or supports them in a wrong way
Paul -
Oracle 11gR2 RAC problem with resource state
Hi all,
I installed Oracle 11gR2 grid infrastructure with 2 nodes and I installed DB 11gR2.
S.O: HP-UX
I actived both DB instance in each node.
For an hardware problem node 1 become unstable (continuos auto reboot).
I found that the problem was RAM.
However I note that database resource is in a particular state and i don't able to reset it.
Performing command crsctl status resource ora.orcl.db this is the result
ora.orcl.db
1 OFFLINE UNKNOWN node1 Startup Initiated
2 ONLINE ONLINE node2 Open
That UNKNOWN state is really abstruse.
I tryed to perform crsctl stop resource ora.orcl.db -n node1 and the result is
CRS-2679: Attempting to clean 'ora.orcl.db' on 'node1'
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
HPUX-ia64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
CRS-2680: Clean of 'ora.orcl.db' on 'node1' failed
CRS-4000: Command Stop failed, or completed with errors.
I tryed to perform crsctl start resource ora.orcl.db -n node1 and the result is
CRS-2662: Resource 'ora.orcl.db' is disabled on server 'node1'
CRS-4000: Command Start failed, or completed with errors.
How do I do to reset that UNKNOWN state?
Thanks in advance.
Bye
AlessandroI tryed srvctl enable instance -d orcl -i ORCL_1
but the results is
srvctl enable instance command is not supported for configuration using server pool.
I tryed to delete service ora.orcl.db and recreate it.
Now I have
NAME=ora.orcl.db
TYPE=ora.database.type
TARGET=ONLINE , ONLINE
STATE=UNKNOWN on node1, OFFLINE
So Targets are both ONLINE, but if I write crsctl start resource ora.orcl.db
the result is
CRS-2679: Attempting to clean 'ora.orcl.db' on 'node1'
CRS-2672: Attempting to start 'ora.orcl.db' on 'node2'
CRS-5003: Invalid attribute value: '' for attribute DB_UNIQUE_NAME
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
HPUX-ia64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
CRS-2674: Start of 'ora.orcl.db' on 'node2' failed
CRS-2679: Attempting to clean 'ora.orcl.db' on 'node2'
CRS-2681: Clean of 'ora.orcl.db' on 'node2' succeeded
CRS-2632: There are no more servers to try to place resource 'ora.orcl.db' on that would satisfy its placement policy
CRS-2680: Clean of 'ora.orcl.db' on 'node1' failed
CRS-4000: Command Start failed, or completed with errors.
Where DB_UNIQUE_NAME attribute must be set?
Any other suggest?
Thanks in advance.
Regards.
Alessandro
Edited by: Alessandro Zenoni on 21-giu-2010 11.26 -
IMP-00017: following statement failed with ORACLE error 901:
Why I get these error messages while I do full import? Could anyone help me on this issue?
IMP-00017: following statement failed with ORACLE error 901:
"CREATE FORMAT92TRIG "
IMP-00003: ORACLE error 901 encountered
ORA-00901: invalid CREATE command
IMP-00008: unrecognized statement in the export file:
ýÿ$
Note:- I have used the same command to import the same export file to a different SID and it went fine but when I try to do import for SID (DEMO), I get the above mentioned errors.
Thanks
Rajesh KumarThanks for the clue
Got it right, when i changed the primary Oracle Home from 10gDS to 9iDB. 10gDS has a lower version of import as compared to 9iDB.
Rajesh -
IMP-00017: following statement failed with ORACLE error 2304
Hi,
in 9i DB when importing I have :
IMP-00017: following statement failed with ORACLE error 2304:
"CREATE TYPE "T_NUMBER" TIMESTAMP '2007-04-02:10:02:26' OID '6B4C21C0310143B"
"A97211E5E8301C09E' "
" as table of number"
IMP-00003: ORACLE error 2304 encountered
ORA-02304: invalid object identifier literal
Can any one please explaine me the problem and if possible a solution ?
Many thanks.The problem is explained in the metalink Note:113335.1
-
IMP-00017: following statement failed with ORACLE error 1849
Hi
We have a instance 11.1.0.7
while doing import i got the issue as:
IMP-00017: following statement failed with ORACLE error 1849:
"BEGIN "
"dbms_scheduler.create_job('"MAXIMOTSSYNC"',"
"job_type=>'STORED_PROCEDURE', job_action=>"
"'maximo_ts_job'"
", number_of_arguments=>0,"
"start_date=>'30-AUG-12 15.12.04.000000 +04:00', repeat_interval=> "
"'SYSDATE + 5/1440'"
", end_date=>NULL,"
"job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>TRUE,comments="
">"
"NULL"
"dbms_scheduler.enable('"MAXIMOTSSYNC"');"
"COMMIT; END;"
IMP-00003: ORACLE error 1849 encountered
ORA-01849: hour must be between 1 and 12
ORA-06512: at line 2
IMP-00091: Above error occurred on the following function and object: CREATE MAXIMOTSSYNC. Remaining PL/SQL blocks for this object will be skipped.
Import terminated successfully with warnings.
My imp command is:
imp system/manager file=schema.DMP log=schema.log fromuser=max touser=max
Please suggest on this
Thanks
ShaikORA-01849: hour must be between 1 and 12Error: ORA 1849
Text: hour must be between 1 and 12
Cause: An invalid hour was specified for a date using the 12-hour time format.
If a 12-hour format code (HH or HH12) is used, the specified hour must
be between 1 and 12.
Action: Enter an hour value between 1 and 12. -
IMP-00017: following statement failed with ORACLE error 1031
Hello,
I export a schema from prod (database A) and I try to imported to onther test database (databse B).
database A: single database - Non ASM - 10gR1
database B: RAC database - ASM -10gR2
To import database I use this:
imp osiris/b@osiris file=prod_osiris070601.dmp full=y ignore=y log=osiris.log
All the tables are imported withot problem but when he start to imprt views I get this error:
IMP-00017: following statement failed with ORACLE error 1031:
Can you please help?
Thanck you in advance.I thing that the problem is that the user can not create views!!!
I create the user normaly and I give him this rols: "CREATE SESSION", "CONNECT" and "RESOURCE"
it's ok?
. . importing table "ZIP_CODE" 70768 rows imported
IMP-00017: following statement failed with ORACLE error 1031:
"CREATE FORCE VIEW "OSIRIS"."DETAILED_FRANKING_SYSTEM_VIEW" "
" ("CONFIGURATION_SYSTEM_ID","SYSTEM_ID","DEVICE_SERIAL_NO","OPCO_DE"
"VICE_SERIAL_NO","STATUS","BO_CUST_ID","CUSTOMER_NAME","CUSTOMER_ADDRESS_NAM"
"E","CUSTOMER_STREET1","CUSTOMER_STREET2","CUSTOMER_STREET3","CUSTOMER_STREE"
"T4","CUSTOMER_CITY","CUSTOMER_STATE","CUSTOMER_ZIP4","CUSTOMER_ZIP","CUSTOM"
"ER_COUNTRY","CUSTOMER_NAME_CAP","CUSTOMER_ADDRESS_NAME_CAP","CUSTOMER_STREE"
"T1_CAP","CUSTOMER_STREET2_CAP","CUSTOMER_STREET3_CAP","CUSTOMER_STREET4_CAP"
"","CUSTOMER_ADDRESS_STREET_CAP","CUSTOMER_CITY_CAP","CUSTOMER_STATE_CAP","C"
"USTOMER_COUNTRY_CAP","INSTALL_ADDRESS_NAME","INSTALL_STREET1","INSTALL_STRE"
"ET2","INSTALL_STREET3","INSTALL_STREET4","INSTALL_CITY","INSTALL_STATE","IN"
"STALL_ZIP4","INSTALL_ZIP","INSTALL_COUNTRY","INSTALL_ADDRESS_NAME_CAP","INS"
"TALL_STREET1_CAP","INSTALL_STREET2_CAP","INSTALL_STREET3_CAP","INSTALL_STRE"
"ET4_CAP","INSTALL_ADDRESS_STREET_CAP","INSTALL_CITY_CAP","INSTALL_STATE_CAP"
"","INSTALL_COUNTRY_CAP","DESCRIPTION","CONFIG_MODEL_ID","TYPE","PART_NUMBER"
"AND DEVICE_SYSTEM.DEVICE_TYPE='METER'"
"AND US_SERIAL_NO_CONVERTER.DEVICE_SERIAL_NO(+) = DEVICE_SYSTEM.DEVICE_SERIA"
"L_NO"
IMP-00003: ORACLE error 1031 encountered
ORA-01031: insufficient privileges
IMP-00017: following statement failed with ORACLE error 942:
"GRANT DELETE ON "DETAILED_FRANKING_SYSTEM_VIEW" TO "APP""
IMP-00003: ORACLE error 942 encountered
Message was edited by:
ASkika
Maybe you are looking for
-
Opening and Closing balances in RG1 register
Hi, We are facing one issue in RG1 register. When we update and extract the RG1 register from system, its showing Sales Qty and Excise duties properly. But opening and closing balances are not coming, its showing zero there. I checked J_2IRG1BAL tabl
-
How do I remove an iPhone 4 that was turned in to Apple when I bought an iPhone 5 from Find My iPhone, when it will no longer be connected to the Internet? It is currently pending erasure
-
Sender File Adapter Conversion problem - how to start new recordset?
Hi guys! I have a source file like following: aaaakkkkkk uuuupppppp &&hhhhffffff 6666uuuuuu 3333rrrrrrrr &&kkkkoooooo which means - fixed length 4,6 and && starts new recordset. I need to get structure like: <recordset> <item> <a>aaaa</a> <
-
Import classes that are not part of any package
I have this problem with the JDK1.4 compiler: I have a few classes that were created outside of any package for some JNI uses. When I used JDK1.3 to compile, I was able to get the compiler to find these classes by doing the following in the calling c
-
Hi , SELECT wip_entity_name , pr_coc FROM AEC.COC WHERE WIP_ENTITY_NAME in ( 'NP127408', 'NP127409', 'NP127407', 'NP127406') Now the result I want is even if the wip_entity_name is not in the table the qry should return the wip_entity_name and pr_coc