Notification with user defined type results in PLS-00306: wrong number..
I created a user defined type TLogMessage:
CREATE OR REPLACE TYPE TLogMessage AS OBJECT
module VARCHAR2(4000),
severity NUMBER,
message VARCHAR2(4000)
I also created a multi-consumer queue using this type as payload.
My callback procedure in the package PK_SYST_LOGMESSAGE is defined as follows:
PROCEDURE DefaultLoggerCallback(
context RAW,
reginfo SYS.AQ$_REG_INFO,
descr SYS.AQ$_DESCRIPTOR,
payload RAW,
payload1 NUMBER
Finally, I registered the callback procedure as follows:
DBMS_AQADM.ADD_SUBSCRIBER(
queue_name => QUEUE_NAME,
subscriber => SYS.AQ$_AGENT(
name => 'default_logger',
address => NULL,
protocol => NULL
DBMS_AQ.REGISTER(
SYS.AQ$_REG_INFO_LIST(
SYS.AQ$_REG_INFO(
name => QUEUE_NAME || ':default_logger',
namespace => DBMS_AQ.NAMESPACE_AQ,
callback => 'plsql://MTDX.PK_SYST_LOGMESSAGE.DefaultLoggerCallback',
context => HEXTORAW('FF')
1
However, when I put a message in the queue using this procedure:
PROCEDURE LogMessage(
pModule VARCHAR2,
pSeverity NUMBER,
pMessage VARCHAR2
IS
vMessage TLogMessage;
vEnqueueOptions DBMS_AQ.ENQUEUE_OPTIONS_T;
vMsgProperties DBMS_AQ.MESSAGE_PROPERTIES_T;
vMessageHandle RAW(16);
BEGIN
vMessage := TLogMessage(module => pModule, severity => pSeverity, message => pMessage);
vEnqueueOptions.visibility := DBMS_AQ.IMMEDIATE;
vMsgProperties.correlation := pModule;
vMsgProperties.priority := -pSeverity;
-- Enqueue the message to all subscribers
DBMS_AQ.ENQUEUE(
queue_name => QUEUE_NAME,
enqueue_options => vEnqueueOptions,
message_properties => vMsgProperties,
payload => vMessage,
msgid => vMessageHandle
EXCEPTION
WHEN no_subscribers THEN
-- No subscribers on the queue; ignore
NULL;
END;
I can see the message in the queue, by querying the queue view. I can also see that Oracle tried to call my callback procedure, because in the trace file I see the following:
*** 2009-02-13 08:52:25.000
*** ACTION NAME:() 2009-02-13 08:52:24.984
*** MODULE NAME:() 2009-02-13 08:52:24.984
*** SERVICE NAME:(SYS$USERS) 2009-02-13 08:52:24.984
*** SESSION ID:(609.3387) 2009-02-13 08:52:24.984
Error in PLSQL notification of msgid:4F7962FEDD3B41FA8D9538F0B38FCDD1
Queue :"MTDX"."LOGMESSAGE_QUEUE"
Consumer Name :DEFAULT_LOGGER
PLSQL function :MTDX.PK_SYST_LOGMESSAGE.DefaultLoggerCallback
: Exception Occured, Error msg:
ORA-00604: Fout opgetreden bij recursief SQL-niveau 2.
ORA-06550: Regel 1, kolom 7:
PLS-00306: Onjuist aantal of type argumenten in aanroep naar 'DEFAULTLOGGERCALLBACK'..
ORA-06550: Regel 1, kolom 7:
PL/SQL: Statement ignored.
So.. how many parameters does Oracle expect, and of what type? Is there any way to find out? What is wrong with my code?
Ok, found it... I had defined the last parameter of the callback procedure as 'payload1' (that is: 'payload-ONE') instead of 'payloadl' ('payload-ELL'). It all works like a charm now.
What a way to waste two whole days!
Similar Messages
-
I have written the following anonymous block. It has a cursor "cur_total_tckt" which select 6 columns. A nested table "total_tckt_colcn" is declared of type "cur_total_tckt". In the dbms_output.put_line I want to print each element of my collection. It is giving me the following error :
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 29, column 2:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
I want to print all the 6 columns of an element for 366 such elements.
DECLARE
CURSOR cur_total_tckt
is
select t.ticket_id ticket_id, t.created_date created_date, t.created_by created_by, t.ticket_status ticket_status,
t.last_changed last_changed, h.created_date closed_date
from n01.cc_ticket_info t
inner join n01.cc_ticket_status_history h
on (t.ticket_id = h.ticket_id)
where t.last_changed >= '6/28/2012 17:28:59' and t.last_changed < (sysdate + interval '1' day);
type total_tckt_colcn
is
TABLE OF cur_total_tckt%rowtype;
total_tckt_col total_tckt_colcn;
total_coach_col total_tckt_colcn;
begin
total_tckt_col := total_tckt_colcn ();
total_coach_col := total_tckt_colcn ();
OPEN cur_total_tckt;
loop
fetch cur_total_tckt bulk collect into total_tckt_col limit 100;
dbms_output.put_line(total_tckt_col.last);
FOR i IN total_tckt_col.first..total_tckt_col.last
loop
-- dbms_output.put_line(total_tckt_col(i).ticket_id); -- this line works
dbms_output.put_line(total_tckt_col(i)); -- this line gives error
END LOOP;
exit
WHEN (cur_total_tckt%NOTFOUND);
END LOOP ;
CLOSE cur_total_tckt;
end;No, it wont allow to display two values ,
Other wise we can do ,to display two values by giving separately DBMS_output as shown below.it wont give u ia single row , it will give in row by row.
DECLARE
CURSOR cur_total_tckt
IS
SELECT empno, ename FROM emp;
TYPE total_tckt_colcn IS TABLE OF cur_total_tckt%ROWTYPE;
total_tckt_col total_tckt_colcn;
total_coach_col total_tckt_colcn;
BEGIN
total_tckt_col := total_tckt_colcn ();
total_coach_col := total_tckt_colcn ();
OPEN cur_total_tckt;
LOOP
FETCH cur_total_tckt BULK COLLECT INTO total_tckt_col LIMIT 100;
DBMS_OUTPUT.put_line (total_tckt_col.LAST);
FOR i IN total_tckt_col.FIRST .. total_tckt_col.LAST
LOOP
DBMS_OUTPUT.put_line (total_tckt_col (i).empno);
DBMS_OUTPUT.put_line (total_tckt_col (i).ename);
END LOOP;
EXIT WHEN (cur_total_tckt%NOTFOUND);
END LOOP;
CLOSE cur_total_tckt;
END;
Out put:
12
1236
kenny
2
jhon
1
menies
3
sony
4
endy
5
dennies
1
wolks
2
flora
3
teady
4
furry
5
kune
6
zoel
Cheers! -
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMI
I am trying to submit the payables open interface import program using BPEL process. BUT I am unable to submit the concurrent program. The invoke function is failing with below message.
[2010/08/25 17:06:22] Faulted while invoking operation "OFAPOPIIMPORT" on provider "OFAPOPIIMPORT".less
-<messages>
-<input>
-<Invoke_1_OFAPOPIIMPORT_InputVariable>
-<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters">
-<InputParameters xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XX_BPEL_FND_REQUEST_SUBMIT_REQ/FND_REQUEST-24SUBMIT_REQUEST/" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XX_BPEL_FND_REQUEST_SUBMIT_REQ/FND_REQUEST-24SUBMIT_REQUEST/">
<db:APPLICATION>200</db:APPLICATION>
<db:PROGRAM>APXIIMPT</db:PROGRAM>
<db:DESCRIPTION>Test</db:DESCRIPTION>
<db:START_TIME/><db:SUB_REQUEST/>
<db:OperatingUnit>NYSIF</db:OperatingUnit>
<db:Source>DBL</db:Source>
<db:Group/>
<db:BatchName>TESTRAMBPEL1</db:BatchName>
<db:HoldName/>
<db:HoldReason/>
<db:GLDate/>
<db:Purge>N</db:Purge>
<db:TraceSwitch>N</db:TraceSwitch>
<db:DebugSwitch>N</db:DebugSwitch>
<db:SummarizeReport>N</db:SummarizeReport>
<db:CommitBatchSize>1000</db:CommitBatchSize>
<db:UserID>4842</db:UserID>
<db:LoginID>1683090</db:LoginID>
</InputParameters>
</part>
</Invoke_1_OFAPOPIIMPORT_InputVariable>
</input>
-<fault>
-<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="code">
<code>6550
</code>
</part>
-<part name="summary">
<summary>
file:/C:/product/10.1.3.1/OraBPEL_1/bpel/domains/default/tmp/.bpel_APOPIIMPORT_1.0_91d4c6c1050ed25d005bc0d396a9db24.tmp/OFAPOPIIMPORT.wsdl [ OFAPOPIIMPORT_ptt::OFAPOPIIMPORT(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'OFAPOPIIMPORT' failed due to: Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.XX_BPEL_FND_REQUEST_SUBMIT_REQ.FND_REQUEST$SUBMIT_REQUEST API. Cause: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
[Caused by: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
; nested exception is:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.XX_BPEL_FND_REQUEST_SUBMIT_REQ.FND_REQUEST$SUBMIT_REQUEST API. Cause: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
[Caused by: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
</summary>
</part>
-<part name="detail">
<detail>
Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
</detail>
</part>
</remoteFault>
</fault>
</messages>
[2010/08/25 17:06:22] "{http://schemas.oracle.com/bpel/extension}remoteFault" has been thrown. More...
-<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="code">
<code>6550
</code>
</part>
-<part name="summary">
<summary>
file:/C:/product/10.1.3.1/OraBPEL_1/bpel/domains/default/tmp/.bpel_APOPIIMPORT_1.0_91d4c6c1050ed25d005bc0d396a9db24.tmp/OFAPOPIIMPORT.wsdl [ OFAPOPIIMPORT_ptt::OFAPOPIIMPORT(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'OFAPOPIIMPORT' failed due to: Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.XX_BPEL_FND_REQUEST_SUBMIT_REQ.FND_REQUEST$SUBMIT_REQUEST API. Cause: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
[Caused by: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
; nested exception is:
ORABPEL-11811
Error while trying to prepare and execute an API.
An error occurred while preparing and executing the APPS.XX_BPEL_FND_REQUEST_SUBMIT_REQ.FND_REQUEST$SUBMIT_REQUEST API. Cause: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
[Caused by: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
</summary>
</part>
-<part name="detail">
<detail>
Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'FND_REQUEST$SUBMIT_REQUEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
</detail>
</part>
</remoteFault>
I thought I am providing the values for the required parameters. But still I am unable to submit. Could some one help me on fixing this issue?
Thanks,That's probably your problem.
Look at http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28351/T430238T430241.htm
Search for "One-time Workaround for Concurrent Programs" in that document. -
Java Applet in a HTML page: failing with PLS-00306: wrong number of args
We are trying to use a Java Applet in a HTML page. as our system needs to be able to retrieve a predefined set of data from a third party system that uses Dynamic Data Exchange Protocol (DDE) and are encountering errors from APEX and in IE itself.
We are using JavaDde from www.nevaobject.com that enables our Java applet to interact with Windows applications (Third Party System) using DDE.
This functionality is currently used in our Web Form 6i application and we are trying to use the same in the new ApEx application.
We are using ApEx version : 2.1 and actually aer encountering 2 problems:
Problem 1: ApEx failing with PLS-00306: wrong number or types of arguments in call to 'ACCEPT'
Problem 2: IE crashes if Applet used in a complex page with several regions (1 Context, 4 Report Regions, 2 level Tabs, Links)
This problem does not occur in the page where there is only applet and one region. In the case of complex page the IE crashes if the page is reloaded
Test scenario:
1- Create a simple page with the HTML region.
2- Define the Source of the above region as follows
<OBJECT CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#version=1,4,0,0"
WIDTH="1"
HEIGHT="1"
ID="simpleApplet"
NAME="simpleApplet">
<PARAM NAME="code" VALUE="simpleApplet.class" >
<PARAM NAME="archive" VALUE="simpleApplet.jar" />
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
</OBJECT>
3- Create a simple Java applet "simpleApplet" - for the test its enough if the applet will have just the init method printing out the mesage to the console
4- Create a Submit Button (not redirect) in Region Header and create unconditional (do not set When Button Pressed property) Page Branch to navigate to another page (the page without the applet)
6- Run the page and Submit -
The error below is returned by the engine:
In our case our applet is called ddeApplet - I do not know why is ApEx passing the Applet's ID down to the wwv_flow.accept method as a parameter
Tue, 24 Jul 2007 08:15:39 GMT
ORA-06550: line 7, column 2:
PLS-00306: wrong number or types of arguments in call to 'ACCEPT'
ORA-06550: line 7, column 2:
PL/SQL: Statement ignored
DAD name: rbdev2_ax
PROCEDURE : wwv_flow.accept
URL : http://castor:7778/pls/rbdev2_ax/wwv_flow.accept
PARAMETERS :
============
P_FLOW_ID:
147
P_FLOW_STEP_ID:
500
P_INSTANCE:
6986070096861669560
P_PAGE_SUBMISSION_ID:
1005758
P_REQUEST:
CRASH
P_ARG_NAMES:
100380029717786501
P_T01:
147
P_T02:
101
P_T03:
5000044
P_T04:
1
P_T05:
S
DDEAPPLET:
Ddeapplet[panel0,0,0,1x1,layout=java.awt.BorderLayout,rootPane=javax.swing.JRootPane[,0,0,1x1,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
P_MD5_CHECKSUM:
ENVIRONMENT:
============
PLSQL_GATEWAY=WebDb
GATEWAY_IVERSION=2
SERVER_SOFTWARE=Oracle HTTP Server Powered by Apache/1.3.19 (Unix) mod_fastcgi/2.2.10 mod_perl/1.25 mod_oprocmgr/1.0
GATEWAY_INTERFACE=CGI/1.1
SERVER_PORT=7778
SERVER_NAME=castor
REQUEST_METHOD=POST
QUERY_STRING=
PATH_INFO=/pls/rbdev2_ax/wwv_flow.accept
SCRIPT_NAME=/pls
REMOTE_HOST=
REMOTE_ADDR=192.168.66.169
SERVER_PROTOCOL=HTTP/1.1
REQUEST_PROTOCOL=HTTP
REMOTE_USER=
HTTP_CONTENT_LENGTH=661
HTTP_CONTENT_TYPE=application/x-www-form-urlencoded
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
HTTP_HOST=castor:7778
HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_ACCEPT_CHARSET=
HTTP_COOKIE=ISCOOKIE=true; LOGIN_USERNAME_COOKIE=rdanko; ORACLE_PLATFORM_REMEMBER_UN=RDANKO:ngrb; WWV_FLOW_USER2=70FBB00945FE46B9; V6_AUTHENTICATION_COOKIE=70FBB00945FE46B9
Authorization=
HTTP_IF_MODIFIED_SINCE=
HTTP_REFERER=http://castor:7778/pls/rbdev2_ax/f?p=147:500:6986070096861669560:::::
HTTP_SOAPACTION="theArrow",
It looks like whatever HTML you're including on your page is creating HTML input form elements inside the HTML form "wwv_flow". This form is posted to wwv_flow.accept, and of course, the PL/SQL procedure wwv_flow.accept doesn't know anything these additional arguments/form elements you're attempting to POST.
Joel -
Encounter PLS-00306: wrong number or types of arguments issue
I came across a issue of PLS-00306: wrong number or types of arguments when I tried to call a stored procedure through Toplink ValueReadquery.
The full error message is:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'FREEZE_REGISTERS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
Call:BEGIN FREEZE_REGISTERS(REGISTRATION_DETAIL_in=>1951, RESERVE_USER_in=>'aUser', RESERVE_BUSINESS_CHANNEL_in=>0, RESERVE_TOKEN_in=>1, RESERVE_DATE_in=>{ts '2007-08-03 10:49:25.39'}, BUSINESS_FUNC_ID_in=>1, UPDATE_COUNT_out=>?); END;
bind => [=> UPDATE_COUNT_out]
Query:ValueReadQuery() ..............
The SP was compiled successfully:
create or replace
Procedure FREEZE_REGISTERS
REGISTRATION_DETAIL_ID_in in NUMBER,
RESERVE_USER_in in VARCHAR2,
RESERVE_BUSINESS_CHANNEL_in in NUMBER,
RESERVE_TOKEN_in in NUMBER,
RESERVE_DATE_in in TIMESTAMP,
BUSINESS_FUNC_ID_in in NUMBER,
UPDATE_COUNT_out OUT NUMBER
IS
BEGIN
UPDATE REGISTER
SET BUSINESS_FUNC_ID = BUSINESS_FUNC_ID_in,
RESERVE_BUSINESS_CHANNEL = RESERVE_BUSINESS_CHANNEL_in,
RESERVE_USER = RESERVE_USER_in,
VERSION_NO = (VERSION_NO + 1),
RESERVE_DATE = RESERVE_DATE_in,
RESERVE_TOKEN = RESERVE_TOKEN_in
WHERE
GEOGRAPHIC_ID in
(SELECT GEOGRAPHIC_ID
FROM LEGAL_INT_TRANS
WHERE REGISTRATION_DETAIL_ID = REGISTRATION_DETAIL_ID_in);
--Assign the number of rows returned to UPDATE_COUNT_out
UPDATE_COUNT_out := SQL%ROWCOUNT;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
END;
However, when I tried to call it in the toplink, I always got that error message. I'd compared the dataType for input values and they are compatible with the arguments defined in the SP.
I have no any clue for this problem. Please help.How are you set the parameters/adding arguments to the ValueReadQuery, can you post the code used to create and execute the query?
Regards,
Chris -
Strange PLS-00306: wrong number or types of arguments
We have the code in production and in the test. the dbs, the servers are setup the same. And the codes on two are the same (verified).
Now all a sudden the code on production failing sine yesterday afternoon:
BEGIN REQUEST_API.DBSS_process_FUDS; END;
ERROR at line 1:
ORA-06550: line 1, column 93:
PLS-00306: wrong number or types of arguments in call to 'PROCESS_FUDS'
ORA-06550: line 1, column 93:
PL/SQL: Statement ignored
ORA-06512: at "SYS.DBMS_JOB", line 82
ORA-06512: at "SYS.DBMS_JOB", line 140
ORA-06512: at "ER.REQUEST_API", line 1190
ORA-06512: at line 1
Just with the test's , it still runs OK.
Any idea? how can we look?
Thanks a lot!BluShadow wrote:
Check the call to PROCESS_FUDS and check the definition of PROCESS_FUDS and see what's different.
It could be that something has been relying on implicit datatype conversions i.e. strings to dates and someone has entered some data that doesn't comply with the implicit conversion (i.e. you database stores dates as strings and allows people to enter cr@p data).It is 11.2.0.3
PROCESS_FUDS is the job and defined the same on the two db.
I did spool the code of ER.REQUEST_API from dba_source for the two dbs and dff them. Found no different.
In the same sqlplus client on the remote server:
on the test db:
me@cpt1> exec ER.REQUEST_API.DBSS_process_FUDS
PL/SQL procedure successfully completed.
on the prod db:
me@cpp1> exec ER.REQUEST_API.DBSS_process_FUDS
BEGIN REQUEST_API.DBSS_process_FUDS; END;
ERROR at line 1:
ORA-06550: line 1, column 93:
PLS-00306: wrong number or types of arguments in call to 'PROCESS_FUDS'
ORA-06550: line 1, column 93:
PL/SQL: Statement ignored
ORA-06512: at "SYS.DBMS_JOB", line 82
ORA-06512: at "SYS.DBMS_JOB", line 140
ORA-06512: at "ER.REQUEST_API", line 1190
ORA-06512: at line 1 -
PLS-00306: wrong number or types of arguments in call to 'XMLAGG'
Hello,
I have a procedure that creates an xml file and I need to order by an admission date using XMLAGG. When I run the query on it's own, with it not being inside a procedure it runs fine. When I try to run it within a procedure it throws back the above error message, unless I comment out the 'order by'. Does anyone know how I can get this to run with the order by within a procedure?
We are using Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production.
Thanks.
SELECT XMLELEMENT("Stakeholder", XMLELEMENT("ULI", a.ULI),
XMLELEMENT("Gender",a.GENDER),
XMLELEMENT("BirthDate", XMLATTRIBUTES(a.BIRTH_DATE_TYPE AS "type"), a.BIRTH_DATE),
XMLELEMENT("HealthCareNumberInformation",XMLELEMENT("HealthCareNumber",a.HCN),
XMLFOREST((a.PROV_ISSUING_HCN) AS "ProvinceTerritoryIssuingHCN")),
XMLELEMENT("SubmissionType",a.SUBMISSION_TYPE),
(SELECT XMLAGG(XMLELEMENT("ServiceEpisode", XMLELEMENT("AdmissionDate", a2.ADMISSION_DATE )) ORDER BY a2.ADMISSION_DATE)
FROM admissions a2
, discharge d2
WHERE a.uli = a2.uli
AND a.uli = d2.uli
AND a2.encounter_number = d2.encounter_number
)).getClobVal() AS "result"
FROM Admissions a
, Discharge d3
, Diagnosis d
WHERE a.ULI = d3.ULI
AND a.ENCOUNTER_NUMBER = d3.ENCOUNTER_NUMBER
AND a.ULI = d.ULI
AND a.ENCOUNTER_NUMBER = d.ENCOUNTER_NUMBER
GROUP BY a.ULI
, a.GENDER
, a.BIRTH_DATE_TYPE
, a.BIRTH_DATE
, a.HCN
, a.PROV_ISSUING_HCN
, a.SUBMISSION_TYPEcreate table mytab (a number,b number);
insert into mytab values (1,100);
insert into mytab values (2,200);
SVIL>SELECT xmlelement("A",XMLAGG(XMLELEMENT("B", b ) ORDER BY b)) FROM mytab;
XMLELEMENT("A",XMLAGG(XMLELEMENT("B",B)ORDERBYB))
<A><B>100</B><B>200</B></A>
SVIL>create or replace function getx return xmltype is
2 r xmltype;
3 begin
4 SELECT xmlelement("A",XMLAGG(XMLELEMENT("B", b ) ORDER BY b))
5 into r
6 FROM mytab;
7 return r;
8 end;
9 /
Avvertimento: funzione creata con errori di compilazione.
SVIL>sho err
Errori in FUNCTION GETX:
LINE/COL ERROR
4/1 PL/SQL: SQL Statement ignored
4/23 PLS-00306: wrong number or types of arguments in call to 'XMLAGG'
4/23 PL/SQL: ORA-00904: "XMLAGG": invalid identifier
SVIL>
SVIL>ed a
SVIL>select * from v$version where rownum=1
2 ;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit ProductionThe same code works on 10.2.0.4 and 11.1.0.6, don't have other versions to test
Testing your code
SVIL>declare
2 d integer;
3 x xmltype;
4 begin
5 select deptno, xmlagg (xmlelement (e, ename || ',') order by ename)
6 into d, x
7 from emp
8 where deptno = 10
9 group by deptno;
10 end;
11 /
select deptno, xmlagg (xmlelement (e, ename || ',') order by ename)
ERRORE alla riga 5:
ORA-06550: line 5, column 19:
PLS-00306: wrong number or types of arguments in call to 'XMLAGG'
ORA-06550: line 5, column 19:
PL/SQL: ORA-00904: "XMLAGG": invalid identifier
ORA-06550: line 5, column 4:
PL/SQL: SQL Statement ignored
SVIL>select deptno, xmlagg (xmlelement (e, ename || ',') order by ename) from emp group by deptno;
DEPTNO XMLAGG(XMLELEMENT(E,ENAME||',')ORDERBYENAME)
1 <E>mike,</E><E>tom,</E>
2 <E>carl,</E> Max
Edited by: Massimo Ruocchio on Dec 7, 2009 11:11 PM
Corrected return type -
PLS-00306: wrong number or types of arguments in call to '(FUNCTION)'
Hi all,
I've spent quite some time trying to get this to work, but is appears that none of the code samples I have tried work with this version of ODP.Net : 2.102.2.20.
It's the most basic thing : return a weak typed resultset from an oracle function using weak typed SYS_REFCURSOR. I got this to work with a procedure, but no way this works with a function.
I'm using the code approach from this source : http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/williams_refcursors.html
CREATE OR REPLACE FUNCTION
fn_getItemsByDispNumber(p_Number in varchar2)
return sys_refcursor
IS
resultset sys_refcursor;
begin
open resultset for
....select statement
return resultset;
end;
Exception is : ORA-06550: line 1
PLS-00306: wrong number or types of arguments in call to '(fn_getItemsByDispNumber)'
Using strong types is not an option I have too many columns adn result sets that it makes no sense.
I tried to obtain the sys_refcursor as return value and as output parameters and it's the same results. I also tried adding the return value parameter to the command object first, but with no luck (same error).
Is there some magical trick thet must be done for this simple thing to work ?
Thanksuser10940202 wrote:
The calling code looks like this :
Dim cmd As OracleCommand = New OracleCommand("fn_getItemsByDispNumber", con)
cmd.CommandType = CommandType.StoredProcedure
Dim p_refcursor As OracleParameter = New OracleParameter
p_refcursor.OracleDbType = OracleDbType.RefCursor
p_refcursor.Direction = ParameterDirection.ReturnValue
cmd.Parameters.Add(p_refcursor)
Dim inputparm As OracleParameter = New OracleParameter
inputparm.OracleDbType = OracleDbType.Varchar2
inputparm.Name = "p_Number"
p_refcursor.Direction = ParameterDirection.Input
cmd.Parameters.Add(inputparm)
cmd.Parameters.Add(p_refcursor)
'ExecuteNonQuery() also fails with the same error message
Dim da As OracleDataAdapter = New OracleDataAdapter(cmd)
Dim ds As DataSet = New DataSet
da.Fill(ds)
I also tried to rever the order in which parameters are specified but same the same error persists. I also tried with output parameter of type SYS_REFCURSOR but no luck, same exact error.
Is it possible that weakly typed cursors are not supported with functions ? That would be strange because it's the first use I can think of for the function concept?
Edited by: user10940202 on Sep 14, 2009 12:44 PMHi,
Looks like a few things are jumbled together here...
You have p_refcursor.Direction = ParameterDirection.Input and the parameters added to the collection multiple times, etc...
You should just need something like this:
Dim p_refcursor As OracleParameter = New OracleParameter
p_refcursor.OracleDbType = OracleDbType.RefCursor
p_refcursor.Direction = ParameterDirection.ReturnValue
Dim inputparm As OracleParameter = New OracleParameter
inputparm.OracleDbType = OracleDbType.Varchar2
inputparm.Name = "p_Number"
inputparm.Value = <Some Value>
cmd.Parameters.Add(p_refcursor)
cmd.Parameters.Add(inputparm)Regards,
Mark -
PLS-00306: wrong number or types of arguments in call to 'proc1'
Hi All,
I pass OUT paramter values to .NET as in below proc.
PROCEDURE PROC1
in_report_parameter_id IN report_tasks.report_task_id%TYPE,
result_site_name OUT SYS_REFCURSOR,
result OUT SYS_REFCURSOR
AS
my_site_id sites.site_id%TYPE;
my_lane_numbers_string VARCHAR(100);
my_site_name sites.short_name%TYPE;
BEGIN
my_site_id := get_site_id(in_report_parameter_id);
SELECT short_name
INTO my_site_name
FROM sites
WHERE site_id = my_site_id;
OPEN result_site_name FOR
SELECT my_site_name site_name
FROM sys.dual;
OPEN result FOR
SELECT site_direction_id,
site_lane_id
FROM site_lanes
JOIN report_parameters
ON site_lane_id = CAST(report_parameters.report_parameter_value AS NUMBER)
WHERE site_id = my_site_id
AND report_parameters.report_parameter_id = in_report_parameter_id
AND report_parameters.report_parameter_group = 'LANE'
AND report_parameters.report_parameter_name = 'LANE'
ORDER BY site_direction_id ASC, site_lane_id ASC;
-- FROM SYS.DUAL;
END PROC1;During runtime it throws me the following error
PLS-00306: wrong number or types of arguments in call to 'proc1'how could i solve this ?
Thanks in advance.
Regards,
IndhuHi, Indhu,
user10641405 wrote:
PROCEDURE PROC1
in_report_parameter_id IN report_tasks.report_task_id%TYPE,
result_site_name OUT SYS_REFCURSOR,
result OUT SYS_REFCURSOR
AS ...During runtime it throws me the following error
PLS-00306: wrong number or types of arguments in call to 'proc1'how could i solve this ?Call proc1 with the right number and types of arguments.
The first argument is an IN argument, so it can be any kind of expression, including a literal or a function call.
The second and third arguments are OUT arguments, so they must be variables.
If you need more help, post the code that calls proc1 (and causes the error).
Make sure you include the part of the code where the arguments are declared.
I'm innocent of .net, so I probably won't be able to help you with that part, but it will be important for anyone who does know .net.
By the way, is there a reason why you are using a SYS_REFCURSOR for result_site_name, when it will only return one row? A lot of folks would make the datatype of that argument sites.short_name%TYPE. -
Hi,
My Problem is when im adding dataset with stored procedure, im getting this error.
I Can access database,
Could not create a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct.
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PROCEDURE_NAME' ORA-06550: line 1, column 7: PL/SQL:
Statement ignored
stored procedure is simple select :
CREATE OR REPLACE PROCEDURE [PROCEDURE_NAME](L_CURSOR out SYS_REFCURSOR)
is
Begin
open L_CURSOR for
SELECT [columnname] FROM
[tablename]
End;
Configuration Details:
DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64biOracle Developer Tools for Visual Studio Copyright (c) 2005,2014 SQL Server Data Tools Type: Oracle , Data Provider : .Net Framework Data Provider For OracleThe answer is of inside question. It is about provider. Change my provider ODTwithODAC for 10g (my database version). And problem resolved.
Thank you for your helps,
Regards,
Arda -
Pl. help debug - PLS-00306: wrong number or types of arguments in call
Hi,
I am trying to create a wrapper function to all a procedure in Oracle EBusiness Suite 11i.
When I compile the following code
==========
CREATE OR REPLACE PROCEDURE gme.KIL_ProcessAlloc IS
vFileName VARCHAR2(30) := '1006251.csv';
vLoc VARCHAR2(20) := '/u041/applmgr/opm/opmappl/utllog';
v_InHandle utl_file.file_type;
vNewLine VARCHAR2(1000);
vLineNo PLS_INTEGER;
c1 PLS_INTEGER;
c2 PLS_INTEGER;
c3 PLS_INTEGER;
c4 PLS_INTEGER;
c5 PLS_INTEGER;
c6 PLS_INTEGER;
c7 PLS_INTEGER;
c8 PLS_INTEGER;
c9 PLS_INTEGER;
c10 PLS_INTEGER;
c11 PLS_INTEGER;
c12 PLS_INTEGER;
c13 PLS_INTEGER;
c14 PLS_INTEGER;
c15 PLS_INTEGER;
c16 PLS_INTEGER;
c17 PLS_INTEGER;
c18 PLS_INTEGER;
c19 PLS_INTEGER;
c20 PLS_INTEGER;
c21 PLS_INTEGER;
c22 PLS_INTEGER;
c23 PLS_INTEGER;
c24 PLS_INTEGER;
c25 PLS_INTEGER;
c26 PLS_INTEGER;
c27 PLS_INTEGER;
c28 PLS_INTEGER;
c29 PLS_INTEGER;
c30 PLS_INTEGER;
c31 PLS_INTEGER;
c32 PLS_INTEGER;
c33 PLS_INTEGER;
c34 PLS_INTEGER;
TYPE AllocArray IS TABLE OF GME_INVENTORY_TXNS_GTMP%ROWTYPE
INDEX BY BINARY_INTEGER;
l_Allocdata AllocArray;
TYPE MtlDetailArray IS TABLE OF gme_material_details%ROWTYPE
INDEX BY BINARY_INTEGER;
l_MtlDetaildata MtlDetailArray;
TYPE xTranArray IS TABLE OF GME_INVENTORY_TXNS_GTMP%ROWTYPE
INDEX BY BINARY_INTEGER;
l_xtrandata xTranArray;
TYPE defTranArray IS TABLE OF GME_INVENTORY_TXNS_GTMP%ROWTYPE
INDEX BY BINARY_INTEGER;
l_deftrandata defTranArray;
t_messagecount number;
t_messagelist varchar2(10000);
t_returnstatus varchar2(1);
BEGIN
v_InHandle := utl_file.fopen(vLoc, vFileName, 'r');
vLineNo := 1;
LOOP
BEGIN
utl_file.get_line(v_InHandle, vNewLine);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
vNewLine := TRANSLATE(vNewLine, 'A''', 'A');
c1 := INSTR(vNewLine, ',', 1,1);
c2 := INSTR(vNewLine, ',', 1,2);
c3 := INSTR(vNewLine, ',', 1,3);
c4 := INSTR(vNewLine, ',', 1,4);
c5 := INSTR(vNewLine, ',', 1,5);
c6 := INSTR(vNewLine, ',', 1,6);
c7 := INSTR(vNewLine, ',', 1,7);
c8 := INSTR(vNewLine, ',', 1,8);
c9 := INSTR(vNewLine, ',', 1,9);
c10 := INSTR(vNewLine, ',', 1,10);
c11 := INSTR(vNewLine, ',', 1,11);
c12 := INSTR(vNewLine, ',', 1,12);
c13 := INSTR(vNewLine, ',', 1,13);
c14 := INSTR(vNewLine, ',', 1,14);
c15 := INSTR(vNewLine, ',', 1,15);
c16 := INSTR(vNewLine, ',', 1,16);
c17 := INSTR(vNewLine, ',', 1,17);
c18 := INSTR(vNewLine, ',', 1,18);
c19 := INSTR(vNewLine, ',', 1,19);
c20 := INSTR(vNewLine, ',', 1,20);
c21 := INSTR(vNewLine, ',', 1,21);
c22 := INSTR(vNewLine, ',', 1,22);
c23 := INSTR(vNewLine, ',', 1,23);
c24 := INSTR(vNewLine, ',', 1,24);
c25 := INSTR(vNewLine, ',', 1,25);
c26 := INSTR(vNewLine, ',', 1,26);
c27 := INSTR(vNewLine, ',', 1,27);
c28 := INSTR(vNewLine, ',', 1,28);
c29 := INSTR(vNewLine, ',', 1,29);
c30 := INSTR(vNewLine, ',', 1,30);
c31 := INSTR(vNewLine, ',', 1,31);
c32 := INSTR(vNewLine, ',', 1,32);
c33 := INSTR(vNewLine, ',', 1,33);
c34 := INSTR(vNewLine, ',', 1,34);
-- l_allocdata(vLineNo).sourceno := SUBSTR(vNewLine,1,c1-1);
-- l_allocdata(vLineNo).sizeno := SUBSTR(vNewLine,c1+1,c2-c1-1);
-- l_allocdata(vLineNo).status := SUBSTR(vNewLine,c2+1,c3-c2-1);
-- l_allocdata(vLineNo).latitude := SUBSTR(vNewLine,c3+1,c4-c3-1);
-- l_allocdata(vLineNo).longitude := SUBSTR(vNewLine,c4+1,c5-c4-1);
-- l_allocdata(vLineNo).testfor := SUBSTR(vNewLine,c5+1);
l_allocdata(vLineNo).trans_id := SUBSTR(vNewLine,1,c1-1);
l_allocdata(vLineNo).item_id := SUBSTR(vNewLine,c1+1,c2-c1-1);
l_allocdata(vLineNo).co_code := SUBSTR(vNewLine,c2+1,c3-c2-1);
l_allocdata(vLineNo).orgn_code := SUBSTR(vNewLine,c3+1,c4-c3-1);
l_allocdata(vLineNo).whse_code := SUBSTR(vNewLine,c4+1,c5-c4-1);
l_allocdata(vLineNo).lot_id := SUBSTR(vNewLine,c5+1,c6-c5-1);
l_allocdata(vLineNo).location := SUBSTR(vNewLine,c6+1,c7-c6-1);
l_allocdata(vLineNo).doc_id := SUBSTR(vNewLine,c7+1,c8-c7-1);
l_allocdata(vLineNo).doc_type := SUBSTR(vNewLine,c8+1,c9-c8-1);
l_allocdata(vLineNo).doc_line := SUBSTR(vNewLine,c9+1,c10-c9-1);
l_allocdata(vLineNo).line_type := SUBSTR(vNewLine,c10+1,c11-c10-1);
l_allocdata(vLineNo).reason_code := SUBSTR(vNewLine,c11+1,c12-c11-1);
l_allocdata(vLineNo).trans_date := SUBSTR(vNewLine,c12+1,c13-c12-1);
l_allocdata(vLineNo).trans_qty := SUBSTR(vNewLine,c13+1,c14-c13-1);
l_allocdata(vLineNo).trans_qty2 := SUBSTR(vNewLine,c14+1,c15-c14-1);
l_allocdata(vLineNo).qc_grade := SUBSTR(vNewLine,c15+1,c16-c15-1);
l_allocdata(vLineNo).lot_status := SUBSTR(vNewLine,c16+1,c17-c16-1);
l_allocdata(vLineNo).trans_stat := SUBSTR(vNewLine,c17+1,c18-c17-1);
l_allocdata(vLineNo).trans_um := SUBSTR(vNewLine,c18+1,c19-c18-1);
l_allocdata(vLineNo).trans_um2 := SUBSTR(vNewLine,c19+1,c20-c19-1);
l_allocdata(vLineNo).completed_ind := SUBSTR(vNewLine,c20+1,c21-c20-1);
l_allocdata(vLineNo).staged_ind := SUBSTR(vNewLine,c21+1,c22-c21-1);
l_allocdata(vLineNo).gl_posted_ind := SUBSTR(vNewLine,c22+1,c23-c22-1);
l_allocdata(vLineNo).event_id := SUBSTR(vNewLine,c23+1,c24-c23-1);
l_allocdata(vLineNo).text_code := SUBSTR(vNewLine,c24+1,c25-c24-1);
l_allocdata(vLineNo).transaction_no := SUBSTR(vNewLine,c25+1,c26-c25-1);
l_allocdata(vLineNo).action_code := SUBSTR(vNewLine,c26+1,c27-c26-1);
l_allocdata(vLineNo).material_detail_id := SUBSTR(vNewLine,c27+1,c28-c27-1);
l_allocdata(vLineNo).organization_id := SUBSTR(vNewLine,c28+1,c29-c28-1);
l_allocdata(vLineNo).locator_id := SUBSTR(vNewLine,c29+1,c30-c29-1);
l_allocdata(vLineNo).subinventory := SUBSTR(vNewLine,c30+1,c31-c30-1);
l_allocdata(vLineNo).alloc_um := SUBSTR(vNewLine,c31+1,c32-c31-1);
l_allocdata(vLineNo).alloc_qty := SUBSTR(vNewLine,c32+1,c33-c32-1);
l_allocdata(vLineNo).def_trans_ind := SUBSTR(vNewLine,c33+1,c34-c33-1);
vLineNo := vLineNo+1;
END LOOP;
utl_file.fclose(v_InHandle);
FOR i IN 1..vLineNo-1 loop
GME_API_PUB.insert_line_allocation (
1,
100,
FALSE,
True,
l_allocdata(i),
null,
null,
false,
false,
false,
l_MtlDetailData,
l_xtrandata,
l_deftrandata,
t_messagecount,
t_messagelist,
t_returnstatus);
end loop;
IF (t_returnstatus <> 'S') THEN
for i IN 1 .. t_messagecount LOOP
dbms_output.put_line('The text is '||FND_MSG_PUB.get(i,t_messagelist));
END LOOP;
END IF;
-- COMMIT;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END KIL_ProcessAlloc;
===============
I get this
Warning: Procedure created with compilation errors.
SQL> sho err
Errors for PROCEDURE GME.KIL_PROCESSALLOC:
LINE/COL ERROR
145/8 PLS-00306: wrong number or types of arguments in call to
'INSERT_LINE_ALLOCATION'
145/8 PL/SQL: Statement ignored
=================
The package specs of GME_API_PU is under:
===============
PROCEDURE insert_line_allocation (
p_api_version IN NUMBER := gme_api_pub.api_version
,p_validation_level IN NUMBER := gme_api_pub.max_errors
,p_init_msg_list IN BOOLEAN := FALSE
,p_commit IN BOOLEAN := FALSE
,p_tran_row IN gme_inventory_txns_gtmp%ROWTYPE
,p_lot_no IN VARCHAR2 DEFAULT NULL
,p_sublot_no IN VARCHAR2 DEFAULT NULL
,p_create_lot IN BOOLEAN DEFAULT FALSE
,p_ignore_shortage IN BOOLEAN DEFAULT FALSE
,p_scale_phantom IN BOOLEAN DEFAULT FALSE
,x_material_detail OUT gme_material_details%ROWTYPE
,x_tran_row OUT gme_inventory_txns_gtmp%ROWTYPE
,x_def_tran_row OUT gme_inventory_txns_gtmp%ROWTYPE
,x_message_count OUT NUMBER
,x_message_list OUT VARCHAR2
,x_return_status OUT VARCHAR2);
GME_API_PUB.insert_line_allocation
===========
What am I doing wrong...why am I getting PLS-00306.
Can someone help?
Thank you
Sundar
[email protected]Hi John,
Thanks a ton - a nice Christmas gift. Thank you for being a Santa :-).
I used the same subscript as the one used for in parameter and the procedure compiled without errors.
A corollary: If (any of the) Out parameter is null (all columns of the row/array), will the array row element still be stored ? May be I cross the bridge when I come to it.
Merry Christmas.
Sundar -
PLS-00306: wrong number or types of arguments in call in a for loop
Dear all
I recently put up another post about the same error message but as the message now relates to another part of my programme and, in my mind at least, a different conceptual idea, I thought I should start a new top. If that is not right thing to have done then please let me know. I am working in 10.2.
I am trying to pass through multiple variables. When I run the code at the end of this question I get an error message:
PLS-00306: wrong number or types of arguments in call to 'CUR_MAP_LIST'This relates to the line:
FOR var_map_list IN cur_map_list (par_map_list (n))I think the reason the error message comes up is because par_map_list is a associate array / PL/SQL table and cur_map_list is based on %rowtype. Although I could be wrong. However I am not sure what I should be doing so that I don't get such an error message.
I was reading through page 623 on Web Development 9i (by Brown; pub. McGrew-Hill) and pages 357-358 of Oracle Web Application Programming for PL/SQL Developers (by Boardman, Caffrey, Morse, Rosenzweig; pub. Prentice Hall), in order to try and write my code. As well as Oracle's Application Developer’s Guide - Fundamentals (Release 2), page 11-6. In particular the Web Development book uses the following:
create or replace procedure query_department
(in_dept_no owa_util.ident_arr)
is
cursor dept_cursor (nbt_dept_no emp.deptno%TYPE) is
select empno, ename, mgr, sal, comm
from scott.emp
where deptno = nbt_dept_no;
begin
for x in 1 .. in_dept_no.count loop
for dept_rec in dept_cursor(in_dept_no (x)) loop
end loop;
end loop;
end;In that example the cursor selects empno, ename, mgr, sal and comm from emp. So if it is doing that the cursor must be of a VARCHAR2 and NUMBER data type. What I don't understand is the for dept_rec in part. For a start I am not sure where dept_rec comes from? If it is a NUMBER data type, how can the in_dept_no, which is a owa_util.ident_arr associate array / PL/SQL data type work with it. Unfortunately because the example is incomplete and doesn't include procedures relating to the in variables, I am unable to run it and try and learn from what it is doing, so that I can try and relate the concept to my own work.
My programme is as follows. There may be other errors in the code not relating to this error. If so I hope to find these and resolve them once I understand what I should be doing here:
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
var_xml_theme VARCHAR2(32767);
BEGIN
PROCMAPLIST (empty, var_xml_theme);
END maps;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr,
par_xml_theme OUT VARCHAR2
AS
CURSOR cur_map_list IS
SELECT MT.map_title
MI.map_id
OMSN.map_sheet_number_id
WRMF.web_raster_map_id
FROM MAP_TITLE MT
MAP_INFO MI
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF,
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
var_map_list cur_map_list%ROWTYPE;
var_xml_theme VARCHAR2(32767);
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR n IN 1 .. par_map_list.COUNT
LOOP
FOR var_map_list IN cur_map_list (par_map_list (n))
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "WRMFB'||
var_map_list.web_raster_map_id||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
NAME = "Display selected maps"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;Thank you for reading. Kind regards
TimDear everyone
I have now resolved the problems I was having with multiple values and checkboxes, thanks to comments in this thread, read large chucks of Oracle PL/SQL Programming by Steve Feuerstein and suddenly realising where I am going wrong in terms of thinking.
For a start, I when I was dealing with the multiple values, I was trying to get PL/SQL to pass them out. Of course this is done by the action part of the input form. Although I have not done much web coding, I did know about this. However because I was so engrossed in trying to understand how multiple values work, I didn't relate the two ideas. I even mind mapping the problem and still didn't get it.
I also did not think to change my the action from post command to get, so that I could see what was coming out. However that would not have made too much of a difference because the other problem I had was related to where sub programmes were declared. The function which received the values was privately declared, and not in the package spec. This meant the web browser could not find the function as that can only make use of the programmes declared publicly.
Once I made these changes, as well as correcting other minor typing mistakes, the values passed through as expected. The only other mistake I made was to include the name option after the submit input type. In my case I did not need to submit the value of that button. The revised code is as follows. In this version I replaced the function with a procedure that simply prints the checkbox values to screen. I have also made the input form action get, instead of post, so that the values can be seen in the web browser address bar:
create or replace
PACKAGE MAPSITE AS
PROCEDURE MAPS;
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT OWA_UTIL.IDENT_ARR
PROCEDURE PROCDISPLAY
(maplist IN OUT OWA_UTIL.IDENT_ARR);
END MAPSITE;
create or replace
PACKAGE BODY MAPSITE AS
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
BEGIN
PROCCHECKLIST (empty);
END MAPS;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr
AS
CURSOR cur_map_list IS
SELECT MT.map_title,
MI.map_id,
OMSN.map_sheet_number_id,
WRMF.web_raster_map_id
FROM MAP_TITLE MT,
MAP_INFO MI,
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR var_map_list IN cur_map_list
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "maplist"
CHECKED = "' ||
par_map_list ||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;
---PROCDISPLAY PROCEDURE---
PROCEDURE PROCDISPLAY (maplist IN OUT owa_util.ident_arr)
IS
BEGIN
FOR n IN 1..maplist.COUNT
LOOP
htp.print('Checkbox value i.e. var_map_list.web_raster_map_id is: ' ||maplist(n)||'
<P>');
END LOOP;
END PROCDISPLAY;
END MAPSITE;Kind regards
Tim -
PLS-00306 wrong number or types of arguments in call to 'PUT_LINE'
Hi Guys,
I'm practising the plsql workouts,during a anonymous PL/SQL block i got the below error,what the mistake i did ?
declare
v1 employee_290512%rowtype;
cursor c1 is select * from employee_290512;
begin
open c1;
loop
fetch c1 into v1;
exit when c1% notfound;
dbms_output.put_line(v1);
end loop;
end;
{/code}
And i got the below error
Error:
ORA-06550: line 10, column 1:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 10, column 1:
PL/SQL: Statement ignored
/Error.
Please help me on this.
Regards
ThelakHi there,
i got the same error. kindly check what's wrong with my below coding;
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 TYPE Type_Tab_Data IS RECORD
3 (
4 ARMZIG_Q2SFX char(3),
5 somme number(20,2),
6 ARMZIG_Q2AN8 number(8),
7 ARMZIG_Q2DOC number(8),
8 ARMZIG_Q2DCT char(2),
9 ARMZIG_Q2CO varchar2(15 char)
10 );
11 TYPE Tab_Data IS TABLE OF Type_Tab_Data INDEX BY BINARY_INTEGER ;
12 t_flexnum5 Tab_Data;
13 v_test pls_integer;
14 v_text_erreur varchar2(200 char);
15 BEGIN
16 SELECT b.ARMZIG_Q2SFX,a.somme,a.ARMZIG_Q2AN8,a.ARMZIG_Q2DOC,a.ARMZIG_Q2DCT,a.ARMZIG_Q2CO
17 BULK COLLECT INTO t_flexnum5
18 from
19 (
20 SELECT sum(ARMZIG_Q2AAP/100)as somme,ARMZIG_Q2AN8,ARMZIG_Q2DOC,ARMZIG_Q2DCT,ARMZIG_Q2CO
21 from ARMAST_ZIG_EUR
22 where ENVZIG_ID = 'E'
23 group by ARMZIG_Q2AN8,ARMZIG_Q2DOC,ARMZIG_Q2DCT,ARMZIG_Q2CO
24 ) a, ARMAST_ZIG_EUR b
25 where a.ARMZIG_Q2AN8 = b.ARMZIG_Q2AN8
26 and a.ARMZIG_Q2DOC = b.ARMZIG_Q2DOC
27 and a.ARMZIG_Q2DCT = b.ARMZIG_Q2DCT
28 and a.ARMZIG_Q2CO = b.ARMZIG_Q2CO
29 and b.ENVZIG_ID = 'E';
30
31 DBMS_OUTPUT.put_line(t_flexnum5);
32
33 END;
34 /
DBMS_OUTPUT.put_line(t_flexnum5);
ERROR at line 31:
ORA-06550: line 31, column 7:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 31, column 7:
PL/SQL: Statement ignored -
PLS-00306: wrong number or types of arguments in call to 'SHOW'
Statement : declare
rc__ number;
begin
owa.init_cgi_env(:n__,:nm__,:v__);
htp.HTBUF_LEN := 255;
null;
null;
wwv_flow.show(p_request=>:p_request,p_instance=>:p_instance,p_flow_id=>:p_flow_id,p_flow_step_id=>:p_flow_step_id,p_arg_names=>:p_arg_names,p_arg_values=>:p_arg_values);
if (wpg_docload.is_file_download) then
rc__ := 1;
wpg_docload.get_download_file(:doc_info);
null;
null;
commit;
else
rc__ := 0;
null;
null;
commit;
owa.get_page(:data__,:ndata__);
end if;
:rc__ := rc__;
end;
Did someone ever see this ?
My database throws it every time i use an ajax validation with javascript. The application is NOT affected in any way, means the validation is done correct:
function validate(pNumber,i){
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=validate_number',100);
get.add('F500_VALID_NUMBER', pNumber);
gReturn = get.get();
html_GetElement('err'+i).innerHTML=gReturn;
The validate_number Application Process then uses a Stored Function for the "real" validation.
Thanks for help,
JochenJochen,
yes when you trace modplsql, I can see this and I also have an error I don't know why.
<360294694 ms>(wppr.c,497) Pl/sql block parsed...
<360294694 ms>(wpdenv.c,1531) CGI Environment has 31 vars. Max name len 128, Max Value Len 128
<360294694 ms> PLSQL_GATEWAY(14)=(6)WebDb
<360294694 ms> GATEWAY_IVERSION(17)=(2)2
<360294694 ms> SERVER_SOFTWARE(16)=(60)Oracle-Application-Server-10g/10.1.2.2.0 Oracle-HTTP-Server
<360294694 ms> GATEWAY_INTERFACE(18)=(8)CGI/1.1
<360294694 ms> SERVER_PORT(12)=(5)7779
<360294694 ms> SERVER_NAME(12)=(10)net-srv05
<360294694 ms> REQUEST_METHOD(15)=(5)POST
<360294694 ms> PATH_INFO(10)=(15)/wwv_flow.show
<360294694 ms> SCRIPT_NAME(12)=(10)/pls/apex
<360294694 ms> REMOTE_ADDR(12)=(14)172.20.100.77
<360294694 ms> SERVER_PROTOCOL(16)=(9)HTTP/1.1
<360294694 ms> REQUEST_PROTOCOL(17)=(5)HTTP
<360294694 ms> REMOTE_USER(12)=(17)APEX_PUBLIC_USER
<360294694 ms> HTTP_CONTENT_LENGTH(20)=(4)149
<360294694 ms> HTTP_CONTENT_TYPE(18)=(34)application/x-www-form-urlencoded
<360294694 ms> HTTP_USER_AGENT(16)=(51)Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
<360294694 ms> HTTP_HOST(10)=(11)172.18.2.5
<360294694 ms> HTTP_ACCEPT(12)=(4)*/*
<360294694 ms> HTTP_ACCEPT_LANGUAGE(21)=(18)en-us,ar-lb;q=0.5
<360294694 ms> HTTP_COOKIE(12)=(105)LOGIN_USERNAME_COOKIE=usr1234; WWV_CUSTOM-F_941322186522444_101=725E6950E8DF04E5; oracle.uix=0^^GMT+2:00
<360294694 ms> HTTP_REFERER(13)=(53)http://172.18.2.5/pls/apex/f?p=101:1:950664913516045
<360294694 ms> HTTP_ORACLE_ECID(17)=(14)89781163291,1
<360294694 ms> HTTP_ORACLE_CACHE_VERSION(26)=(7)10.1.2
<360294694 ms> WEB_AUTHENT_PREFIX(19)=(1)
<360294694 ms> DAD_NAME(9)=(5)apex
<360294694 ms> DOC_ACCESS_PATH(16)=(5)docs
<360294694 ms> DOCUMENT_TABLE(15)=(23)wwv_flow_file_objects$
<360294694 ms> PATH_ALIAS(11)=(1)
<360294694 ms> REQUEST_CHARSET(16)=(9)AL32UTF8
<360294694 ms> REQUEST_IANA_CHARSET(21)=(6)UTF-8
<360294694 ms> SCRIPT_PREFIX(14)=(5)/pls
<360294694 ms>StrArrPosBind pos 2 Charset Id : 873
<360294694 ms>StrArrPosBind pos 3 Charset Id : 873
<360294694 ms>StrArrPosBind pos 11 Charset Id : 873
<360294704 ms>Execute: ORA-06550: line 33, column 3:
PLS-00306: wrong number or types of arguments in call to 'SHOW'
ORA-06550: line 33, column 3:
PLS-00306: wrong number or types of arguments in call to 'SHOW'
ORA-06550: line 33, column 3:
PL/SQL: Statement ignored
apex team comments are highly appreciated.
one more thing I can see for each ajax request I have in my page a hard parse is happening .
Omar -
PLS-00306: wrong number or types of arguments in call
Hi,
Oracle9i
created a procedure which will retrieve the records.
As the procedure is to only retrieve the records so it does not have any IN parameters
But on executing the procedure gets the below error:
PLS-00306: wrong number or types of arguments in call to 'GET_PRODUCT_DETAILS'
I have called the procedure as below:
=======================
Declare
v_cur ...%type;
BEGIN
Package_name.GET_PRODUCT_DETAILS(v_cur);
END;
Procedure Body
==========
create or replace PROCEDURE GET_PRODUCT_DETAILS( v_cur OUT Cursor)
is
begin
end;
/Try creating the procedure with the out parameter as sys_refcursor.
create or replace PROCEDURE GET_PRODUCT_DETAILS( v_cur OUT sys_refCursor)
And declare the variable in your outer block also as sys_refcursor.
Declare
v_cur sys_refcursor;
BEGIN
Package_name.GET_PRODUCT_DETAILS(v_cur);
END;
Of course this would require that your actual procedure GET_PRODUCT_DETAILS should have a statement like
" open V_cur for some select statement that you use to retrieve the records".
You could also create GET_PRODUCT_DETAILS with the same %type decalration which you use in the outer block
eg
create or replace PROCEDURE GET_PRODUCT_DETAILS( v_cur OUT x.y%type)
Declare
v_cur x.y%type;
BEGIN
Package_name.GET_PRODUCT_DETAILS(v_cur);
END;
/
Maybe you are looking for
-
"Discovery failed to null" error message when starting up Oracle Management
hey folks, i am trying to get the Oracle Enterprise Manager to work and i get an error message. Here is what i've done so far. 1. Installed Oracle service. It is started (under Start>...>Services it says "Started"). 2. Created a Listener for the Orac
-
About Replacement Path, Text Variables & Cusomer Exit?
Hi Please explain along with examples youwhen we use Replacement Path Text Variables and Customer Exit Please search the forum before posting a thread Edite
-
Copy right on sound effects in iMovie
I just got a strange email from youtube. They claim a movie clip of mine contains material which possibly is the property of "GoDigital MG For a Third Party". I only used sound effects and music from imovie. Isn't this material free to use and publis
-
Older Compressor 1.2.1. problem
Hello , I am having this problem when I try to drag source video file into the older Compressor 1.2.1. No matter if I use +sign to add a new file or if I just drag that file into BATCH, folowing ALERT pops up. "Error trying to open source media file"
-
ITunes crashing when trying to view iPhone?
My problem seems to have appeared over night. Last time I syched my iPhone all seemed well but now I can no longer do so. Here's the last crash report I got. Help? Process: iTunes [649] Path: /Applications/iTunes.app/Contents/MacOS/iTun