Can't get my plsql working, ORA-05602 error
Hello all, I am experiencing an issue with my plsql and I have check all my variables and it seems to be hidden from my eyes. This is my package:
create or replace package body PKG_TESTSTR is
type segment is record (
bbold boolean,
bundr boolean,
bital boolean,
bleft boolean,
brigh boolean,
bcent boolean,
bjust boolean,
btipo varchar2(1),
text VARCHAR2(32767));
type LSEGMENTS is TABLE OF segment index by pls_integer;
function splitSegments2(input VarChar2) return LSEGMENTS
Is
l_idx pls_integer;
bbold boolean := false;
bundr boolean := false;
bital boolean := false;
bleft boolean := false;
brigh boolean := false;
bcent boolean := false;
bjust boolean := false;
btipo varchar2(1);
info VarChar2(32767);
i pls_integer := 0;
segments LSEGMENTS;
Begin
info := input;
loop
l_idx := instr(info,'<');
i := i + 1;
segments(i).bbold := bbold;
segments(i).bundr := bundr;
segments(i).bital := bital;
segments(i).bleft := bleft;
segments(i).brigh := brigh;
segments(i).bcent := bcent;
segments(i).bjust := bjust;
segments(i).btipo := btipo;
if l_idx > 0 then
if upper(substr(info,l_idx+1,2)) = 'B>' then
if bbold then raise_application_error(-20010, 'B'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bbold := true;
info := substr(info,l_idx+3);
btipo := 'F';
elsif upper(substr(info,l_idx+1,2)) = 'I>' then
if bital then raise_application_error(-20010, 'I'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bital := true;
info := substr(info,l_idx+3);
btipo := 'F';
elsif upper(substr(info,l_idx+1,2)) = 'U>' then
if bundr then raise_application_error(-20010, 'U'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bundr := true;
info := substr(info,l_idx+3);
btipo := 'F';
elsif upper(substr(info,l_idx+1,15)) = 'P ALIGN="LEFT">' then
if bleft then raise_application_error(-20010, 'P LEFT'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bleft := true;
info := substr(info,l_idx+16);
btipo := 'A';
elsif upper(substr(info,l_idx+1,16)) = 'P ALIGN="RIGHT">' then
if brigh then raise_application_error(-20010, 'P RIGHT'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
brigh := true;
info := substr(info,l_idx+17);
btipo := 'A';
elsif upper(substr(info,l_idx+1,17)) = 'P ALIGN="CENTER">' then
if bcent then raise_application_error(-20010, 'P CENTER'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bcent := true;
info := substr(info,l_idx+18);
btipo := 'A';
elsif upper(substr(info,l_idx+1,18)) = 'P ALIGN="JUSTIFY">' then
if bjust then raise_application_error(-20010, 'P JUSTIFY'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bjust := true;
info := substr(info,l_idx+19);
btipo := 'A';
elsif upper(substr(info,l_idx+1,3)) = '/B>' then
if not bbold then raise_application_error(-20010, '/B'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bbold := false;
info := substr(info,l_idx+4);
elsif upper(substr(info,l_idx+1,3)) = '/I>' then
if not bital then raise_application_error(-20010, '/I'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bital := false;
info := substr(info,l_idx+4);
elsif upper(substr(info,l_idx+1,3)) = '/U>' then
if not bundr then raise_application_error(-20010, '/U'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bundr := false;
info := substr(info,l_idx+4);
elsif upper(substr(info,l_idx+1,3)) = '/P>' and bleft then
if not bleft then raise_application_error(-20010, '/P LEFT'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bleft := false;
info := substr(info,l_idx+4);
elsif upper(substr(info,l_idx+1,3)) = '/P>' and brigh then
if not brigh then raise_application_error(-20010, '/P RIGHT'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
brigh := false;
info := substr(info,l_idx+4);
elsif upper(substr(info,l_idx+1,3)) = '/P>' and bcent then
if not bcent then raise_application_error(-20010, '/P CENTER'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bcent := false;
info := substr(info,l_idx+4);
elsif upper(substr(info,l_idx+1,3)) = '/P>' and bjust then
if not bjust then raise_application_error(-20010, '/P JUSTIFY'); end if;
if l_idx = 1 then
i := i - 1;
else
segments(i).text := substr(info,1,l_idx-1);
end if;
bjust := false;
info := substr(info,l_idx+4);
else
segments(i).text := substr(info,1,l_idx);
info := substr(info,l_idx+1);
btipo := 'T';
end if;
else
segments(i).text := info;
exit;
end if;
end loop;
return segments;
End;
function generateReportsTags(input Varchar2) return Varchar2
Is
segments LSEGMENTS;
resp varchar2(32767);
--resp long;
bold boolean := false;
alin boolean := false;
tipo varchar2(1);
y number;
Begin
dbms_output.put_line('Iniciando execucao');
y := 0;
segments := splitSegments2(input);
dbms_output.put_line('Passou pelo split');
for i in segments.first .. segments.last loop
if i = 1 then
resp := '<report>' || chr(13) || chr(10);
resp := resp || '<layout>' || chr(13) || chr(10);
resp := resp || '<section name="main">' || chr(13) || chr(10);
resp := resp || '<body>' || chr(13) || chr(10);
resp := resp || '<frame name="M_1">' || chr(13) || chr(10);
resp := resp || '<geometryInfo x="0.00000" y="0.00000" width="7.12500" height="3.00000"/>' || chr(13) || chr(10);
resp := resp || '<generalLayout verticalElasticity="variable"/>' || chr(13) || chr(10);
resp := resp || '<text name="B_1" minWidowLines="1">' || chr(13) || chr(10);
resp := resp || '<textSettings spacing="single"/>' || chr(13) || chr(10);
end if;
if nvl(tipo,' ') <> ' ' and nvl(tipo,' ') <> nvl(segments(i).btipo,' ') then
resp := resp || '</text>' || chr(13) || chr(10);
resp := resp || '<text name="B_1" minWidowLines="1">' || chr(13) || chr(10);
end if;
if segments(i).btipo in ('A') then
if segments(i).brigh then
resp := resp || '<textSettings justify="end" spacing="single"/>' || chr(13) || chr(10);
elsif segments(i).bcent then
resp := resp || '<textSettings justify="center" spacing="single"/>' || chr(13) || chr(10);
elsif segments(i).bjust then
resp := resp || '<textSettings justify="flush" spacing="single"/>' || chr(13) || chr(10);
elsif segments(i).bleft then
resp := resp || '<textSettings justify="start" spacing="single"/>' || chr(13) || chr(10);
end if;
end if;
if i = 1 then
y := 0.00000;
resp := resp || '<geometryInfo x="0.06250" y="0.00000" width="7.00000" height="0.75000"/>' || chr(13) || chr(10);
resp := resp || '<generalLayout verticalElasticity="variable"/>' || chr(13) || chr(10);
elsif nvl(tipo,' ') <> ' ' and nvl(tipo,' ') <> nvl(segments(i).btipo,' ') then
y := y + 0.75000;
--width="7.06250"
resp := resp || '<geometryInfo x="0.06250" y="'|| to_char(y + 0.00000, '0.00000') ||'" width="7.00000" height="0.75000"/>' || chr(13) || chr(10);
resp := resp || '<generalLayout verticalElasticity="variable"/>' || chr(13) || chr(10);
end if;
resp := resp || '<textSegment>' || chr(13) || chr(10);
if segments(i).bbold then
resp := resp || ' bold="yes"';
end if;
if segments(i).bital then
resp := resp || ' italic="yes"';
end if;
if segments(i).bundr then
resp := resp || ' underline="yes"';
end if;
resp := resp || '/>' || chr(13) || chr(10);
resp := resp || '<string>' || chr(13) || chr(10);
resp := resp || '<![CDATA[';
resp := resp || segments(i).text;
resp := resp || ']]>' || chr(13) || chr(10);
resp := resp || '</string>' || chr(13) || chr(10);
resp := resp || '</textSegment>' || chr(13) || chr(10);
if (bold = true or alin = true) then
bold := false;
alin := false;
end if;
tipo := segments(i).btipo;
if i = segments.last then
resp := resp || '</text>' || chr(13) || chr(10);
resp := resp || '</frame>' || chr(13) || chr(10);
resp := resp || '</body>' || chr(13) || chr(10);
resp := resp || '</section>' || chr(13) || chr(10);
resp := resp || '</layout>' || chr(13) || chr(10);
resp := resp || '</report>' || chr(13) || chr(10);
end if;
end loop;
return resp;
End;
procedure splitSegments(input VarChar2)
Is
segments LSEGMENTS;
function Prin (bbold boolean, bundr boolean, bital boolean, bleft boolean, brigh boolean, bcent boolean, bjust boolean) return VarChar2
Is
resp VarChar2(3) := '';
begin
if bbold then resp := resp || 'B'; end if;
if bundr then resp := resp || 'U'; end if;
if bital then resp := resp || 'I'; end if;
if bleft then resp := resp || 'P'; end if;
if brigh then resp := resp || 'P'; end if;
if bcent then resp := resp || 'P'; end if;
if bjust then resp := resp || 'P'; end if;
return resp;
end;
Begin
segments := splitSegments2(input);
for i in segments.first .. segments.last loop
dbms_output.put_line(prin(segments(i).bbold, segments(i).bundr, segments(i).bital, segments(i).bleft, segments(i).brigh, segments(i).bcent, segments(i).bjust) || ' : ' || segments(i).text);
end loop;
End;
end PKG_TESTSTR;I am getting an ORA-05602 error, and then an ORA-05612 at line 3 when I try to use and input with more than 4000 chars. Is this the problem?? I have changed all my varchar2 variables to get 32767 chars but i am still facing the same error.
What I am possible doing wrong?
Many thanks for all replies
Thiago Locatelli
That would be a bit of a problem once I cant get the part where it is raising such error. I have put dbms_output for debug, but everything goes in the outpout window but the error occurs.
I am using plsql/developer to test the function...
Similar Messages
-
Why do I get a message, "You do not have enough access privileges for this operation"? This has not been a problem before.
Hello wdesertman,
Thank you for contacting Apple Support Communities.
This article explains what is going on and how to correct it:
support.apple.com/kb/TS1277
http://support.apple.com/kb/TS1277
Regards,
Jeff D. -
Can't get EM to work on Oracle 10.2.0.5 running on Windows 2008 R2 64 bit
Hi
Could anyone help me?
I have tried many things and tried lots of htings other forums have suggested but I can't get EM to work.
The dbconsole windows services hang on startup, if I do a emctl start dbconsole after setting my sid it returns 3 lines of ......., hangs and then gives an error of 1.
I have dropped and re-created the repository, I can now login to EM on the correct HTTP port listed in my portlist.ini. But its as though it can't see the instance, it shows a status of pending and a java error of java.lang.Exception: Exception in sending Request :: null at the database homepage.
The log file for EMCA shows the same error to do with not finding files i the OCJJ directory, but I can browse and see all the files through Windows. Coudl this be some java issue? I have the latest versio of Java installed and have tried reinstalling EM using the OUI.
The error that appears in the log file is listed below, its the same error repeated but referrs to differan't files in the same DIR.
\OC4J_DBConsole_.HOSTNAME_SID\config\jms.xml in searching for tag jms-server with attribute port
java.io.FileNotFoundException: c:\oracle\product\10.2.0\db_1\oc4j\j2ee\OC4J_DBConsole_HOSTNAME_SID\config\jms.xml (The system cannot find the path specified)
Edited by: user8797813 on 17-May-2011 01:56It made no differance, now get the following error in the emoms.log
4_/console/database/instance/sitemap] ERROR perf.sitemap initializeGeneral.400 - Failed to initialize object: ORA-20206:
ORA-06512: at "SYSMAN.EMD_DATABASE", line 1165
ORA-01403: no data found
ORA-06512: at line 1
2011-05-17 08:51:04,722 [MetricCollector:HOMETAB_THREAD600:60] ERROR rt.DbMetricCollectorTarget _getAllData.328 - oracle.sysman.emSDK.emd.comm.CommException: Exception in sending Request :: null
oracle.sysman.emSDK.emd.comm.CommException: Exception in sending Request :: null
at oracle.sysman.emSDK.emd.comm.EMDClient.getResponseForRequest_(EMDClient.java:1330)
at oracle.sysman.emSDK.emd.comm.EMDClient.getResponseForRequest(EMDClient.java:1223)
at oracle.sysman.emSDK.emd.comm.EMDClient.getMetrics(EMDClient.java:640)
at oracle.sysman.emo.perf.metric.rt.DbHomeTab._getAllData(DbHomeTab.java:324)
at oracle.sysman.emo.perf.metric.rt.DbHomeTab.getData(DbHomeTab.java:139)
at oracle.sysman.emo.perf.metric.eng.MetricCached.collectCachedData(MetricCached.java:402)
at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread._collectCachedData(MetricCollectorThread.java:596)
at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread.run(MetricCollectorThread.java:320)
at java.lang.Thread.run(Thread.java:595)
2011-05-17 08:51:04,737 [MetricCollector:HOMETAB_THREAD600:60] ERROR rt.DbMetricCollectorTarget _getAllData.328 - oracle.sysman.emSDK.emd.comm.CommException: Exception in sending Request :: null
oracle.sysman.emSDK.emd.comm.CommException: Exception in sending Request :: null
at oracle.sysman.emSDK.emd.comm.EMDClient.getResponseForRequest_(EMDClient.java:1330)
at oracle.sysman.emSDK.emd.comm.EMDClient.getResponseForRequest(EMDClient.java:1223)
at oracle.sysman.emSDK.emd.comm.EMDClient.getMetrics(EMDClient.java:640)
at oracle.sysman.emo.perf.metric.rt.DbHomeTab._getAllData(DbHomeTab.java:324)
at oracle.sysman.emo.perf.metric.rt.DbHomeTab.getData(DbHomeTab.java:139)
at oracle.sysman.emo.perf.metric.eng.MetricCached.collectCachedData(MetricCached.java:402)
at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread._collectCachedData(MetricCollectorThread.java:596)
at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread.run(MetricCollectorThread.java:320)
at java.lang.Thread.run(Thread.java:595)
2011-05-17 08:52:04,610 [MetricCollector:HOMETAB_THREAD600:60] ERROR rt.DbMetricCollectorTarget _getAllData.328 - oracle.sysman.emSDK.emd.comm.CommException: Exception in sending Request :: nul -
Can't get OCISvcCtxToLda to work
I'm hacking PERL DBD::Oracle to be able to
switch from OCI 8 to OCI 7 and back. This
effort is mostly to keep old code that is
blob_read()ing LONGs working and at the same
time be able to read CLOBs while the database
is in transition. So far so good, except when
I call OCISvcCtxToLda, I get:
ORA-24323: value not allowed
Sample code that uses OCISvcCtxToLda would
be an enormous help.Re: Can't get Mic to work? I'm using the Steelseries Siberias headset, with a standalone Zalman mic. I never unplugged them, I only reformatted from a cracked verion of Windows 7, to a legit version of Windows 7. The versions were actually the exact same, and now I regreat Formatting.
Here are some of My PC's Specs
http://img9.imageshack.us/i/specsq.png/
I'm using the ATI Radeon 4870
Creative XtremeGamer
http://img704.imageshack.us/i/sound.png/
http://img684.imageshack.us/i/drivers.png/
I've just gottren really frusterated. I'm about ready to go back down to XP just to get this to work, I use my microphone for so many different things.
I've searched this problem, it seems there are numerous people with the same problems, and I just find that sad, I've been using creative products for a long time now, and have never had a problem like this before. -
Have entrourage and want to use Mail. Can't get it to work.
I had a macbook and purchased the Microsoft office for Mac which included Entrourage.
I have now purchased a new macbook Pro and want to begin to use Mail rather than Entrourage.
I have Entrourage on my new computer but i can't get it to transfer my information to the the Mail program
I am on Charter.net at my office and sbcglobal.net at home.
How can i get this to work. I can receive on Mail, but i can't send.check your outgoing port settings and make sure it's using a specific port and not the default port, also you might want to check to see if it is using SSL, TLS or any other encryption. Verify the setting from your old machine setup.
-
got my password wrong twice and my mini is disable. I connected to iTunes, but can't get it to work. Can some one guide my through?
If it's showing the red disabled screen due to incorrect passcodes then you may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808 - you should then be able to reset the iPad via your computer's iTunes and restore/resync your content to it
-
HT1151 i have a new apple external dvd drive, and i can't get it to work with my iMac?
I have a new apple dvd drive, I was told it will work with my imac, but when i plug it in ...nothing... iv been for update... still nothing. How can i get it to work???
If it is this drive, note that it is for MBA's and Mini's only:
http://store.apple.com/us/product/MC684ZM/A
Ciao. -
Is there a way to reset my messages account, I can't get iMessage to work on IPad nor Mac osx. Help please this is really frustrating.
Hi,
Is there an iPhone involved ?
If not, what happens if you remove the Apple ID on the iPad and then set it in Airplane Mode (allow a couple of minutes at this point) followed by re-adding the Apple ID ?
What, if any error messages are appearing on the Mac when you try to launch the App or Login to the iMessages server ?
Is the Apple ID linked to an iCloud account ?
In Messages 7 (Mountain Lion) this did not seem to be important but it seems it is in Mavericks/Messages 8
9:14 pm Friday; April 11, 2014
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad -
I bought an IR receiver and an Apple Remote, and I can't get it to work. What am I doing wrong? The receiver is a Lenovo eHome OVU430006/01 USB IR Receiver.
Hello,
You would need to pair the Apple Remote with the receiver. So I would use the generic Mac/PC receiver and follow these instructions:
http://support.apple.com/kb/HT1619
If that doesn't work then check in System Profiler to see if the IR receiver has been recognized by the PowerBook's hardware. You may require the install of drivers for this device to be recognized.
Best of luck -
I have a go daddy email account and I can't get it to work on my iPad
I have a go daddy email account and I can't get it to work on my iPad
Try turning the email account off and then turn it on again. Settings>Mail, Contacts, Calendars>select your gmail account>Off. Go to the mail app and then come back to the account in the settings and turn it on again.
If you can't find any other way for the iPad to accept the password, delete the email account and then add it back onto the iPad. -
I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161. Any ideas?
I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161. Any ideas?
The latest Apple driver support begins with the MP 171.
Here is Ricoh's official driver download page specifically for the Afico MP 161. Note that new drivers for this device were released on Aug 2, and include Lion and Mountain Lion.
Hopefully, this will solve your device issues. -
Iphone 5 went black. Tried pushing on/off and circle at the same time. Worked yesterday and then did it again today. Can't get it to work.
You need to hold those button longer until you see the apple logo, then release, then wait for the phone to boot back up.
-
I just bought a new computer and had files transferred along with itunes to the new computer. I can't get it to work. It doesn't recognize the extensions for itunes. I also tried downloading Quicktime and couldn't get it to download.
iOS: Device not recognized in iTunes for Windows
I would start with:
Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7 -
I bought a DATAPILOT to transfer pictures to my macbook and can't get it to work. Any suggestions please?
Best if you try and explain what you are trying to acheive.
Iphoto is a different paradigm than you're used to. I don't understand why you are trying to transfer your edited photos back to an external disk.
There are tutorials here
http://www.apple.com/findouthow/photos/
Regards
TD -
I have signed up for adobe conversion to microsoft word and i can't get it to work - can you help me
I have signed up for adobe conversion to microsoft word and I can not get it to work - can you help me?
Hi Mike,
I've checked your account. I see that you just purchased the subscription this morning. The order is still pending processing, which is why you haven't yet been able to log in an use your subscription. It can take 24-48 hours for a subscription to process fully. Once it does, you'll be able to log in and convert files.
I apologize for the inconvenience.
Best,
Sara
Maybe you are looking for
-
Why cant I drag and drop photos onto my iPhone in iPhoto?
I just want to put some photos on my iPhone!
-
Change GL Account and 'SET' EXKN
I get the syntax error 'Null Value' where the code is commented below when trying to use the chosen interface. I am trying to change and 'SET' the value of LS_ACCT-SAKTO, in the GL Account Number. I know it thinks the interface doesn't exist. Is i
-
Bluetooth keyboard lags 15 secs after application switching?
Doesn't matter what bluetooth keyboard I use. Doesn't matter if I switch between apps by keyboard or mouse. Keyboard seems to remember all keystrokes, and spits them all out after 15 secs or so, but remains frozen until then. Computer fine in every o
-
Designing ABAP webdynpro to XI
Hi I want to design an ABAP webdynpro with two fields; one field with an ID and another field to display a result. I enter the filename/ID then XI fetches the file and returns the content to display in Webdynpro. Please do the needfull. Regards, Varu
-
Orphaned Quicktime File on desktop
Whenever I launch a Final Cut Pro project a random 4k .mov file appears on my desktop. It wont open and when I try to throw it away it says it is in use. Any ideas?