Create a package with one function - Error Ora-00907
Hello,
I want to create a package which should store one function.
The code looks like this:
Package Header:
CREATE OR REPLACE
PACKAGE "PCK_REPORT" AS
TYPE t_varchar2 IS TABLE OF VARCHAR2(4000);
FUNCTION f_tabtostring(i_varchar2 IN t_varchar2) RETURN VARCHAR2;
END;Package Body:
CREATE OR REPLACE PACKAGE BODY "PCK_REPORT" AS
FUNCTION f_tabtostring (i_varchar2 IN t_varchar2) RETURN VARCHAR2 IS
o_string VARCHAR2(32767);
BEGIN
FOR i IN 1 .. i_varchar2.COUNT LOOP
IF i != i_varchar2.FIRST THEN
o_string := o_string || ', ';
END IF;
o_string := o_string || i_varchar2(i);
END LOOP;
RETURN o_string;
END f_tabtostring;
END;Comilation works fine, but when I try to use the function with the following example:
SELECT pck_report.f_tabtostring(CAST(COLLECT(mytable.col1) as t_varchar2)) as column1
FROM mytable;it only returns an error ORA-00902: Unknown datatype.
When I add the package name to the datatype at the cast in the sql statement, it returns an error ORA-00903.
What is my misstake?
Thanks,
Thomas
create a global type, and not in the package :
1* create or replace type t_varchar2 is table of varchar2(100)
SQL> /
Type created.
1 CREATE OR REPLACE PACKAGE "PCK_REPORT" AS
2 FUNCTION f_tabtostring(i_varchar2 IN t_varchar2) RETURN VARCHAR2;
3* END;
SQL> /
Package created.
1 CREATE OR REPLACE PACKAGE BODY "PCK_REPORT" AS
2 FUNCTION f_tabtostring (i_varchar2 IN t_varchar2) RETURN VARCHAR2 IS
3 o_string VARCHAR2(32767);
4 BEGIN
5 FOR i IN 1 .. i_varchar2.COUNT LOOP
6 IF i != i_varchar2.FIRST THEN
7 o_string := o_string || ', ';
8 END IF;
9 o_string := o_string || i_varchar2(i);
10 END LOOP;
11 RETURN o_string;
12 END f_tabtostring;
13* END;
SQL> /
Package body created.
SQL> select col1 from mytable;
COL1
test1
test2
test3
test4
test5
test6
test7
test8
test9
test10
10 rows selected.
SQL> select pck_report.f_tabtostring(cast(collect(mytable.col1) as t_varchar2)) as col1 from mytable
COL1
test1, test2, test3, test4, test5, test6, test7, test8, test9, test10
Similar Messages
-
How to create a dimension with one level
I created a cube with some dimensions, that have only a level, and this kind of dimensions bring me some problems when I want to use "OracleBI Spreadsheet Add-In" to consult the cube.
The problem is that I canât create a hierarchy with only a level, so the dimensions are created without a hierarchy.
When I make a query in the âQuery Builderâ of "OracleBI Spreadsheet Add-In", I have some problems in the step of choosing what levels I want to select for a determined dimension, if that dimension is a dimension without a hierarchy.
What really happens is that, I can see all the values for the level in the left box, but I donât achieve to put one of these values on the right box. I can click in the next button, to jump to the next dimension, and all the process of selection for the other dimensions occurs without problems, except for the dimensions that havenât a hierarchy.
If I select only dimensions that have a hierarchy, all works perfectly, but if I select one or more dimensions that donât have a hierarchy, the following problems occur:
=> I canât select the values of the level that I want to see (only for dimensions that donât have a hierarchy)
=> When I click in âendâ button of the âQuery Builderâ, it doesnât finish and blocks.
The solution is to create a hierarchy, but I canât create a hierarchy with only a level. Is it possible to create a âtop levelâ without a source column in the dimension table? So I will have two levels, and with these two levels I can create a hierarchy that resolves the problem.
What is the solution for this problem?
Regards,
Rui TorresHow I can resolve my problem?
I donât want to use the CWM2 PL/SQL packages, because with these packages I only can create MOLAP cubes.
I only want to create ROLAP cubes, but I can't create a hierarchy with one level.
Why the "OracleBI Spreadsheet Add-In" doesnât work with dimensions, that not have hierarchies?
How I can resolve this BIG problem?
It is very URGENT!!!!
Regards,
Rui Torres -
i have never been able to migrate my ibooks library from iTunes to ibooks. Setup stops during creating ibooks library with the following error message:iBooks quit unexpectedly while creating your library.
Hello cpikehfx,
Welcome to the forums.
You can try one of the two options below to work around your issue.
Drag and drop the files from the desired music folder to the BlackBerry Music folder using the computer.
Open the desired music folder on the computer
Go into Computer or My Computer and open the BlackBerry network drive
Open the Music folder
Drag the desired music files from the computer music folder to the BlackBerry Music folder
Try a different Windows profile.
Go into the Control Panel and create a new user account
Put some music files in a folder that is accessible by all profiles or transfer them to the BlackBerry device
Log out of the current profile and log into the new profile
Transfer music into iTunes or Windows Media Player
Launch BlackBerry Link and go through the setup configuring the music source of your choice
Click on the Computer name in the bottom left corner of Link
Select Music on the left side
Drag and drop the desired music files from the list to the BlackBerry name in the bottom left corner of Link
If neither of these options work for you then you will want to contact your mobile service provider and ask that this issues be escalate to BlackBerry support for investigation.
Hope this helps. Have a good day.
-SR
Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)! -
Process all the packages with one batch
Hello
My requirement is to process all the packages with one batch. This is because recors in one package depends on the records in other packages.
I managed to implement the folowing workaround :
data are selected from the source ods and processed with one batch.
data are picked up by start routine at with package number 1,
all other packages dont pick up data :
Free RESULT_PACKAGE[].
IF datapackid = 1.
INCLUDE zbw_start_routine_incl06.
ENDIF.
My only worry that this package will be extra large (2mln records or more).
Are there any ways to process all data in one batch?
ThanksHi ,
You can increase the package size in dtp , i suppose it can be upto 50 crores .
But data load performance will be effected .
Also if data records with same keys to be in same package , you may use semantic key functionality.
Hope it helps. -
Create multiple folders with one click on documents tab in BP in SAP CRM
Hi Experts,
I have a requirement to create multiple folders by clicking on a button in Documents tab in BP transaction in CRM. In standard process by clicking on create folder button we create folders. we want to create multiple folders with one single click ( i guess we can develop another button for that) folder name will be hard coded. Kindly let me know , how this can be achieved.Hi Experts,
I have a requirement to create multiple folders by clicking on a button in Documents tab in BP transaction in CRM. In standard process by clicking on create folder button we create folders. we want to create multiple folders with one single click ( i guess we can develop another button for that) folder name will be hard coded. Kindly let me know , how this can be achieved. -
Good Day,
I'm encountering this problem
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
here's the java code
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url = "jdbc:oracle:thin:@//10.143.85.21/UCSL";
String userName = "mssoriano";
String passWord = "mssoriano_4319";
conn = DriverManager.getConnection(url, userName, passWord);
and here's my tnsnames.ora
UCSL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.143.85.21)(PORT = 1521))
(CONNECT_DATA =
(SID = psusldb11)
Please do let me know if what may the cause of the problem and how to solve this. Thank you and God bless.Hi,
see this example
Connect to Oracle DB via JDBC driver
Frank -
How can i creat several rectangles with one draw rect.vi
how can i creat several rectangles with one draw rect.vi? thanks
Solved!
Go to Solution.You can call it in a for loop, with an array of the rectangle coordinates you want to draw. Is this what you mean?
CLA, LabVIEW Versions 2010-2013
Attachments:
rectangle.png 11 KB -
Read different SV's Type with one function
Hi,
I have a several type of Shared Variables in my Biblio, and I Like to read them using one function. So I have connected the type of data of the VI " Search variable Container" to an cluster wich within I put Boolean, numeric and character string Constant . But it doesn't work
In your opinion it is possible to read several type of data with one function, Or should-I use several loops to read each type of Data?
Attachments:
Bib.JPG 12 KBYou need to show a lot more than just the fact you have 3 variables. How am I supposed to know what type they are? Post your Read VI if you can.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Listener refused the connection with the following error: ORA-12500
Hi,
We had had some difficulties with our portal lately. All of a sudden portlets failed and started givin error messages all over our webpages.
I tried to login to EM Console to try and restart Portal OC4J and got this error
An error was encountered while loading page. An error occurred when attempting to connect to the Database.
Resolution:
Make sure that the database and listener are up.
If the database is up, make sure that the OracleAS Repository API files ias.properties and iasschema.xml are correctly configured.
If necessary, use the EM Console to reconfigure the host, user name and password associated with the database
Base Exception:
java.sql.SQLException
Listener refused the connection with the following error:
ORA-12500, TNS:listener failed to start a dedicated server process
The Connection descriptor used by the client was:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PORTAL.MSS.EDUS.SI)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ASDB.MSS.EDUS.SI)))
. Listener refused the connection with the following error:
ORA-12500, TNS:listener failed to start a dedicated server process
The Connection descriptor used by the client was:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PORTAL.MSS.EDUS.SI)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ASDB.MSS.EDUS.SI)))
In ..INF/network/sqlnet.log
Fatal NI connect error 12500, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=portal.mss.edus.si)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=asdb.mss.edus.si)(CID=(PROGRAM=I:\Oracle\INF\Apache\Apache\Apache.exe)(HOST=CLUSTER1)(USER=SYSTEM))))
VERSION INFORMATION:
TNS for 32-bit Windows: Version 10.1.0.4.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 10.1.0.4.0 - Production
Time: 11-JUN-2007 13:00:24
Tracing not turned on.
Tns error struct:
ns main err code: 12564
TNS-12564: TNS:connection refused
ns secondary err code: 0
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
After restart everything works as normal. Any ideas what went wrong, or where to look for some additional answers?Ora12500 means your OS has run out of resources, so you cannot start a process on the Server Side. Post the complete error stack, the last lines show further information to troubleshoot this error.
-
Listener refused the connection with the following error: ORA-12500, TNS:li
I got this error when I use EM, or sqlplus:
Listener refused the connection with the following error: ORA-12500, TNS:listener failed to start a dedicated server process
when I do
$lsnrctl status:
here is the result
Service "abc.def.com" has 3 instance(s).
Instance "dbtest", status UNKNOWN, has 1 handler(s) for this service...
Instance "dbtest", status BLOCKED, has 1 handler(s) for this service...
Instance "dbtest", status READY, has 1 handler(s) for this service...
please help. Thanks.Ora12500 means your OS has run out of resources, so you cannot start a process on the Server Side. Post the complete error stack, the last lines show further information to troubleshoot this error.
-
How to create editable table with one empty row ?
I'm looking for solution how to create editable table with one empty row using ADF BC. I have seen this solution in application that was created in JHeadstart and it's very well idea to use it insead of creation form.
hammm, i do it this:
drop the VO on the page, select Table->ADF Table....
so, drop the botton create, from de VO->operations->create (the firts), and right botton (mouse) Edit binding....
in Data collection select the VO, in Select an action select CreateInsert
luck -
Listener refused the connection with the following error: ORA-12505
Hello,
Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was: 127.0.0.1:1521:XE Windows XP + Oracle 10.1.0.20
I checked my *.ora files and found the host 127.0.0.1 but I noted by running netstat command on dos prompt that most of my ports are captured by www.360.cn including 1521
when am trying to shutdown then the following message appears:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not existsThanks & best regardsHi,
[oracle@myoramachine ~]$ oerr ora 12505
12505, 00000, "TNS:listener does not currently know of SID given in connect descriptor"
// *Cause: The listener received a request to establish a connection to a
// database or other service. The connect descriptor received by the listener
// specified a SID for an instance (usually a database instance) that either
// has not yet dynamically registered with the listener or has not been
// statically configured for the listener. This may be a temporary condition
// such as after the listener has started, but before the database instance
// has registered with the listener.
// *Action:
// - Wait a moment and try to connect a second time.
// - Check which instances are currently known by the listener by executing:
// lsnrctl services <listener name>
// - Check that the SID parameter in the connect descriptor specifies
// an instance known by the listener.
// - Check for an event in the listener.log file.
[oracle@myoramachine ~]$1. Check lsnrctl services <listener name>
2. Check tnsping output:
tnsping MYORACLE
3. Check connectivity to the machine where your Oracle Server resides to port ( I assume 1521):
telnet <your_machine> 1521
4. In case you're not able to connect to the Oracle Server - I'd investigate it in a few directions:
- network infrastructure problem
- some disturbing process(es) / virus(es) on Oracle Server itself
- firewall issue
Good luck!
http://dba-star.blogspot.com/ -
From sql developer I am trying to connect to database in my local machine. It shows the following below error. Any suggestions?
An error was encountered performing the requested operation:
Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
Vendor code 12505lsnrctl results are as shown below
C:\Users\ndodd_000>lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 18-AUG-2013 17:40
:25
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date 18-AUG-2013 15:29:41
Uptime 0 days 2 hr. 10 min. 50 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\ndodd_000\product\11.2.0\dbhome_1\network\admin
\listener.ora
Listener Log File c:\app\ndodd_000\diag\tnslsnr\Vamsi\listener\alert\log
.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "sysdba" has 1 instance(s).
Instance "sysdba", status READY, has 1 handler(s) for this service...
Service "sysdbaXDB" has 1 instance(s).
Instance "sysdba", status READY, has 1 handler(s) for this service...
The command completed successfully
lsnrctl service results
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 18-AUG-2013 17:
:20
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "sysdba" has 1 instance(s).
Instance "sysdba", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:186 refused:0 state:ready
LOCAL SERVER
Service "sysdbaXDB" has 1 instance(s).
Instance "sysdba", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: VAMSI, pid: 904>
(ADDRESS=(PROTOCOL=tcp)(HOST=Vamsi)(PORT=49237))
The command completed successfully -
Listener refuse connection with the following error ORA-12505
Hi Everyone, Am really new to oracle database, am working on my school project work and am stuck in a middle of this error (Listener refuse connection with the following error ORA-12505).
I have started the listener serveral time and it's saying that "No service surpported by the LISTENER", I can't access the database via sqldeveloper which trows out the same error (Listener refuse connection with the following error ORA-12505, TNS:Listener does not currently know of SID given in connect descriptor.) Moreover my em show red down arrow for the listener. Here are my hard & software details.
Oracle 11.1.0
Os: Red Hat Enterprise Linux 4 ( Running the OS via Vmware workstation)
TNSNAME.ORA
LISTENER2=
(DESCRIPTION_LIST=
(DESCRIPTION=
((ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1522))
LISTENER1=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1523))
LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))
Listner,ora
LISTNER_ORCL
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1523))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))
IMT_ADMI=
(DESRIPTION=
(PORT=1522))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1522))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1523))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=imt_admin
LISTENER_IMTADMIN=
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1522))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1523))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))
ORCL=
(DESCRIPTION=
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1523))
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=orcl)
I read from some forums that I need to edit somethings of which am not really sure cos i don't wanna mess with the database, I need help on what to.
Thanks for help in advance.Use a single listener. There is no need for multiple listeners 99.9999% of the time.
Have the listener bind the hostname as listening end-point - and not localhost.
Localhost only allows local processes to connect via TCP. Which is questionable in most environments. Typically you would run clients on other h/w platforms (or VMs) - and this will use the database server's public IPs.
Type hostname in the console to get the hostname of the server. If the network on that server is suspect (was not manually setup properly by someone knowing network basics), do not bother using the hostname. Use IP address +0.0.0.0+ instead.
Update the listener.ora file. The LISTENER entry should look something as follows:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTERNAL)))
(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = <hostname-goes-here>)(PORT = 1521)))
)You can also simply (and safely) remove/rename the listener.ora file - and start the listener with sane defaults.
Next, use sqlplus (via the oracle o/s user) to logon as SYSDBA to the database. The database parameter of interest is LOCAL_LISTENER. It should be null (view it using the SQL*Plus command <i>show parameter</i>). If your listener port is 1521, then not a problem.
If it is not, you need to update/set this parameter with the appropriate port number via the ALTER SYSTEM command.
Once set/checked, manually instruct the database to register its services with the local listener, via the alter system register command in sqlplus.
Check and confirm that the listener has received and successfully serviced that registration request by typing lsnrctl services in the oracle o/s console.
PS. The reason for the error I think is that your are forcing the listener on localhost only - while the default/null local_listener parameter of the database instructs it to contact the listener on the default public IP address of that server. Which does not happen to be localhost IP 127.0.0.1.
Edited by: Billy Verreynne on Jan 11, 2013 1:06 PM -
How do you create a package for a function?
Hello,
Can someone tell me how to create a package for a function? My understanding is to call a function like a beforeReport from the data template, is that the function needs to be in a package.
Thanks,
SusanCreate package my_pack as
my_val varchar2(40);
function before_rep(my_param in varchar2) return boolean;
end my_pack;
create package body my_pack as
function before_rep(my_param in varchar2) return boolean is
begin
my_val := '1=1';
return true;
exception
when others then
return false;
end before_rep;
end my_pack;
hope this helps.
Marcos
Maybe you are looking for
-
I am trying to outline a shape (and a few more things while creating a logo). To try to keep it simple, I'll restrict this discussion to this. First some background: I scanned an object (my shape) sucessfully changed the color. I have the shape plu
-
Client reconnection to conventional cluster taking about 9 minutes
Hi, I've set up a 3 node OpenMq (4.4) conventional cluster and am having trouble with client reconnections when I simulate a halt on a node. I have two threads within the same process, sending to a pre-configured destination and replying using a temp
-
Chinese ADA PDF Not Reading Correctly.
I have a brochure that was originally created in InDesign that I'm trying to make accessible in Acrobat Pro X. When Acrobat "reads" the PDF, it seems to be reading the keystrokes instead of Chinese. I am using Mac OSX. Can this be fixed?
-
Downloaded iOS8. Now phone crashes and wont go into recovery.
Hi All, I updated my Itunes and downloaded iOS 8. When I plugged the phone in and selected update phone, it started updating, and then said there was an error. The phone just keeps crashing and the screen goes all different colors and fades out. Wont
-
Hi All, I'm from BW background. We are pulling some Maintainence Orders data based on Currency Type (ex-10, 20 which are Company code and Controlling currency type). Where in SAP can I see thisCurrency type. I have the Accounting Document numbers. Pl