character to number conversion error

Hello

The following function returns an error (ORA-06502 PL/SQL numeric or value error character for number conversion error) question when the number of person, 300 and 400. Please note that I created a simplified version of the function and paintings illustrate the error.

Thanks in advance

Concerning
Anna
create table emp
(person_id number
,tel varchar2(20)
)
insert into emp
values (100, '987503456')
insert into emp
values (200, '2457890')
insert into emp
values (300, '01-2-589758')
insert into emp
values (400, '+60-4-5879600')

create table emp1
(person_id number
,name varchar2(30)
);

insert into emp1
values (100, 'Allan')

insert into emp1
values (200, 'Smith')

insert into emp1
values (300, 'White')

insert into emp1
values (400, 'Parker')
Function
create or replace function test_fax
          (pn_person_id  IN emp1.person_id%type)

      RETURN VARCHAR2 IS

cursor csr_test is
select  a.tel 
from emp a
,emp1 b
where a.person_id = b.person_id

   -- variable declaration
   lv_tel emp1.person_id%type;
 
 begin
   open csr_test;
    fetch csr_test into lv_fax;
   close csr_test;
return lv_fax;
end test_fax;

You select IT in a variable declared as PERSON_ID

He works for PERSON_ID 100 and 200 because the values are be valid numbers.

lv_tel emp1.person_id%type;

should be

lv_tel emp1.tel%type;

Tags: Database

