Problem in PL/SQL package
Hi All
I have following problem in My wrapper package, Kindly help me to figure out this issue.
My Package:
type ebs_pricelistHeader_row is record(
REQUEST_ID NUMBER,
PRICE_LIST_NAME VARCHAR2(240 BYTE),
DESCRIPTION VARCHAR2(2000 BYTE),
CURRENCY_CODE VARCHAR2(30 BYTE),
BRANCH VARCHAR2(40 BYTE),
EFFECTIVE_FROM DATE,
EFFECTIVE_TO DATE,
PRICE_LIST_ID NUMBER,
PROCESS_FLAG VARCHAR2(1 BYTE)
My Package body is working fine and also return result that i need
Problem in Wrapper Package body:
When i use my above package in SOA Suite a wrapper package and its body gets created but the wrapper package body gives the following errors. this is very strange as i already did these types of tasks that are working fine and no issue with their wrappers.
Please see the error in my wrapper package body
http://s24.postimg.org/tco1o0951/wrapper.jpg
errors are
Error(12,1): PL/SQL: Statement ignored
Error(12,10): PLS-00302: component 'DESCRIPTION' must be declared
Error(13,1): PL/SQL: Statement ignored
Error(13,10): PLS-00302: component 'CURRENCY_CODE' must be declared
Error(14,1): PL/SQL: Statement ignored
Error(14,10): PLS-00302: component 'BRANCH' must be declared
Please let me know if any other thing is required.
Kindly help me to resolve this issue. thanks a lot
Muhammad Nasir
Wrapper package code
create or replace
PACKAGE BODY WRAPPER_EBSPRICELISTSPRCDATA IS
FUNCTION PL_TO_SQL2(aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_ROW)
RETURN EBS_SOA_PRICELIX1199385X1X20 IS
aSqlItem EBS_SOA_PRICELIX1199385X1X20;
BEGIN
-- initialize the object
aSqlItem := EBS_SOA_PRICELIX1199385X1X20(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL);
aSqlItem.REQUEST_ID := aPlsqlItem.REQUEST_ID;
aSqlItem.PRICE_LIST_NAME := aPlsqlItem.PRICE_LIST_NAME;
aSqlItem.DESCRIPTION := aPlsqlItem.DESCRIPTION;
aSqlItem.CURRENCY_CODE := aPlsqlItem.CURRENCY_CODE;
aSqlItem.BRANCH := aPlsqlItem.BRANCH;
aSqlItem.EFFECTIVE_FROM := aPlsqlItem.EFFECTIVE_FROM;
aSqlItem.EFFECTIVE_TO := aPlsqlItem.EFFECTIVE_TO;
aSqlItem.PRICE_LIST_ID := aPlsqlItem.PRICE_LIST_ID;
aSqlItem.PROCESS_FLAG := aPlsqlItem.PROCESS_FLAG;
aSqlItem.CREATED_BY := aPlsqlItem.CREATED_BY;
aSqlItem.CREATION_DATE := aPlsqlItem.CREATION_DATE;
aSqlItem.LAST_UPDATED_BY := aPlsqlItem.LAST_UPDATED_BY;
aSqlItem.LAST_UPDATE_DATE := aPlsqlItem.LAST_UPDATE_DATE;
aSqlItem.LAST_UPDATE_LOGIN := aPlsqlItem.LAST_UPDATE_LOGIN;
aSqlItem.EN_PRICE_LIST_NAME := aPlsqlItem.EN_PRICE_LIST_NAME;
aSqlItem.AR_PRICE_LIST_NAME := aPlsqlItem.AR_PRICE_LIST_NAME;
RETURN aSqlItem;
END PL_TO_SQL2;
FUNCTION SQL_TO_PL2(aSqlItem EBS_SOA_PRICELIX1199385X1X20)
RETURN APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_ROW IS
aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_ROW;
BEGIN
aPlsqlItem.REQUEST_ID := aSqlItem.REQUEST_ID;
aPlsqlItem.PRICE_LIST_NAME := aSqlItem.PRICE_LIST_NAME;
aPlsqlItem.DESCRIPTION := aSqlItem.DESCRIPTION;
aPlsqlItem.CURRENCY_CODE := aSqlItem.CURRENCY_CODE;
aPlsqlItem.BRANCH := aSqlItem.BRANCH;
aPlsqlItem.EFFECTIVE_FROM := aSqlItem.EFFECTIVE_FROM;
aPlsqlItem.EFFECTIVE_TO := aSqlItem.EFFECTIVE_TO;
aPlsqlItem.PRICE_LIST_ID := aSqlItem.PRICE_LIST_ID;
aPlsqlItem.PROCESS_FLAG := aSqlItem.PROCESS_FLAG;
aPlsqlItem.CREATED_BY := aSqlItem.CREATED_BY;
aPlsqlItem.CREATION_DATE := aSqlItem.CREATION_DATE;
aPlsqlItem.LAST_UPDATED_BY := aSqlItem.LAST_UPDATED_BY;
aPlsqlItem.LAST_UPDATE_DATE := aSqlItem.LAST_UPDATE_DATE;
aPlsqlItem.LAST_UPDATE_LOGIN := aSqlItem.LAST_UPDATE_LOGIN;
aPlsqlItem.EN_PRICE_LIST_NAME := aSqlItem.EN_PRICE_LIST_NAME;
aPlsqlItem.AR_PRICE_LIST_NAME := aSqlItem.AR_PRICE_LIST_NAME;
RETURN aPlsqlItem;
END SQL_TO_PL2;
FUNCTION PL_TO_SQL1(aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_TAB)
RETURN EBS_SOA_PRICELIX1199385X1X19 IS
aSqlItem EBS_SOA_PRICELIX1199385X1X19;
BEGIN
-- initialize the table
aSqlItem := EBS_SOA_PRICELIX1199385X1X19();
IF aPlsqlItem IS NOT NULL THEN
aSqlItem.EXTEND(aPlsqlItem.COUNT);
IF aPlsqlItem.COUNT>0 THEN
FOR I IN aPlsqlItem.FIRST..aPlsqlItem.LAST LOOP
aSqlItem(I + 1 - aPlsqlItem.FIRST) := PL_TO_SQL2(aPlsqlItem(I));
END LOOP;
END IF;
END IF;
RETURN aSqlItem;
END PL_TO_SQL1;
FUNCTION SQL_TO_PL1(aSqlItem EBS_SOA_PRICELIX1199385X1X19)
RETURN APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_TAB IS
aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_TAB;
BEGIN
aPlsqlItem := EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_TAB();
aPlsqlItem.EXTEND(aSqlItem.COUNT);
IF aSqlItem.COUNT>0 THEN
FOR I IN 1..aSqlItem.COUNT LOOP
aPlsqlItem(I) := SQL_TO_PL2(aSqlItem(I));
END LOOP;
END IF;
RETURN aPlsqlItem;
END SQL_TO_PL1;
FUNCTION PL_TO_SQL3(aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_ROW)
RETURN EBS_SOA_PRICELISX1199385X1X2 IS
aSqlItem EBS_SOA_PRICELISX1199385X1X2;
BEGIN
-- initialize the object
aSqlItem := EBS_SOA_PRICELISX1199385X1X2(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL);
aSqlItem.REQUEST_ID := aPlsqlItem.REQUEST_ID;
aSqlItem.PRICE_LIST_NAME := aPlsqlItem.PRICE_LIST_NAME;
aSqlItem.PRODUCT_VALUE := aPlsqlItem.PRODUCT_VALUE;
aSqlItem.PRODUCT_DESC := aPlsqlItem.PRODUCT_DESC;
aSqlItem.UOM := aPlsqlItem.UOM;
aSqlItem.PRIMARY := aPlsqlItem.PRIMARY;
aSqlItem.VALUE := aPlsqlItem.VALUE;
aSqlItem.EFFECTIVE_FROM := aPlsqlItem.EFFECTIVE_FROM;
aSqlItem.EFFECTIVE_TO := aPlsqlItem.EFFECTIVE_TO;
aSqlItem.PROCESS_FLAG := aPlsqlItem.PROCESS_FLAG;
aSqlItem.CREATED_BY := aPlsqlItem.CREATED_BY;
aSqlItem.CREATION_DATE := aPlsqlItem.CREATION_DATE;
aSqlItem.LAST_UPDATED_BY := aPlsqlItem.LAST_UPDATED_BY;
aSqlItem.LAST_UPDATE_DATE := aPlsqlItem.LAST_UPDATE_DATE;
aSqlItem.LAST_UPDATE_LOGIN := aPlsqlItem.LAST_UPDATE_LOGIN;
aSqlItem.PRICE_LIST_ID := aPlsqlItem.PRICE_LIST_ID;
RETURN aSqlItem;
END PL_TO_SQL3;
FUNCTION SQL_TO_PL3(aSqlItem EBS_SOA_PRICELISX1199385X1X2)
RETURN APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_ROW IS
aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_ROW;
BEGIN
aPlsqlItem.REQUEST_ID := aSqlItem.REQUEST_ID;
aPlsqlItem.PRICE_LIST_NAME := aSqlItem.PRICE_LIST_NAME;
aPlsqlItem.PRODUCT_VALUE := aSqlItem.PRODUCT_VALUE;
aPlsqlItem.PRODUCT_DESC := aSqlItem.PRODUCT_DESC;
aPlsqlItem.UOM := aSqlItem.UOM;
aPlsqlItem.PRIMARY := aSqlItem.PRIMARY;
aPlsqlItem.VALUE := aSqlItem.VALUE;
aPlsqlItem.EFFECTIVE_FROM := aSqlItem.EFFECTIVE_FROM;
aPlsqlItem.EFFECTIVE_TO := aSqlItem.EFFECTIVE_TO;
aPlsqlItem.PROCESS_FLAG := aSqlItem.PROCESS_FLAG;
aPlsqlItem.CREATED_BY := aSqlItem.CREATED_BY;
aPlsqlItem.CREATION_DATE := aSqlItem.CREATION_DATE;
aPlsqlItem.LAST_UPDATED_BY := aSqlItem.LAST_UPDATED_BY;
aPlsqlItem.LAST_UPDATE_DATE := aSqlItem.LAST_UPDATE_DATE;
aPlsqlItem.LAST_UPDATE_LOGIN := aSqlItem.LAST_UPDATE_LOGIN;
aPlsqlItem.PRICE_LIST_ID := aSqlItem.PRICE_LIST_ID;
RETURN aPlsqlItem;
END SQL_TO_PL3;
FUNCTION PL_TO_SQL0(aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_TAB)
RETURN EBS_SOA_PRICELISX1199385X1X1 IS
aSqlItem EBS_SOA_PRICELISX1199385X1X1;
BEGIN
-- initialize the table
aSqlItem := EBS_SOA_PRICELISX1199385X1X1();
IF aPlsqlItem IS NOT NULL THEN
aSqlItem.EXTEND(aPlsqlItem.COUNT);
IF aPlsqlItem.COUNT>0 THEN
FOR I IN aPlsqlItem.FIRST..aPlsqlItem.LAST LOOP
aSqlItem(I + 1 - aPlsqlItem.FIRST) := PL_TO_SQL3(aPlsqlItem(I));
END LOOP;
END IF;
END IF;
RETURN aSqlItem;
END PL_TO_SQL0;
FUNCTION SQL_TO_PL0(aSqlItem EBS_SOA_PRICELISX1199385X1X1)
RETURN APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_TAB IS
aPlsqlItem APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_TAB;
BEGIN
aPlsqlItem := EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_TAB();
aPlsqlItem.EXTEND(aSqlItem.COUNT);
IF aSqlItem.COUNT>0 THEN
FOR I IN 1..aSqlItem.COUNT LOOP
aPlsqlItem(I) := SQL_TO_PL3(aSqlItem(I));
END LOOP;
END IF;
RETURN aPlsqlItem;
END SQL_TO_PL0;
PROCEDURE ebs_soa_pricelist_pkg$ebs_soa (EBS_PRICELISTLINES OUT EBS_SOA_PRICELISX1199385X1X1,
EBS_PRICELISTHEADERS OUT EBS_SOA_PRICELIX1199385X1X19
) IS
EBS_PRICELISTLINES_ APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTLINE_TAB;
EBS_PRICELISTHEADERS_ APPS.EBS_SOA_PRICELIST_PKG.EBS_PRICELISTHEADER_TAB;
BEGIN
APPS.EBS_SOA_PRICELIST_PKG.EBS_SOA_PRICELISTS_PRC(EBS_PRICELISTLINES_,
EBS_PRICELISTHEADERS_
EBS_PRICELISTLINES := WRAPPER_EBSPRICELISTSPRCDATA.PL_TO_SQL0(EBS_PRICELISTLINES_);
EBS_PRICELISTHEADERS := WRAPPER_EBSPRICELISTSPRCDATA.PL_TO_SQL1(EBS_PRICELISTHEADERS_);
END ebs_soa_pricelist_pkg$ebs_soa;
END WRAPPER_EBSPRICELISTSPRCDATA;
Similar Messages
-
Problems with PL/SQL packages
Hello,
I face the following problem with PL/SQL stored procedures. The Oracle
version is 8.0.5 on Windows NT 4. The PL/SQL package has a set of procedures and functions.
The main procedure of the PL/SQL package is triggered from VC++ executable. If for some reason,
an exception is caught in the stored procedure (like no_data_found
exception), then the following problem occurs.
If we try to trigger the stored procedure again through the VC++ executable,
the variables in the stored procedures have the values as in the previous
execution. They are not getting initialised. (The same database connection
is used in VC++ executable).
Currently, only if a new connection to the database is used , the problem is
solved.
Also, change in the input parameters of the procedure is not reflected, once the procedure fails because of any exception. Only the input which was given during the time of execution when the procedure failed,is considered.
What could be the reason for this problem and how can this be corrected?
Please send in your suggestions.
Thanks and Regards,
Ramya Priya
nullHi Keith,
I am connecting to the database as the package owner..
I have noticed earlier that I have problems when capturing triggers also.. The content of one large trigger contains 36371 characters and when capturing it from DB, the content was truncated to 28020 characters in Designer.
Our ideas with capturing the DB packages/procedures were to use the Designer as version control system.
We wanted to have all objects used in a project in Designer.. entities, tables, triggers, packages, procedures, Forms files, etc. in order to make a configuration for a project release.
Thank you,
Claudia -
Problem with pl/sql package
hi,
i have requirement where i have to create a PL/SQL package which takes two parameters from procedure where i shd give fromdate and todate as parameter below is the code i am getting two errors
create or replace PACKAGE AgentTimeReport_XDO_pkg AS
PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
,o_retcode OUT VARCHAR2,p_fromdate IN VARCHAR2,p_todate IN VARCHAR2 );
END AgentTimeReport_XDO_pkg
CREATE OR REPLACE
PACKAGE BODY AGENTTIMEREPORT_XDO_PKG AS
PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
,o_retcode OUT VARCHAR2,p_fromdate IN
VARCHAR2,p_todate IN VARCHAR2 ) AS
cursor cs_agenttime
is
SELECT
incident.Incident_Number as ServiceRequestNumber,
TO_CHAR (incident.incident_date,'DD-MON-YYYY') as ServiceRequestDate,
incident.Summary as Summary,
agenttime.agentname as AgentName,
to_char(agenttime.agentstarttime,'DD-MM-YYYY HH24:MI') as StartTime,
to_char(to_date('00:00:00','HH24:MI:SS') +
(agenttime.endtime-agenttime.agentstarttime), 'HH24:MI') as TimeSpent
FROM cs_incidents_all_b incident,cs_agenttime_agv agenttime
WHERE agenttime.incident_id=incident.incident_id
AND incident.incident_date between to_date(:p_fromdate,'DD-MON-YYYY')
AND to_date(:p_todate,'DD-MON-YYYY');
BEGIN
/*First line of XML data should be ‘<?xml version="1.0" encoding='utf-8'?>’*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="utf-8"?>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AGENTTIME>');
FOR cs_agent IN cs_agenttime
LOOP
/*For each record create a group tag <G_AGENT_TIME> at the start*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_AGENT_TIME>');
/*Embed data between XML tags for ex:- <EMP_NAME>Abeesh</EMP_NAME>*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_NUMBER>' ||
cs_agent.ServiceRequestNumber
|| '</SERVICEREQUEST_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_DATE>' ||
cs_agent.ServiceRequestDate ||
'</SERVICEREQUEST_DATE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<START_TIME>' || cs_agent.StartTime
||'</START_TIME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<TIME_SPENT>' || cs_agent.TimeSpent
||'</TIME_SPENT>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_AGENT_TIME>');
END LOOP;
/*Finally Close the starting Report tag*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</AGENTTIME>');
END AgentTimeReport_Demo_RTF;
END AGENTTIMEREPORT_XDO_PKG;
Error(20,44): PLS-00049: bad bind variable 'P_FROMDATE'
Error(21,13): PLS-00049: bad bind variable 'P_TODATE'
Help me out
naveencreate or replace PACKAGE AgentTimeReport_XDO_pkg AS
PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
,o_retcode OUT VARCHAR2,p_fromdate IN VARCHAR2,p_todate IN VARCHAR2 );
END AgentTimeReport_XDO_pkg
CREATE OR REPLACE
PACKAGE BODY AGENTTIMEREPORT_XDO_PKG
AS
PROCEDURE AgentTimeReport_Demo_RTF
o_errbuf OUT VARCHAR2 ,
o_retcode OUT VARCHAR2,
p_fromdate IN VARCHAR2,
p_todate IN VARCHAR2 )
AS
CURSOR cs_agenttime(p_fromdate VARCHAR2,p_todate VARCHAR2)
IS
SELECT incident.Incident_Number AS ServiceRequestNumber,
TO_CHAR (incident.incident_date,'DD-MON-YYYY') AS ServiceRequestDate ,
incident.Summary AS Summary ,
agenttime.agentname AS AgentName ,
TO_CHAR(agenttime.agentstarttime,'DD-MM-YYYY HH24:MI') AS StartTime ,
TO_CHAR(to_date('00:00:00','HH24:MI:SS') + (agenttime.endtime-agenttime.agentstarttime), 'HH24:MI') AS TimeSpent
FROM cs_incidents_all_b incident,
cs_agenttime_agv agenttime
WHERE agenttime.incident_id=incident.incident_id
AND incident.incident_date BETWEEN to_date(p_fromdate,'DD-MON-YYYY') AND to_date(p_todate,'DD-MON-YYYY');
BEGIN
/*First line of XML data should be ‘<?xml version="1.0" encoding='utf-8'?>’*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="utf-8"?>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AGENTTIME>');
FOR cs_agent IN cs_agenttime(p_fromdate,p_todate)
LOOP
/*For each record create a group tag <G_AGENT_TIME> at the start*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_AGENT_TIME>');
/*Embed data between XML tags for ex:- <EMP_NAME>Abeesh</EMP_NAME>*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_NUMBER>' || cs_agent.ServiceRequestNumber '</SERVICEREQUEST_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_DATE>' cs_agent.ServiceRequestDate || '</SERVICEREQUEST_DATE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<START_TIME>' || cs_agent.StartTime ||'</START_TIME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<TIME_SPENT>' || cs_agent.TimeSpent ||'</TIME_SPENT>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_AGENT_TIME>');
END LOOP;
/*Finally Close the starting Report tag*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</AGENTTIME>');
END AgentTimeReport_Demo_RTF;
END AGENTTIMEREPORT_XDO_PKG;Ravi Kumar -
(URGENT)Problem in PL/SQL package with date.
Hi,
When I am running this query
"SELECT a.street_addr address, a.mailing_city_name city,
d.pa_cust_name county, a.zip_cd zip,
a.last_update_dt lastdate, a.status_cd status
FROM CWT003_PEND_ADDR a,
CWT004_ACTVITY_LOG b,
CWT005_PUBLIC_AUTH c,
CWT005_PUBLIC_AUTH d
WHERE a.address_id = b.address_id(+)
AND a.city_cust_num = c.pa_cust_num(+)
AND c.parent_pa_num = d.pa_cust_num(+)
AND (b.action_flag = 'A' OR b.action_flag = 'I')
AND b.user_prof_id = NVL(NULL,b.user_prof_id)
AND ( NVL (TO_DATE('01-oct-2006'),
TO_DATE ('1-1-1900', 'MM-DD-YYYY')) =
TO_DATE ('1-1-1900', 'MM-DD-YYYY')
OR b.activity_tstmp >= TO_DATE('01-oct-2006')
AND ( NVL (TO_DATE('01-nov-2006'),
TO_DATE ('1-1-1900', 'MM-DD-YYYY')
) = TO_DATE ('1-1-1900', 'MM-DD-YYYY')
OR b.activity_tstmp <= TO_DATE('01-nov-2006')
AND ( NVL (NULL, -1) = -1
OR a.district_no = ''
AND a.city_cust_num IN (SELECT pa_cust_num
FROM CWT005_PUBLIC_AUTH Y
WHERE NVL(Y.parent_pa_num,-1) =
NVL(NULL,NVL(Y.parent_pa_num,-1)))
AND NVL(a.city_cust_num,-1) = NVL(NULL,NVL(a.CITY_CUST_NUM,-1))"
I am getting the desired o/p.
But when I call the following package;
CREATE OR REPLACE PACKAGE Test_Pkg_Dip
AS
PROCEDURE test_proc;
END Test_Pkg_Dip;
CREATE OR REPLACE PACKAGE BODY Test_Pkg_Dip
AS
PROCEDURE test_proc
IS
l_report_req_date CWT009_REPORT_RQST.report_req_dt%TYPE;
l_report_type CWT009_REPORT_RQST.report_type%TYPE;
l_req_user_prof_id CWT009_REPORT_RQST.req_user_prof_id%TYPE;
l_rqst_city_num CWT009_REPORT_RQST.rqst_city_num%TYPE;
l_rqst_county_num CWT009_REPORT_RQST.rqst_county_num%TYPE;
l_rqst_from_dt VARCHAR2 (50);
l_rqst_org_num CWT009_REPORT_RQST.rqst_org_num%TYPE;
l_rqst_to_dt VARCHAR2 (50);
l_rqst_user_prof_id CWT009_REPORT_RQST.rqst_user_prof_id%TYPE;
l_city_cust_num CWT002_USR_CTY_REL.city_cust_num%TYPE;
l_count NUMBER := 0;
l_address CWT003_PEND_ADDR.street_addr%TYPE;
l_city CWT003_PEND_ADDR.mailing_city_name%TYPE;
l_county CWT005_PUBLIC_AUTH.pa_cust_name%TYPE;
l_zip CWT003_PEND_ADDR.zip_cd%TYPE;
l_last_worked_date CWT003_PEND_ADDR.last_update_dt%TYPE;
l_status CWT003_PEND_ADDR.status_cd%TYPE;
CURSOR cur_report_entries
IS
SELECT a.report_req_dt, a.report_type, a.req_user_prof_id,
a.rqst_city_num, a.rqst_county_num,
TO_CHAR (a.rqst_from_dt, 'DD-MON-YYYY'), a.rqst_org_num,
TO_CHAR (a.rqst_to_dt, 'DD-MON-YYYY'), a.rqst_user_prof_id
FROM (SELECT x.report_req_dt, x.report_type, x.req_user_prof_id,
x.rqst_city_num, x.rqst_county_num, x.rqst_from_dt,
x.rqst_org_num, x.rqst_to_dt, x.rqst_user_prof_id
FROM CWT009_REPORT_RQST x
ORDER BY report_type) a
WHERE ROWNUM <= 1;
CURSOR test_cur
IS
SELECT a.street_addr address, a.mailing_city_name city,
d.pa_cust_name county, a.zip_cd zip,
a.last_update_dt lastdate, a.status_cd status
FROM CWT003_PEND_ADDR a,
CWT004_ACTVITY_LOG b,
CWT005_PUBLIC_AUTH c,
CWT005_PUBLIC_AUTH d
WHERE a.address_id = b.address_id(+)
AND a.city_cust_num = c.pa_cust_num(+)
AND c.parent_pa_num = d.pa_cust_num(+)
AND (b.action_flag = 'A' OR b.action_flag = 'I')
AND b.user_prof_id = NVL (l_rqst_user_prof_id, b.user_prof_id)
AND ( NVL (TO_DATE (l_rqst_from_dt, 'DD-MON-YYYY'),
TO_DATE ('01-JAN-1900', 'DD-MON-YYYY')
) = TO_DATE ('01-JAN-1900', 'DD-MON-YYYY')
OR b.activity_tstmp >=
TO_DATE (l_rqst_from_dt, 'DD-MON-YYYY')
AND ( NVL (TO_DATE (l_rqst_to_dt, 'DD-MON-YYYY'),
TO_DATE ('01-JAN-1900', 'DD-MON-YYYY')
) = TO_DATE ('01-JAN-1900', 'DD-MON-YYYY')
OR b.activity_tstmp <=
TO_DATE (l_rqst_to_dt, 'DD-MON-YYYY')
AND (NVL (l_rqst_org_num, -1) = -1
OR a.district_no = l_rqst_org_num
AND a.city_cust_num IN (
SELECT pa_cust_num
FROM CWT005_PUBLIC_AUTH y
WHERE NVL (y.parent_pa_num, -1) =
NVL (l_rqst_county_num, NVL (y.parent_pa_num, -1)))
AND NVL (a.city_cust_num, -1) =
NVL (l_rqst_city_num, NVL (a.city_cust_num, -1));
BEGIN
DBMS_OUTPUT.put_line ('11111' || CHR (10));
OPEN cur_report_entries;
FETCH cur_report_entries
INTO l_report_req_date, l_report_type, l_req_user_prof_id,
l_rqst_city_num, l_rqst_county_num, l_rqst_from_dt,
l_rqst_org_num, l_rqst_to_dt, l_rqst_user_prof_id;
CLOSE cur_report_entries;
DBMS_OUTPUT.put_line ( l_req_user_prof_id
|| '---'
|| l_report_req_date
|| '---'
|| l_report_type
|| '---'
|| l_rqst_user_prof_id
|| '---'
|| l_rqst_from_dt
|| '---'
|| l_rqst_to_dt
|| '---'
|| l_rqst_org_num
|| '---'
|| l_rqst_city_num
|| '---'
|| l_rqst_county_num
DBMS_OUTPUT.put_line
|| CHR (10)
IF l_rqst_city_num = 0
THEN
l_rqst_city_num := NULL;
END IF;
IF l_rqst_county_num = 0
THEN
l_rqst_county_num := NULL;
END IF;
IF l_rqst_user_prof_id = 0
THEN
l_rqst_user_prof_id := NULL;
END IF;
--l_rqst_from_dt := NULL;
--l_rqst_to_dt := NULL;
l_count := l_count + 1;
--FOR rec1 IN test_cur
OPEN test_cur;
LOOP
BEGIN
FETCH test_cur
INTO l_address, l_city, l_county, l_zip, l_last_worked_date,
l_status;
EXIT WHEN test_cur%NOTFOUND;
DBMS_OUTPUT.put_line
|| l_count
|| ' ] street_addr::'
|| l_address
|| CHR (10)
|| 'mailing_city_name::'
|| l_city
|| CHR (10)
|| 'pa_cust_name::'
|| l_county
|| CHR (10)
|| 'zip_cd::'
|| l_zip
|| CHR (10)
|| 'last_update_dt::'
|| l_last_worked_date
|| CHR (10)
|| 'status_cd::'
|| l_status
|| CHR (10)
|| '-------------------------------------------------------------------------------------------'
|| CHR (10)
l_count := l_count + 1;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( 'Inside Error::'
|| SQLCODE
|| '------'
|| SQLERRM
END;
END LOOP;
CLOSE test_cur;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error::' || SQLCODE || '------' || SQLERRM);
END test_proc;
END Test_Pkg_Dip;
as
BEGIN
Test_Pkg_Dip.test_proc;
END;
I do not get any output. And also if I remove the date comparison from the query it works.
Thanks & regards,
Dipankar Kushari.Yeh.
But the real error was "ERROR:
ORA-06502: PL/SQL: numeric or value error: host bind array too small
ORA-06512: at line 1"
I found that it was coming due to more than 255 characters in a single line in dbms_output.put_line.
Anyway, thanks for the answer.
Dipankar. -
Problem in generate Java from PL SQL package in Jdeveloper
Hi
i have problem in create java class from PL SQL package in JDeveloper.
I use Database navigator of jdeveloper and right click on a package and choose Generate Java then in Jpublisher window choose my view Controller and accept other default values.
I call methods of generated class in the Action of a button in my JSP page, but when I click the button it throw null pointer exception !!! i fund one of generated method return null and it lead to this exception.
protected DefaultContext __tx = null;
public DefaultContext getConnectionContext() throws SQLException {
if (__tx==null){
__tx = (getConnection()==null) ? DefaultContext.getDefaultContext() : new DefaultContext(getConnection());
return __tx;
public Connection getConnection() throws SQLException
if (__onn!=null) return __onn;
else if (__tx!=null) return __tx.getConnection();
else if (__dataSource!=null) __onn= __dataSource.getConnection();
return __onn;
i try to generate class in Model project and create DataControl for that and use method action but noting change and i get null pointer again!!
Jdeveloper Versino = 11.1.1.7.0Let me ask you another question: Why do you generate java from the package at all?
Where do you want to call the package?
Back to your question: you should see code like
public void setDataSourceLocation(String dataSourceLocation) throws SQLException {
javax.sql.DataSource dataSource;
try {
Class cls = Class.forName("javax.naming.InitialContext");
Object ctx = cls.newInstance();
java.lang.reflect.Method meth = cls.getMethod("lookup", new Class[] { String.class });
dataSource = (javax.sql.DataSource) meth.invoke(ctx, new Object[] { "java:comp/env/" + dataSourceLocation });
setDataSource(dataSource);
} catch (Exception e) {
throw new java.sql.SQLException("Error initializing DataSource at " + dataSourceLocation + ": " + e.getMessage());
in the generated code. This code look up a datasource (which you have defined e.g. on the Weblogic Server) by calling the method
setDataSourceLocaltion("jdbc/HRConnDS");
This look up the datasource nad stores it in the class variable.
Timo -
Designer 9.0.2.7 - problems with capturing PL/SQL packages
Hello,
I would appreciate any help regarding the following issue:
We tried to capture in Designer 9.0.2.7 the existing PL/SQL packages from an Oracle 9i database and we have met some problems.
Even the package has a body containing two public procedures, when capturing, the Designer generates warnings that say the PL/SQL package body is empty. Therefore, the Designer capture the body content and write it in the PL/SQL Block of the PL/SQL Definition property, but the content of the body is preceded with the " character.
This makes problem when generating the "ddl" for the package (the package is not created correctly in the DB).
In addition, when generating the "ddl", the "END package_name" is added twice.
Other problem is that the package specification information from Designer is just "END package_name;"
For some of the packages containing only a list of public procedures, without any other variables declarations, the Designer does not capture these procedures as separate subprograms in the package definition, as it does other times. In this case, the package body is entirely captured in the PL/SQL Block and with the " character before content.
Is it some settings that can be done or some rules about the format of the PL/SQL procedures in order for Designer to capture all packages in same manner and correctly?
Thank you,
ClaudiaHi Keith,
I am connecting to the database as the package owner..
I have noticed earlier that I have problems when capturing triggers also.. The content of one large trigger contains 36371 characters and when capturing it from DB, the content was truncated to 28020 characters in Designer.
Our ideas with capturing the DB packages/procedures were to use the Designer as version control system.
We wanted to have all objects used in a project in Designer.. entities, tables, triggers, packages, procedures, Forms files, etc. in order to make a configuration for a project release.
Thank you,
Claudia -
Problem with procedure in package
Problem with procedure in package:
create table accounts
(acno number(10),
name varchar2(20),
balance number(10,2));
create package banking is
procedure new_acct(acno NUMBER, name IN VARCHAR);
procedure acct_dep(acno IN NUMBER, amount IN NUMBER);
procedure acc_wdr(acno IN NUMBER, amount IN NUMBER);
procedure acc_bal(acno IN NUMBER, bal OUT NUMBER);
function acc_drwn(acno IN NUMBER) RETURN BOOLEAN;
end banking;
create or replace package body banking is
procedure new_acct ( acno IN number,
name IN varchar) is
begin
insert into accounts
(acno, name, balance)
values
(acno, name,0);
end;
procedure acct_dep(acno IN NUMBER,
amount IN NUMBER) is
begin
update accounts
set balance = balance + amount
where acno = acno;
end;
procedure acc_wdr(acno IN NUMBER,
amount IN NUMBER) is
begin
update accounts
set balance = balance - amount
where acno = acno;
end;
procedure acc_bal(acno IN NUMBER,
bal OUT NUMBER) is
begin
declare cursor c_balance(i_acno IN accounts.acno%type) is
select balance
from accounts
where acno = i_acno;
acc_bal accounts.balance%type;
begin
if c_balance%isopen then
close c_balance;
end if;
open c_balance(acno);
fetch c_balance into acc_bal;
close c_balance;
end;
end;
function acc_drwn(acno IN NUMBER) RETURN BOOLEAN is
begin
declare cursor c_balance(i_acno IN accounts.acno%type) is
select balance
from accounts
where acno = i_acno;
bal accounts.balance%type;
begin
if c_balance%isopen then
close c_balance;
end if;
open c_balance(acno);
fetch c_balance into bal;
close c_balance;
if bal < 0 then
return true;
else
return false;
end if;
end;
end;
end banking;
begin
banking.new_acct(123,'FRANKS');
end;
execute banking.acct_dep(123,100);
execute banking.acc_wdr(123,50);
Works fine up to this point, however when running the balance check the balance amount is not visible?
SQL> set serveroutput on
SQL> begin
2 declare
3 bal accounts.balance%type;
4 begin
5 banking.acc_bal(123,bal);
6 dbms_output.put_line('Franks balance is '||bal);
7 end;
8 end;
9 /procedure acc_bal(acno IN NUMBER,
bal OUT NUMBER)
is
cursor c_balance(i_acno IN accounts.acno%type) is
select balance
from accounts
where acno = i_acno;
l_acc_bal accounts.balance%type;
begin
open c_balance(acno);
fetch c_balance into l_acc_bal;
close c_balance;
bal := l_acc_bal;
end; -
Hello,
The problem I am confronted with is reusing generated models.
In the process of DataMinig several steps are used: prepare data, Attribute selection (using AI), and building, testing and applying models.
If PL/SQL packages are used two problems occur:
First: Long, hand driven process of building:
Model generation in ODM,
PL/SQL package building in ODM and Export to SQL file,
importing package to DB, compiling and running.
I am sorry, but I don't understand why is it necessary to export PL/SQL packages in a file? As if these products aren't both Oracle products?
Second: If data (in time) changes and AI selects new attributes, then all next steps fail, since column names, and even some values, are hard coded! Therefore it is necessary to go trough the build and export process all over again. This really hurts.
Do you have a suggestion how to get around this problem?
I already considered using a SPSS Clementine, but since it is not an Oracle product I still believe, the original Oracle solution should give me some advantages.
Oh and another issue.
I tried using PL/SQL generator (Ver.: 10.1.3.0.17) in JDeveloper (ver.: 10.1.3.0.4), but it gave me an error:
java.lang.NoClassDefFoundError: oracle/dmt/dm4j/DM4JConnectionManager
at oracle.dmt.dm4j.extension.CodeGenerator.invoke(Unknown Source)
at oracle.ide.wizard.WizardManager.invokeWizard(WizardManager.java:310)
at oracle.ide.wizard.WizardManager$2.run(WizardManager.java:358)
at oracle.ide.util.IdeUtil.invokeAfterRepaint(IdeUtil.java:1093)
at oracle.ide.wizard.WizardManager$1.run(WizardManager.java:366)
at oracle.ide.util.IdeUtil$1$1.run(IdeUtil.java:1073)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Thanks for the reply,
IgorHi,
The code generation available in ODMr would allow you to deploy the build, apply or test process as generated code.
I am not sure what your application goal is, but if you simply want to deploy a model be used in an apply process that is rather straight forward.
You would build the model using ODMr. Then create an Apply Activity, again using ODMr.
The Apply Activity can then be used to generate code (pl/sql) using the JDev RTM release (10.1.3.2 or above). We will also have a version that will work with SQLDev shortly.
The generated code is immediately placed into the db for you.
If you want to score in a separate db you can either create a db link from that db or move both the model and the apply pl/sql code to the new db (using dba utilities).
If you want to rebuild a model, where you would add/remove attributes, change transformations etc. then you will have to regenerate the code.
If you simply want to rebuild the model without changing any transformations and settings you could also deploy the model build generated code.
As for the JDev failure, we are going to look into that. Have you tried the JDev 10.1.3.3 release available on the Oracle web site?
Thanks, Mark -
How to get changes of a custom PL/SQL package updated in ISG?
Hi All,
I need some help on how to change a custom PL/SQL package in ISG integration repository:
I already uploaded my custom PL/SQL package to the integration repositoy some time ago. Now I have made some changes to PL/SQL record/table types defined in the package (added some fields and removed some others). These changed record/table types are used by a procedure I already uploaded to the integration repository. When regenerating the WSDL for my PL/SQL package in integration repository I get an error that the wrapper for respective procedure can't be found. When checking up the SQL types that were automatically generated (by JPublisher) for corresponding PL/SQL types, these generated SQL types are invalid...
So it seems that in one case JPublisher generated an empty SQL type (with no attributes). In another case JPublisher generated the SQL type with old attribute list, so it didn't adopt the changes of corresponding PL/SQL type in the package...
Can anybody tell me how to get the changes of a cusotm PL/SQL package updated in ISG? Or is there any possibility to first remove a whole PL/SQL package from the ISG integration repository (and getting rid of all old automatically generated SQL types), so that I can newly upload my PL/SQL package afterwards?
Thanks
Konrad
Edited by: Konrad on 24.10.2011 10:51Thanks Daniel, for your reply...
(-> for info: I'm a colleague of Konrad...)
Yes, we used a higher version number - and the upload of iLDT file works fine...
But, the problem occured when generating the WSDL...
However, I think we have found an approach of how to get the changes of a custom PL/SQL package updated correctly in ISG:
1. Save a copy of PL/SQL package and then delete it in the database
2. Regenerate the WSDL for PL/SQL package in ISG (seems that all atutomatically generated JPub wrappers and SQL types are also deleted)
3. Restart all processes
4. Create the changed version of PL/SQL package in the database again
5. upload of iLDT
6. Regenerate the WSDL for PL/SQL package in ISG
Best Regards
Carolin -
Error when publishing a PL/SQL package as a Webservice
Hi all,
I am using the JDeveloper (10.1.3.1.0) to publish a PL/SQL package as a Webservice, and I am having some troubles on the generation process.
The problem that I am facing is on the generated code for the database side, where some methods have a “$GET_” at the end of its name.
This “$GET_” is handled by the database as a special word, and the package can’t be compiled.
If the ‘$’ character is removed from all the methods, the package can be compiled and the Webservice works fine.
What’s wrong? Is there a bug on the generation process of the JDeveloper?
Regards,
Rui TorresOK, This is the PL/SQL package:
Function:
FUNCTION Obtener_paises RETURN res_webservice AS
v_respuesta res_webservice;
i PLS_INTEGER:=1;
CURSOR C_paises IS
SELECT cpais, tpais
FROM paises
ORDER BY tpais;
BEGIN
v_respuesta := res_webservice(null,null);
v_respuesta.error := res_error(null,null,null);
v_respuesta.error.cerror := 0;
v_respuesta.error.cerror_ora := 0;
v_respuesta.error.terror := null;
v_respuesta.datos := res_datos ();
FOR v_pais IN C_paises LOOP
v_respuesta.datos.extend;
v_respuesta.datos(i) := reg_datos(null,null);
v_respuesta.datos(i).codigo := v_pais.cpais;
v_respuesta.datos(i).descripcion := v_pais.tpais;
i := i + 1;
END LOOP;
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
RETURN v_respuesta;
EXCEPTION
WHEN OTHERS THEN
v_respuesta.error.cerror := 1;
v_respuesta.error.cerror_ora := SQLCODE;
v_respuesta.error.terror := substr(SQLERRM,1,80);
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
RETURN v_respuesta;
END Obtener_paises;
TYPES USED:
CREATE OR REPLACE
TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
CREATE OR REPLACE
TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
CREATE OR REPLACE
TYPE res_datos AS TABLE OF reg_datos;
CREATE OR REPLACE
TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
Thanks in advanced...
Could happen this bacause of these defined types??? -
Can't register a database in RMAN catalog (PL/SQL package not current)
Hi RMAN experts. I'm trying to register a 10.2.0.1.0 database into a 10.2.0.5.0 RMAN catalog but I get the following error (Note: following was done on the rman server machine, ORACLE_SID=rman, target database is remote)
$ rman catalog rman/rman target sys@MPOWER
Recovery Manager: Release 10.2.0.5.0 - Production on Sat Apr 30 12:54:16 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
PL/SQL package SYS.DBMS_BACKUP_RESTORE version 10.02.00.00 in TARGET database is not current
PL/SQL package SYS.DBMS_RCVMAN version 10.02.00.00 in TARGET database is not current
connected to target database: MPOWER (DBID=**********)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
RMAN-00571: ===============
RMAN-00569: =========ERROR MESSAGE STACK FOLLOWS
RMAN-00571: =================
RMAN-03008: error while performing automatic resync of recovery catalog
ORA-00904: : invalid identifier
Basically the error says that there are two packages in the TARGET database (SYS.DBMS_BACKUP_RESTORE and SYS.DBMS_RCVMAN) which are not compatible with the RMAN catalog.
I cannot register the target database into the RMAN catalog.
I highly appretiate if you give me an advice on this.
Regardsuser13064912 wrote:
Hi RMAN experts. I'm trying to register a 10.2.0.1.0 database into a 10.2.0.5.0 RMAN catalog but I get the following error (Note: following was done on the rman server machine, ORACLE_SID=rman, target database is remote)
$ rman catalog rman/rman target sys@MPOWER
Recovery Manager: Release 10.2.0.5.0 - Production on Sat Apr 30 12:54:16 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
PL/SQL package SYS.DBMS_BACKUP_RESTORE version 10.02.00.00 in TARGET database is not current
PL/SQL package SYS.DBMS_RCVMAN version 10.02.00.00 in TARGET database is not current
connected to target database: MPOWER (DBID=**********)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
RMAN-00571: ===============
RMAN-00569: =========ERROR MESSAGE STACK FOLLOWS
RMAN-00571: =================
RMAN-03008: error while performing automatic resync of recovery catalog
ORA-00904: : invalid identifier
Basically the error says that there are two packages in the TARGET database (SYS.DBMS_BACKUP_RESTORE and SYS.DBMS_RCVMAN) which are not compatible with the RMAN catalog.
I cannot register the target database into the RMAN catalog.
I highly appretiate if you give me an advice on this.
RegardsCould you try to run the rman at the target database server (MPOWER), instead of rman catalog server ant try to register your database?
Your rman client is higher than your target server. That could be the problem.
Best Regards,
Gokhan
If this question is answered, please mark appropriate posts as correct/helpful and the thread as closed. Thanks -
How to avoid performance problems in PL/SQL?
How to avoid performance problems in PL/SQL?
As per my knowledge, below some points to avoid performance proble in PL/SQL.
Is there other point to avoid performance problems?
1. Use FORALL instead of FOR, and use BULK COLLECT to avoid looping many times.
2. EXECUTE IMMEDIATE is faster than DBMS_SQL
3. Use NOCOPY for OUT and IN OUT if the original value need not be retained. Overhead of keeping a copy of OUT is avoided.Susil Kumar Nagarajan wrote:
1. Group no of functions or procedures into a PACKAGEPutting related functions and procedures into packages is useful from a code organization standpoint. It has nothing whatsoever to do with performance.
2. Good to use collections in place of cursors that do DML operations on large set of recordsBut using SQL is more efficient than using PL/SQL with bulk collects.
4. Optimize SQL statements if they need to
-> Avoid using IN, NOT IN conditions or those cause full table scans in queriesThat is not true.
-> See to queries they use Indexes properly , sometimes Leading index column is missed out that cause performance overheadAssuming "properly" implies that it is entirely possible that a table scan is more efficient than using an index.
5. use Oracle HINTS if query can't be further tuned and hints can considerably help youHints should be used only as a last resort. It is almost certainly the case that if you can use a hint that forces a particular plan to improve performance that there is some problem in the underlying statistics that should be fixed in order to resolve issues with many queries rather than just the one you're looking at.
Justin -
JS Validation for Drop down List is not working in Oracle PL/SQL Package
Hi All,
I am facing an issue with JavaScript validation done in Oracle PL SQL package.
System Requirement:
There is one screen which contains two fields viz. FLD 1 & FLD 2 and one 'Submit' button.
FLD 1 and FLD 2 fields are drop down list boxes.These are mandatory fields.
The screen is developed in Oracle Mod PL SQL package.
The html coding and java scripting are embedded in the respective Oracle PL SQL Package procedure which generates this screen,takes the input values provided by user,does the
field validations and submits the form.
Issue:
The javascript validation for FLD 2 dropdown is working successfully.
When the user leaves this field as blank,the embedded javascript pops up an error message 'Selection of FLD 2 is manadatory before submitting the form!'.
As FLD 1 is also a mandatory field,the javascripting validation should pop up the similar error message 'Selection of FLD 1 is manadatory before submitting the form!'.
But,this first field validation is not at all working.
The system allows to submit the form even if the 'FLD 1' is left blank.
The javascript code sysntax for validation of FLD 1 & FLD 2 drop down list boxes as follows:
function validate_form_fields()
if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
[0].p_fld_1.selectedIndex < 1 )
alert("Selection of FLD 1 is manadatory before submitting the form!!!");
return false;
else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
[0].p_fld_2.selectedIndex < 1 )
alert("Selection of FLD 2 is manadatory before submitting the form!!!");
return false;
return true;
I am viewing the screen from the web browser IE version 8.0.
Your timely help will really be appreciated.
Regards & Thanking in advance,
AlkaHi,
1. Your problem is actually related to JavaScript, not SQL and PL/SQL. So, this is the wrong forum to post. The closest to JS is the Application Express forum {forum:id=137}. Clearly state that it is not an Apex issue and that you are looking for JS help.
2. Your JS code, the way you has posted it, is syntactically incorrect, so if you post on Apex forum put the correct code and in tags as described in the FAQ
{quote}
function validate_form_fields()
if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
[0].p_fld_1.selectedIndex < 1 )
alert("Selection of FLD 1 is manadatory before submitting the form!!!");
return false;
else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
[0].p_fld_2.selectedIndex < 1 )
alert("Selection of FLD 2 is manadatory before submitting the form!!!");
return false;
return true;
{quote}
Regards, -
Problem getting pl/sql return value
Hi,
I'm using JDeveloper 10.1.2 to generate web service from pl/sql package. But the return value is always zero.
The function is as follows:-
FUNCTION GET_LIMIT ( v1 IN NUMBER, v2 IN NUMBER)
RETURN NUMBER IS
v_result_nr NUMBER;
BEGIN
v_result_nr := v1 * v2;
END;
RETURN v_result_nr;
END GET_LIMIT;
The result on webservices endpoint page:
.. - <ns1:getLimitResponse xmlns:ns1="http://com/test/webservices/LimitCheckWS.wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:decimal" xsi:nil="true" />
</ns1:getLimitResponse>
If i change the "RETURN v_result_nr" to "RETURN '1000.00'" and regenerate the web service, the return value as string is ok. The response is 1000.00 xsd:string.
Any idea why? Thx.Ok. problem solved. Setup 10g server using loadjava as per document "1.2.4.4 Verifying or Loading the dbwsclient.jar File". Thanks.
-
Host command in PL/SQL Package
Hi,
How is it possible to launch a host command from a PL/SQL package without Pro*C nor Java ?
Hope it's possible, 'cos Java is not available here and Pro*C has some^problems that the DBA cqn't solve...
Could you please answer at [email protected]
Thanks in advance !Hi Thomas,
You can call external progs within PlSql.
You have to
- Configure Tnsnames.ora aned listener.ora on the server
with the 'extproc' entry
- Have an external proc in a DDL on NT (or .so on unix)
- Create a libray pointing on this .so file with 'Create library'
- Declare a PlSql proc calling your external proc in the library
And then you will use your PlSql proc within your package.
It's fastidious but it works.
Mbo
Maybe you are looking for
-
How do i stop my programs from automatically popping up when i turn on the computer?
how do i stop my programs from automatically popping up when i turn on the computer?
-
Videos automatically playing next show
I use my iPad to watch full seasons of tv shows. In the past month, not exactly sure when, but when I finish a show the iPad is automatically going to the next video in the season and playing it. It used to go back to the list of videos and let me
-
ArchBuilder: building packages in chroot
ArchBuilder builds packages in chroots, like pbuilder does in debian. Usage: archbuilder command [options] Commands: init: Initializes archbuilder update: Updates archbuilder's caches build: Builds a package. shell: Starts a shell in a chroot Options
-
Why can't i get rid of the firefox4 application which is not compatible with my macbook?
downloaded firefox4 .. it is not compatible with my macbook OSX10.4 ... but the application box still remains and cannot be deleted ... every time i open firebox the first thing which pops up is the firefox4 application box ... once i click it into m
-
Expression Based Connection String Failing on Report Manager
Hello, i have this report, where i want it the language selection to be dynamic. And so implemented the below expression, to my surprise everything works fine on BIDS but when i deploy to report Manager it errors out! (report manager language is en-U