Why the prefix names of variables with a colon?
PROCEDURE calc_avg_salesBEGIN
: sales.avg: =: sales.month1 /: sales.total;
EXCEPTION WHEN ZERO_DIVIDE THEN
: sales_avg: = 0;
RAISE FORM_TRIGGER_FAILURE;
WHEN OTHER THEN NULL;
END;
Excerpt of Oracle PL/SQL programming ISBN 0-596-00381-1 p. 106
Why are the variables: sales.avg,: sales.month1 and: sales.total undeclared in the snippet above? He assumes that she is? Why is a: (colon) is placed in front of the variables?
Why would you think that FORM_TRIGGER_FAILURE is triggered instead of ZERO_DIVIDE?
In my production environment, I noticed that error messages are sometimes vague to the user and for technical users and would like to make use of a table of errors that would contribute to technical support to troubleshoot the cause of the error, without giving unnecessary details to the end user. Ideally, this would include details of Java Exceptions raised (usually large fireplaces) in applications that are part of the software architecture. How would you with a mechanism for error handling?
Published by: Jon80 on June 24, 2012 14:02
Hello
Jon80 wrote:
PROCEDURE calc_avg_sales
BEGIN
: sales.avg: =: sales.month1 /: sales.total;
EXCEPTION WHEN ZERO DIVIDE THEN
: sales_avg: = 0;
RAISE FORM_TRIGGER_FAILURE;
WHEN OTHER THEN NULL;
END;Excerpt of Oracle PL/SQL programming ISBN 0-596-00381-1 p. 106
Why are the variables: sales.avg,: sales.month1 and: sales.total undeclared in the snippet above? He assumes that she is? Why is a: (colon) is placed in front of the variables?
Variables that start with an act of colon as global variables; they can be defined in a broader scope. The colon helps the compiler identify as being not necessarily defined in the unit being compiled.
Why would you think that FORM_TRIGGER_FAILURE is triggered instead of ZERO_DIVIDE?
In fact, I expect PLS-00103 encountered the symbol "DIVIDE" when waiting for the following..., because you have a space (DIVIDE ZERO) instead of a line of underscores (ZERO_DIVIDE). Cut and paste real code when posting here.
If you fix that, then ZERO_DIVIDE is thrown in the procedure. An EXCEPTION handler keeps some errors that occur at the time reported to the caller. In this case, the EXCEPTION handler is not said "the ZERO_DIVIDE report as an error. Instead, cela... ». In this example, part of what he does on the contrary raises a different error, and it is the only error appearing on the appellant.
Furthermore, "while some OTHER THEN NULL" is almost always a very bad thing to say.
In my production environment, I noticed that error messages are sometimes vague to the user and for technical users and would like to make use of a table of errors that would contribute to technical support to troubleshoot the cause of the error, without giving unnecessary details to the end user. Ideally, this would include details of Java Exceptions raised (usually large fireplaces) in applications that are part of the software architecture. How would you with a mechanism for error handling?
One thing that is oracle is often of short error messages, wave print-screen, but write long posts, detailed in trace files on the database server. Programmers are educated to search a trace file when they see some error messages. You could do something similar. Instead of (or in addition to) burn of trace files, you can insert rows in a table of logging of errors.
Tags: Database
Similar Questions
-
Why the titles are not saved with the project? Where are they?
CS5 PC.
Why the titles are not saved with the project? Where are they? I can save them with the project?
You can also configure a project basis including all titles. When it's time to start a new project, open the template and change the name before starting to work. In this way all the foundations are in place without having to implement the project with these basics every time.
-
Why the iPad is not compatible with Amazon Pro premium?
DDoes anyone know why the Pro is not compatible with Amazon prime? I can get the first one on my iPad two old as well as my partners air2.
Strange, isn't it?
-
Our company recently purchased Adobe Acrobat Pro XI intended to be used for shared electronic reviews. We use the send for shared review in Adobe Acrobat Pro XI, and all the comment tools work as expectedexcept the trombone in Annotations.
When a Word or Excel or Image (png, jpeg) file is attached using the trombone of Annotations, the initiator may initially see and open. But once feedback is enabled and the review file is closed, the file 'Name' becomes 'Unknown' (even if the Description is the correct file name and extension). Change information are unknown, such as size and compressed size.
When the control file is then reopened, even the initiator cannot open the file, although:
- The location of the file is marked with the paper clip in the document.
- The file name is displayed in the list of comments with the name of the initiator.
- In the list of attachments (the paper clip under the thumbnails and bookmarks), the name appears as unknown, shows the file name Description, update is unknown, the size is unknown and compressed size is unknown.
The file name cannot be published, although the Description file can be.
We have followed the procedure described in the tutorials but may not know how to resolve this situation. As this feature was the reason for the purchase of Adobe Acrobat Pro IX, we would any help. Please leave out the basics because we are new users.
We have several people with Adobe Acrobat Pro XI and the rest have Adobe Reader XI is a Windows platform. Can someone please give us some advice how to get this function runs as described?
The bug is fixed in the latest Adobe Acrobat Pro XI 11.0.09 update (update: in Acrobat Pro, go to help-> Check for Updates...).
-Rohit Sharma
-
The use of bind variables with XMLTABLE?
I tried to use bind variables with xmltable statement. Here, my unit test:
create or replace function wsdltest return xmltype as
l_dummy xmltype.
CLOB l_stt;
L_Name varchar2 (500);
CLOB l_xml;
BEGIN
l_xml: =.
' < name of definitions = 'F1' targetNamespace = "http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns = "http://schemas.xmlsoap.org/wsdl/" xmlns:tns = "http://xmlns.oracle.com/orawsv/XFILES/F1" container = "http://www.w3.org/2001/XMLSchema" xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/" >
< types >
< xsd: Schema targetNamespace = "http://xmlns.oracle.com/orawsv/XFILES/F1" elementFormDefault = "qualified" >
< xsd: element name = "SVARCHAR2-F1Input" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "A VARCHAR2 IN" type = "xsd: String" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "F1Output" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "RETURN" type = "xsd: String" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: Schema >
< / types >
< name of message = "F1InputMessage" >
< name of part = "parameters" element = "tns:SVARCHAR2 - F1Input" / >
< / message >
< name of message = "F1OutputMessage" >
< name of part = "parameters" element = "tns:F1Output" / >
< / message >
< portType name = "F1PortType" >
< operation name = "F1" >
< input message = "tns:F1InputMessage" / >
< output message = "tns:F1OutputMessage" / >
< / operation >
< / portType >
< connection name = "F1Binding" type = "tns:F1PortType" >
< style: binding soap = transport "document" = "http://schemas.xmlsoap.org/soap/http" / >
< operation name = "F1" >
< soap: operation soapAction = "F1" / >
< input >
< soap body parts: = 'settings' use = "literal" / >
< / Entry >
< output >
< soap body parts: = 'settings' use = "literal" / >
< / output >
< / operation >
< / binding >
< service name = "F1Service" >
< documentation > Oracle Web Service < / documentation >
< name of port = "F1Port" binding = "tns:F1Binding" >
< soap: address location = "http://localhost: 8080/orawsv/XFILES/F1" / >
< / port >
< / service >
< / definitions > ';
-OK
l_stt: = ' select * from xmltable (XMLNAMESPACES ("http://www.w3.org/2001/XMLSchema" AS "XSD", default "http://schemas.xmlsoap.org/wsdl/"),)
[' / / definitions/types/XSD:schema/XSD:element[@name="SVARCHAR2-F1Input ']"
by the way xmltype(:1)
columns
path of xmltype AB ".") you;
--
EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml;
-ERROR ORA-01006
L_Name: = ' 'SVARCHAR2-F1Input "";
l_stt: = ' select * from xmltable (XMLNAMESPACES ("http://www.w3.org/2001/XMLSchema" AS "XSD", default "http://schemas.xmlsoap.org/wsdl/"),)
[/ / definitions/types/XSD:schema/XSD:element[@name=:2] "
by the way xmltype(:1)
columns
path of xmltype AB ".") you;
--
EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml, l_name;
Return l_dummy;
END;
Any idea?
Thanks in advance
CyrylYou can try something like
declare l_dummy xmltype; l_stt clob; l_name varchar2(500); l_xml clob; BEGIN l_xml := '
Oracle Web Service -
How can I manipulate can I gibe the domain name with the e - any code? or something else?
Could you please confirm, you get the error message and either when adding domain in the file > export to HTML or file > download on FTP host option or if there is another place, you are referring to?
I checked and the export and download of FTP options both accept accented characters in the domain name field.
See you soon,.
Vikas
-
Why the vmnic is sometimes displayed with the word 'pause' next to them?
Sometimes when I connect with vSphere client for ESXi, click the host, Configuration tab, then the network link, I see the word 'pause' displayed next to the vmnic. No idea why this happens and what does it really mean? When I click on properties for the corresponding vSwitch, there is only a single vmnic assigned to the vSwitch.
Please take a look at the parameters of failover in the vSwitch properties, to see if the vmnic is listed under Active or standby.
André
-
Why the value of my variable resets Boolean false when executing a method of a Bean?
Hey everybody,
I use JDeveloper 12.1.2.0.0.
As the title says, my Boolean variable resets to false when I run my bean class method.
In my bean class, I have this variable:
Bank private Boolean = false;
{} public void onDimStoreSelect (SelectionEvent selectionEvent)
...
Ranger = true;
FactSalesHUB (selectionEvent);
...
}
{} public void onDimSellerSelect (SelectionEvent selectionEvent)
....
FactSalesHUB (selectionEvent);
}
public void FactSalesHUB (SelectionEvent selectionEvent) {}
GenericTableSelectionHandler.makeCurrent (selectionEvent);
If (product! = true)
matchEmFromJavaScriptProducts();
If (store! = true)
matchEmFromJavaScriptStore();
If (seller! = true)
matchEmFromJavaScriptSeller();
If (project! = true)
matchEmFromJavaScriptProject();
If (customer == false)
matchEmFromJavaScriptCustomer();
If (part! = true)
matchEmFromJavaScriptCoin();
}
If I perform the onDimStoreSelect and after that, if I run the onDimSellerSelect, the value of the client variable is already set to false and it will make my matchEmFromJavaScriptStore() runs when I don't want it.
Why didn't he stores the value as false since I did in the previous method? Any idea?
If the problem is not well explained, or it is not well explained just tell.
Kind regards
Frederico.
Try to increase the scope of your beans. After each request your bean loses value and believe you lose the set Boolean value.
-
After select stmt. why the count value of variable column, nested table is zero.
CREATE OR REPLACE TYPE numbers_type
ARRAY OF INTEGER
/
CREATE OR REPLACE PROCEDURE p(i) in FULL IS
numbers1 numbers_type: = numbers_type (1,2,3,4,5);
BEGIN
DBMS_OUTPUT. Put_line ("exposed before SELECTING");
DBMS_OUTPUT. Put_line('numbers1.) COUNT() = ' | numbers1. COUNT());
FOR j IN 1.numbers1. COUNT() LOOP
DBMS_OUTPUT. Put_line ('numbers1 (' | j |)) ') = ' || numbers1 (j));
END LOOP;
-Auto selection clause to COLLECT LOOSE:
SELECT a.COLUMN_VALUE
LOOSE COLLECTION numbers1
TABLE (numbers1) one
WHERE a.COLUMN_VALUE > p.i
ORDER BY a.COLUMN_VALUE;
DBMS_OUTPUT. Put_line ("presentation and SELECT '");
DBMS_OUTPUT. Put_line('numbers1.) COUNT() = ' | numbers1. COUNT());
END p;
/
Call p:
BEGIN
p (2);
END;
/Hello
Before taking in the collection variable, the values of the variables are fushed. So in this case the numbers1 is empty so it becomes zero and trying to read values from this collection which is already empty.
That's why you get the number zero
PRABHU
-
The substitution of Session variables with asking Varaible in prompt of
Hi all
(1) I want to show the values of Current_month which is max(reporting_date).created a prompt (drop-down)
(2) when a user changes it to the previous month I say 11/31/2009 current_month values to be values of month 11. How can I achieve this
My work around
-> created a session with the following query variable in the initialization block
-> created the Variable and the option checked on 'enable any user to define the variable '.SELECT to_char( MAX( report_date),'YYYY/MM/DD' ) from dual
-> by guests... Set variable Variable Request-> report_date
-> For Fx in the column Current_month, I use the formula like this
When I click on Preview I get results, but when I added the guest with (application of report_date Variable) in the dashboard, it gave me an errorFILTER((Sold Quantity) USING (Reportdate = VALUEOF(NQ_SESSION.Report_date)))
+ State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 22024] A comparison is performed between incompatible types. (HY000) +.
I checked that all the columns are in the format of DATE only...
Pls suggest me a solution
Thank you
saichand.vAn observation: that error you have found because of... non - compatible data types...
See... in your SQL written you in block initialization got char data type...
SELECT to_char( MAX( report_date),'YYYY/MM/DD' ) from dual
And. That you are assigning to the Date column... it is the reason you get this error...
-
How to read the XML doc in variable with XPath?
Suppose that a variable in BPEL contains an entire XML document as (without the quotes):
"value1 < foo > < bar > < / bar > < bar > value2 < / > < / foo >.
How to read of BPEL an XPath expression with the value of the second
< bar > element in a nother variable "target"?
What do I have to use getvariabledata? How to pass the XPath?
PeterPeter
Here's how you can get there by business to be divested. You can access it by writing the XML expression (do not select foo--> bar directly on the tree) as below
bpws:getVariableData ('Variable_name', 'Foo
','/ NS4:foo / NS4:bar bpws:getVariableData("intCounter") ') and assign it to the variable "target". Here the value of the variable integer "intCounter" represents the nth element under the tag "foo". Let us know if you face any issues. Hope this will help.
-
Why the hell you scare me with the security flaw in the version9 with version 10?
I had just updated to 9.0 and everything worked very well. If your new version is not ready, don't release it. I don't like IE, now, I have my doubts about firefox. It took me 5 minutes to type this, due to browser freeze.
[Deleted by the moderator of profanity. Please read the guidelines and rules of the Forum, thank you.]
Hi aeroskyn,.
I'm not having problems with the latest version here. Perhaps the info in the article Firefox crashes or does not - how to fix will help you. -
I play on various gaming sites. Why the ads do not interfere with my games?
Wheneve an ad on gaming sites, my computer freezes and I can't move my cursor.
It could be an add-on that could cause a problem.
In Internet Explorer, go to tools, then select Manage Add-ons. Look at the date and see if there is a recent addition which has been activated. You can test with deactivation and activation of the Add-ons to see if you can identify the problem.
If this does not help, there may be a conflict with another program. A clean boot helps you identify any software problem.
Article number: 310353 - How to configure Windows XP to start in a "clean boot" State
http://support.Microsoft.com/kb/310353Thank you
Marilyn
-
someone with the same name is mixed with my case
I got my account hotmail for several years and now someone who is 18 years of age has the same initials and I get e-mails. It is causing a problem.
How can they have the same user name as me?
Hello
As this is not the right forum to post the issues of Windows Live Hotmail, I suggest you post your request in the forum dedicated to Windows Live for better assistance.
-
Why the video screen is split with two identical images?
After a clean reinstall of Windows XP and Internet Explorer 8, Flash Player 11.6.602.180 has been downloaded. Video clips now play with the screen split horizontally by a green line and the identical images above and below, compressed vertically in function.
Lotus14
Most likely, you are using an outdated graphics driver; See http://forums.adobe.com/thread/945765
Maybe you are looking for
-
CoreDAVErrorDomain error 3.
Hello For some reason any my Contacts in iCloud stopped sync between my Mac & devices (no problem previously) When I click on the information button (shown in the triangle next to iCloud, under all Contacts), it displays the following error (error Co
-
My desktop HP Pavilion P7-1074 4.5 years computer dropped last week. Planed to get a replacement on Black Friday or the day after Christmas. But I have to run some programs inside hard drve to the desktop computer. So I have attatched hard disk dive
-
Graphics refresh rate and the writing of text problem - error 5
Hi guys,. I'm new to labview and have encountered some problems when I try to write to the file. I use USB-6259 with Labview 2009 to acquire a number of channels I want to analyze later in MATLAB, all at the same time providing some limited analysis
-
"this is not a bootable floppy please insert a bootable floppy disk and press a key to try again"
formatted a hard drive now im trying to intall xp when I boot the computer with the cd inside its gives me "is not a bootable floppy please insert a bootable floppy disk and press a key to try again. its an IBM machine, connections saved on the hard
-
I have a Touch Smart tm2. The wireless button is locked at the STOP. I tried to unplug the home network and reset (all other network equipment I have has no problem connecting with the exception of the tm2). Help, please. Thank you