Similar Questions

  • ORA-06502: digital or value error: character of number conversion error

    I met the following error when I ran function to_number_or_null PL/SQL of Donald. Someone here could help me find the solution? Thank you!

    SQL > create or replace FUNCTION to_number_or_null)
    2 aiv_number in varchar2)
    3 return number is
    4 / *
    5 to_number_or_null.fun
    6 by Donald J. Bales on 12/15/2006
    (7. a method of to_number without error)
    8 * /
    9 start
    10 return to_number (aiv_number);
    exception 11
    12 when INVALID_NUMBER then
    13 return NULL;
    14 end to_number_or_null;
    15.

    The function is created.

    SQL > select to_number_or_null('A') from double;
    Select to_number_or_null ('A') of double
    *
    ERROR on line 1:
    ORA-06502: PL/SQL: digital or value error: character of number conversion error
    ORA-06512: at "CAROL. TO_NUMBER_OR_NULL', line 10

    It seems that Donald must have handled VALUE_ERROR instead of INVALID_NUMBER.

    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/errors.htm#LNPLS00703

  • character to number conversion of running OE example schema error

    Hi all
    I try to run the following sample code from the language reference doc demonstrating the granularity of the cache by using the example of OE schema:
    CREATE OR REPLACE FUNCTION get_product_name_2 (prod_id NUMBER, lang_id VARCHAR2)
    RETURN NVARCHAR2
    IS
    TYPE product_names IS TABLE OF NVARCHAR2(50) INDEX BY PLS_INTEGER;
    
    FUNCTION all_product_names (lang_id NUMBER) RETURN product_names
    RESULT_CACHE
    IS
    all_names product_names;
    BEGIN
    FOR c IN (SELECT * FROM Product_Descriptions WHERE LANGUAGE_ID = lang_id)
    LOOP
    all_names(c.PRODUCT_ID) := c.TRANSLATED_NAME;
    END LOOP;
    RETURN all_names;
    END;
    
    BEGIN
    RETURN all_product_names(lang_id)(prod_id);
    END;
    but I had
    SQL> variable a nvarchar2(4000)
    SQL> exec :a:=GET_PRODUCT_NAME_2(2449,'US');
    BEGIN :a:=GET_PRODUCT_NAME_2(2449,'US'); END;
    
    *
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "OE.GET_PRODUCT_NAME_2", line 17
    ORA-06512: at line 1
    Could someone advise me what went wrong?

    Best regards
    Val

    Looks like that lang_id is first defined as character in get_product_name2().

    But in all_product_names(), it is defined as a number. For example, when you move the character value to
    all_product_names(), he's going to complain, because it expects a number.

    CREATE OR REPLACE FUNCTION get_product_name_2 (prod_id NUMBER, lang_id VARCHAR2)
    RETURN NVARCHAR2
    IS
    TYPE product_names IS TABLE OF NVARCHAR2(50) INDEX BY PLS_INTEGER;
    
    FUNCTION all_product_names (lang_id NUMBER) RETURN product_names
    

    You can try changing the all_product_names() parameter type:

    FUNCTION all_product_names (lang_id VARCHAR2) RETURN product_names
    
  • PL/SQL: digital or value error: character number conversion in the TRG error

    Hello
    I have a strange problem with a trigger that, during the update of the table of reports (DB is 9.2.0.8):
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "UDR_LOG", line 345
    ORA-04088: error during execution of trigger 'UDR_LOG'
    but the 345 line is:
    END IF;

    This kind of strange
    the code looks like
    
    343 IF nvl(to_char(:old.PKD_ID),'''') <> nvl(to_char(:new.PKD_ID),'''') THEN
    344     v_zmn := v_zmn || 'PKD_ID''' || to_char(:old.PKD_ID) || '''' || to_char(:new.PKD_ID) || '''';
    345    END IF;
    
    so its concatenation not to_number usage .
    error is raised by the update on a column.

    I'm sorry that I can't provide you with the code in the trigger everything.
    So, if you could recommend only whole method of inquiry that would be great.
    Concerning
    Greg

    Hi, Greg.

    When there is an error in a trigger, the line numbers in error messages are compared to the first statement DECLARE or BEGIN; often, it is a few lines after CREATE OR REPLACE TRIGGER. Post a few lines after what you have already posted.

    If you do not find the error, then create another table to test this and create a small trigger on that table, who did just enough to cause the error. Then, you will be able to post the complete relaxation, and the code needed to recreate the problem.

  • #550 5.6.0 M2MCVT. StorageError; storage in content conversion error #.

    Hello

    We use ios with 9.2 ios devices

    recently, we noticed that when we create a new event in the calendar and invite someone outside of our company, we receive an error message:

    The e-mail system had a problem processing this message. It won't try to deliver this message again

    and the exchange Server Diagnostics information:

    #550 5.6.0 M2MCVT. StorageError; storage in content conversion error #.

    that it happens with ios 9.2

    have you ever had a response to this

    We suffer the same way in Israel.

    When we change the time zone on the iphone in the United States for example, it works well!

    If it has to do with the zone, but I can't figure out how to solve this problem.

    He comes up with the previous version of the IOS, but not with android and not outlook on the computer.  If you install outlook on iOS app, it works well in this regard.

    Help!

  • Why teststand cannot display the ASCII character which number up to 128?

    Hi all

    I encountered a problem on an application for ASCII characters, why teststand cannot display the ASCII character which number up to 128?

    For example: an expression Local.xx = Chr (164).

    XX--> chain, can't do the correct string.

    An idea for this?

    OS: WinXP, SP1 Teststand2012.

    Thank you very much.

    TestStand uses encodings multibyte code page, that you have defined for the operating system-based. If you are using a code page that requires multibyte characters, you should also make sure that you have the Options of Station-> location-> parameter Regcognize multi-byte characters is enabled.

    On Windows 7, at least, the code page of the operating system setting is located in the control panel "Region and language" in the "Administration" tab where it says "language for non-Unicode programs".

    Hope this helps,

    -Doug

  • With the help of TestStand to get the number of errors from a device

    I use TestStand to communicate with a device that tests itself. TS has just appealed a DLL which, through a channel series learns how many errors the device had for each test (such as ethernet). It must be continuously for each test for approximately 3 days. While I realize that this is not the way that TS is supposed to work, due to the end already be finished I just simple settle.

    My question is:

    What is the best way to organize the test steps (calls DLL that returns the number of errors) and the results? I looked at just looping through a test sequence, but this would result in millions of individual results altogether? Is there a way to update the same result for a stage, when it is called 1000 times?

    Thank you

    Add each error to a variable in a loop that runs for 3 days. Save the variable data to the report at the end.

  • String to number conversion problem

    I have a VI that pulls in data from a device using VISA, and I got it on another computer to work a few weeks back. I had to transfer the VI to a laptop computer to run a few tests, and now I can't make it work. I am unable to put my VI because the laptop on it's is unable to access the network companies, I will do my best to explain it all, I apologize for the inconvenience! My problem is not however with VISA, it's with an exit VISA number conversion chain.

    I have attached a painting drawing of VI to better explain it.

    I use the block series Visa football match in baud rate and all that many good things to the unit and port settings set of device management. Then, a while loop is entered. The loop will run until you press the stop"" button. The next block of visa is the writing block, he asks for a reading of the device. The next block of visa is the first block of reading, he returns playback in the form of "NA-XXX. X' where x are numbers. The next block of visa is the second reading block, this block just echoes back the command sent to the device. Playback of the first visa read block, "NA-XXX. X' is going exponential/fractional chain to digital converter.

    When you perform a run/debug to highlight run, the release of visa reports the correct value, is the value of the device reading - however the string to number converter generates a 0,000, no matter what channel number is. I am at a loss as to what may be wrong because it's the EXACT set up I had to work very well a few weeks ago!

    I'm using Labview 10 on the laptop, the old computer was labview 7. I'm guessing that this is perhaps the rub... I Redid the VI from scratch, although I have not opened the old VI in labview 10.

    Any help would be appreciated. Again, sorry I am unable to attach the VI.

    DARB wrote:

    I have attached a painting drawing of VI to better explain it.

    Would it not have been easier to just post a screenshot? You might also have used the Tool of Capture of Code. (Which reminds me that I need to install it to my previous versions of LabVIEW, as evidenced by the screenshot I took. )

    As to the question: you probably either:

    • employee analysis of chain initially and when you rewrote the VI you used the regular string conversion functions.
    • Wired an offset value in the string to the number function.

  • Windows Update does not interact with Win XP, get the error number: 0x8024400A error number: 0 x 80240036... why?

    Something happened when Windows Update downloaded a file of security on my Windows XP. I had to wipe and reload Windows XP SP2 and MS Office programs because of corruption. I had never problems with the Windows Update server to date. I tried the 'clean boot' instructions and followed the instructions forum MS for other alternatives, but I continue to receive two issues of the Server Windows Update error:

    Error number: 0x8024400A error number: 0 x 80240036

    In addition, "Mr. FixIt" could not be installed because it is dependent on the SP3. I don't know what else to try. Please notify. Thank you.

    I think the first thing you could try would be to get your computer up to date if you can. You can download SP3 here.
    http://www.Microsoft.com/en-US/Download/details.aspx?ID=24

  • Windows XP, outlook express, 11004, error 0x800CCC0D number socket error.

    Windows XP, outlook express, 11004, error 0x800CCC0D number socket error.  All the server, connection, and advanced properties are set correctly.  I seems that Outlook Express has stopped working - it will not get any mail from any account more.  XP is installed on my computer desk top of page. - Maybe (?) when I tried to email a link of my computer laptop (Vista) and Microsoft Mail address (or something like that he stopped and asked me to set up a new e-mail account and I canceled)? After that, I can't use Outlook Express. The laptop and the desktop using the same internet access to Comcast.    I contacted Comcast and the comcast tech said "all settings are correct - call Microsoft.

    If the following does not help, please post the error message in its entirety. You can left click on it to highlight then right click to copy and then paste in this thread.

    Change the SMTP port to 587 and ensure that: my server requires authentication is enabled.

    How can I set up/configure Outlook Express, Windows Mail & Windows Live Mail to E-mail from Comcast?
    http://www.Comcast.com/customers/FAQ/FaqDetails.ashx?ID=2288

    Bruce Hagen ~ MS - MVP [Mail]

  • ORA-01722: invalid number calculation error during the treatment.

    My version of the APEX is Application Express 4.2.6.00.03

    I imported apex application 4.0.2 and his object of decision-making support in my apex.

    Its installed successfully.

    But when I try to run this application it show me this error:

    ORA-01722: invalid number calculation error during the treatment.

    Thank you guys for your help.

    I found the solution.

    There was a problem in the authentication scheme.

    I called function as return function_name in 4.0.2

    but in the Apex 4.2.6 to call a function word return is not necessary.

    He was throwing the error caused that Word back.

  • I'm trying to reinstall CS2 on an XP that has never been installed. The download works fine, but will not accept my serial number to activate. I copy and paste from my account to ensure accuracy. Continue to receive the serial number incorrect error. What

    I'm trying to reinstall CS2 on an XP that has never been installed. The download works fine, but will not accept my serial number to activate. I copy and paste from my account to ensure accuracy. Continue to receive the serial number incorrect error. What would be my next step to get this race?

    CS2 (or earlier version) activation server has disappeared, then read below

    You MUST use the special number on the page, not your original serial number

    l http://helpx.adobe.com/x-productkb/Policy-Pricing/Creative-Suite-2-activation-end-Life.htm

  • ES4 Conversion error: 1

    When you try to import a Word document or an RTF document in Livecycle Designer ES4 I get Conversion error: 1 race: ' c:\Probram files (x 86) \Adobe\Adobe LiveCycle Designer ES4\ConvertWord.exe "...

    I was not able to find much about this error - any help greatly appreciated!

    Hello

    Try this manual correction.

    LiveCycle Blog: Der making - 4 correction / / Do-It-Yourselfers bugfix 4

  • I just bought first elements13 and I installed it. But whenever I try to get my license number, an error message appears that says that my computer is not connected to the internet. I've tried everything. Help!

    I just bought first elements13 and I installed it. But whenever I try to get my license number, an error message appears that says that my computer is not connected to the internet. I've tried everything. Help!

    Check your hosts among other common problems, sign in, activation or connection errors. CS5.5 and later, Acrobat DC

  • Cannot export AAF of Prime Minister... AAF - project conversion error

    Hello

    Export as Adobe AAF first Pro CC 2014 I am facing this error. AAF - Project Conversion error... Cannot be converted to the current project, the converter reported an unspecified error.

    Can anyone help? I take my editing avid composer 8. Also the AAF export takes a long time. Is it possible to get that done faster?

    Thank you

    Jay

    When I tried going back and forth to Avid, I found it was more reliable if I set the sequence in a tray, with a pair of pliers and export the abnormal analysis result of the tray.

    This gave an aaf "bound" (rather than trying to incorporate media) - who did repeat in Avid (with some reservations)

    How to export a sequence as a result of abnormal analysis without support and then link in Avid

Maybe you are looking for