Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL block coding issue (oracle 10g release 2)
PL/SQL block coding issue [message #308944] Wed, 26 March 2008 00:52 Go to next message
horax
Messages: 34
Registered: March 2008
Member
Can somebody please troubleshoot this block o' code? I can't seemt o find the error.

/*Notice: Formatted SQL is not the same as input*/

DECLARE
lv_Test_Date DATE;
lv_Test_num CONSTANT NUMBER(3) := 10;
lv_Test_txt VARCHAR2(10);
BEGIN
lv_Test_Date := 'December 10, 2007';

lv_Test_txt := 'Wright';

dbms_Output.Put_Line(lv_Test_Date);

dbms_Output.Put_Line(lv_Test_num);

dbms_Output.Put_Line(lv_Test.txt);
END;
/

The SQL formatter gave me this:
Error Messages
<(1,1) expected token:Error when tokenlize

This is the error from iSQL:

DBMS_OUTPUT.PUT_LINE(lv_test.txt);
*

ERROR at line 10:
ORA-06550: line 10, column 22:
PLS-00201: identifier 'LV_TEST.TXT' must be declared
ORA-06550: line 10, column 1:
PL/SQL: Statement ignored


I don't see anythign wrong with this, but obviously something is amiss.
Re: PL/SQL block coding issue [message #308948 is a reply to message #308944] Wed, 26 March 2008 01:01 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
You don't have any variable declare as
dbms_Output.Put_Line(lv_Test.txt); --this is the error. lv_Test_txt.And lv_Test_Date := 'December 10, 2007' is a string and not a date.Search for TO_DATE().

Use the CODE tags to format your code.

regards,
Re: PL/SQL block coding issue [message #308951 is a reply to message #308948] Wed, 26 March 2008 01:07 Go to previous messageGo to next message
horax
Messages: 34
Registered: March 2008
Member
I did put the <code> </code> tags on it, but it didn't copy/paste correctly... Sad

As far as the coding is concerned, didn't I declare the variable lv_test_txt in the DECLARE section fo the block?
Re: PL/SQL block coding issue [message #308953 is a reply to message #308951] Wed, 26 March 2008 01:13 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
Yes you declared it as lv_test_txt but, in your
dbms_Output.Put_Line(lv_Test.txt); -- you are using a '.' and not an '_' .

Use [ ] and not <code > for formatting.

regards,

[Updated on: Wed, 26 March 2008 01:17]

Report message to a moderator

Re: PL/SQL block coding issue [message #308956 is a reply to message #308953] Wed, 26 March 2008 01:17 Go to previous message
horax
Messages: 34
Registered: March 2008
Member
This is why I shouldn't code past midnight...nothing good can come from it.

Thank you for your help. I am forever in your debt! Cool
Previous Topic: Where can I find any html parser that I can use in PL/SQL?
Next Topic: Use Of Raise_appilcation_Error's error code like - 20001
Goto Forum:
  


Current Time: Thu Dec 08 16:31:44 CST 2016

Total time taken to generate the page: 0.11019 seconds