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

Tags: Database

Similar Questions

  • 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;

  • 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

  • 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.

  • 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

  • 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.

  • Is the locale-specific number conversion chain?

    I would like to know what effect the computer's regional settings may have on the string number conversion in AS3. Specifically, in locales that use a comma as the decimal separator instead of a period, different conversion methods (Number() function, parseNumber(), Builder of the Number() class) they treat the comma as decimal separator? None of the documents I've read resolves this problem and all the examples use periods as a decimal separator. I suspect periods in strings will always be handled as decimal separators (and this is the behavior I want), but I would like to know for sure.

    FTR, an Adobe employee comes to informs me on programmers list that the answer to this question is no. period is always interpreted as a decimal separator, regardless of the location of the BONE.

  • Number of databases running in a host.

    Hi, what are the methods available to find the number of databases running in a crowd? (On Windows)

    Published by: Poorna Prakash on October 21, 2010 15:58

    A windows command line version:

    net start | findstr "OracleService"
    

    Another variant:

    tasklist /SVC /FI "SERVICES eq OracleService*"
    

    Published by: Centinul on October 21, 2010 07:16

  • Error: Autochk cannot run because of an error caused by a recently installed software. An error occurred__766f6c756d652e63 3f1 unknown

    Original title: Windows 7 system files is the name of volume NTFS is the operating system. It cannot open volume for direct access. Autochk cannot run because of an error caused by a recently installed software. An error occurred__766f6c756d652e63 3f1 unknown

    I have recently updated from Vista home premium to Windows 7 Home premium and it worked fine, until recently, I'm getting the above message whenever I start my laptop. I can't do a system restore, and this error tells me to do a system restore. I downloaded the upgrade of the internet, so I don't have a copy or a disk to reinstall. Can someone help me solve this problem or do I have to uninstall all the recent software programs?

    Thank you

    Hi Lowey58

    I had exactly the same problem. It worked for me:

    1 uninstall antivirus (mine was AVG free v9)

    2. plan chkdsk on reboot

    3. restart

    4. now, CHKDSK runs and corrects problems of disc he

    5 re-install AVG

    Try it and if it works post a response so that others know that ot worked for you also.

  • I/o Error: Cannot run program "C:\Program": error CreateProcess = 87 using ant

    Hi guys,.

    I'm trying to build my console application using Ant. It is a part of my build.xml

       
    
            
            
                
                
            
        
    
        
            
                
            
            
            
        
    

    When I try to "build Ant" I get this error returned:

    I/o Error: Cannot run program "C:\Program": error CreateProcess = 87, the parameter is incorrect

    referring to this line:

    
    

    I tested the names of directory and environment variables all (the variable

    ${46.jde.home}
    

    too) is set correctly, but the error is still there... How could I solve this problem?

    Thank you very much

    Sometimes, the length of the path give birth this error but I have not seen in a while. I ended up installing most of my OCD: \RIM apps to avoid path issues all together.

  • killing the SQL running on the schema in the background

    Hi all

    This is my first post in oracle db.

    We have a scheme on which I run a query that takes more than 4 hours.

    another user had accidentally run the same query on the same schema.

    is there a way to kill a session or a query running in the background that is running on this scheme?

    Kind regards

    dattatray mate

    Yes, you may need to run the sys user.

    and run the query to find the session connected to the REPORTDATA schema

    Select sid, serial # of the v session $ where username = 'PRODUITLOGICIELS' and STATUS = 'ACTIVE ';

  • Hi, I'm changing payment five days ago mi information (I need to change the credit card number), but something happen and appears an error with this announcement page: "error number: PMT_000008" then... What should I do?

    Hi, I'm changing payment five days ago mi information (I need to change the credit card number), but something happen and appears an error with this announcement page: "error number: PMT_000008" then... What should I do?

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • FAILED: An error occurred during conversion: "the operation encountered a network error.

    Hello world.

    I used VMware Converter Standalone 6.0 converter Server 2003 on Hyper-V to host ESX to vCenter.

    Hyper-V have IP: 10.132.2.200

    vCenter have IP: 10.132.2.177

    ESXi host have IP: 10.132.2.192

    We have no political firewall for 3 IP this. All ports are open in the firewall.

    But when I convertering 1% who have the error with the State: FAILED: an error occurred during conversion: 'the operation encountered a network error'

    So can you help me fix this case?

    Best regards.

    Hello Hongchuong

    It really looks like a secure network communication. You write no firewall blocks but we will go into more detail. The connection must be established from the Hyper-V (10.132.2.200) host to the ESXi (10.132.2.192) host on port 902, as in log lines:

    2015 07-12 T 14: 03:46.634 + 07:00 info vmware-converter-agent [03900] [sub Originator@6876 = task 1] establishment nfc connect to host 10.132.2.192 port 902

    2015 07-12 T 14: 03:47.193 + 07:00 info vmware-converter-agent [03900] [sub Originator@6876 = task 1] disc Sysimgbase_Nfc_PutFile source: Disks\Hyp2K3-Goc_5110F977-7064-4B81-9452-BDAE36EE9C9D.avhd hard E:\MayAo_Hyp\Hyp2K3-LT\Virtual, target disc [Datastore-SAN2] Hyp2K3-HDND/Hyp2K3 - HDND.vmdk

    2015 07-12 T 14: 06:44.992 + 07:00 WARNING vmware-converter-agent [03900] [sub Originator@6876 = Default] [, 0] [NFC ERROR] NfcNetTcpWrite: bwritten:-1

    2015 07-12 T 14: 06:44.992 + 07:00 WARNING vmware-converter-agent [03900] [sub Originator@6876 = Default] [, 0] NfcFile_SendMessage [NFC ERROR]: data send failed:

    2015 07-12 T 14: 06:44.992 + 07:00 WARNING vmware-converter-agent [03900] [sub Originator@6876 = Default] [, 0] [NFC ERROR] the operation encountered a network error - failed to send of data message

    2015 07-12 T 14: 06:45.056 + 07:00 error vmware-converter-agent [03900] [sub Originator@6876 = task-1] Sysimgbase_Nfc_PutFile failed in H2MDiskCloneMgr with nfcError "the operation encountered a network error" (error code: 3)

    2015 07-12 T 14: 06:45.069 + 07:00 WARNING vmware-converter-agent [03900] [sub Originator@6876 = Default] [, 0] SSL: SSL unknown error

    2015 07-12 T 14: 06:45.069 + 07:00 WARNING vmware-converter-agent [03900] [sub Originator@6876 = Default] [, 0] [NFC ERROR] NfcNetTcpWrite: bwritten:-1

    2015 07-12 T 14: 06:45.069 + 07:00 WARNING vmware-converter-agent [03900] [sub Originator@6876 = default] [, 0] NfcSendMessage [NFC ERROR]: send failed: NFC_NETWORK_ERROR

    An easy way to try the connectivity is telnet from the Hyper-V host to ESX host on port 902

    I see you have also tried again to destination 10.132.2.191 with the same error.  It is possible that Hyper-V firewall is blocking.

    HTH

    Plamen

  • Count the total number of rows found in the schema

    Count the total number of lines present in the schema, including the table, sequence, view

    Desirable output

    Table sequence views
    20 of 1000 1000

    Do you mean that you need to count the number of Tables, views and sequence present in the schema?

    Hi something like that.

    SELECT a.view_cnt AS "View Count", b.tab_cnt AS "Table Count",
           c.seq_cnt AS "Sequence Count"
      FROM (SELECT COUNT (*) view_cnt
              FROM USER_VIEWS) a,
           (SELECT COUNT (*) tab_cnt
              FROM USER_TABLES) b,
           (SELECT COUNT (*) seq_cnt
              FROM USER_SEQUENCES) c
    

    Gives you,

    View Count      Table Count      Sequence Count
           153              878                   32
    

    Thank you
    Shankar

    Published by: Shankar Viji on August 28, 2012 03:03

  • CIS API: Run-time code system error; Unable to load the English locale "American."

    Hello

    I am trying to connect to a CS using api cis. with socket connection. I get the below error. I tried changing the settings regional en_US also but no use...

    The content server is on linux, where, as I'm running the java file of windows xp machine.
    The config xml adapter has the entries below


    < name of adapter = default "myadapter" = "true" type = "scs" >
    < config >
    < property name = "version" > 75 < / property >
    < property name = "port" > 4441 < / property >
    < property name = "type" > socket < / property >
    < property name = "Home" > XX. XX. XX.XXX < / property >
    < / config >
    < template="classpath:/META-INF/resources/adapter/adapter-services-scs.jxml"/ beans >
    < / adapter >


    Any help would be very useful... Thanks in advance

    The content server log:
    Error running code system. Failed to retrieve information about the revision. Unable to load locale 'American English '. [Details]

    An error has occurred. The stack trace below shows more information.

    ! csSystemCodeExecutionError! csUnableToGetRevInfo! csLocaleNotFound, English-US
    intradoc.common.ServiceException:! csUnableToGetRevInfo! csLocaleNotFound, English-US
    at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:1753)
    at intradoc.server.Service.buildServiceException(Service.java:1997)
    at intradoc.server.Service.createServiceExceptionEx(Service.java:1991)
    at intradoc.server.Service.createServiceException(Service.java:1986)
    at intradoc.server.ServiceHttpImplementor.determineParameterizedLocale(ServiceHttpImplementor.java:607)
    at intradoc.server.ServiceHttpImplementor.initLocale(ServiceHttpImplementor.java:406)
    at intradoc.server.Service.initLocale(Service.java:333)
    at intradoc.server.Service.initDelegatedObjects(Service.java:201)
    at intradoc.server.ServiceManager.processCommand(ServiceManager.java:358)
    at intradoc.server.IdcServerThread.run(IdcServerThread.java:197)

    Error in the console:



    e of the exception: com.stellent.cis.server.api.scs.request.SCSRequestException: Error executing code system.

    com.stellent.cis.client.command.CommandException: com.stellent.cis.server.api.scs.request.SCSRequestException: Error executing code system.

    at com.stellent.cis.server.api.scs.impl.SCSCommand.executeRequest(SCSCommand.java:338)

    at com.stellent.cis.server.api.scs.impl.SCSCommand.execute(SCSCommand.java:222)

    at com.stellent.cis.client.command.impl.services.CommandExecutorService.executeCommand(CommandExecutorService.java:57)

    at com.stellent.cis.client.command.impl.CommandFacade.executeCommand(CommandFacade.java:158)

    at com.stellent.cis.client.command.impl.BaseCommandAPI.invokeCommand(BaseCommandAPI.java:84)

    at com.stellent.cis.client.api.scs.document.information.impl.SCSDocumentInformationAPI.getDocumentInformationByID(SCSDocumentInformationAPI.java:215)

    at com.pg.emfg.ewps.lotus.UploadFilesToUCM.updateMeta(UploadFilesToUCM.java:152)

    at com.pg.emfg.ewps.lotus.UploadFilesToUCM.main(UploadFilesToUCM.java:86)

    Caused by: com.stellent.cis.server.api.scs.request.SCSRequestException: Error executing code system.

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestProcessor.checkBinderForErrors(SCSRequestProcessor.java:349)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestProcessor.validateResponse(SCSRequestProcessor.java:265)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestProcessor.processRequest(SCSRequestProcessor.java:117)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:61)

    at com.stellent.cis.server.api.scs.request.stream.SCSOptimizedPublishFilter.handleRequest(SCSOptimizedPublishFilter.java:128)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)

    at com.stellent.cis.server.api.scs.request.stream.SCSOptimizedRetrieveFilter.handleRequest(SCSOptimizedRetrieveFilter.java:250)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)

    at com.stellent.cis.server.api.scs.request.rewrite.SCSRewriteURLFilter.handleRequest(SCSRewriteURLFilter.java:140)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)

    at com.stellent.cis.server.api.scs.request.cache.impl.SCSServiceCacheFilter.handleRequest(SCSServiceCacheFilter.java:104)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)

    at com.stellent.cis.server.api.scs.request.impl.SCSRequestExecutorProxy.execute(SCSRequestExecutorProxy.java:105)

    at com.stellent.cis.server.api.scs.impl.SCSCommand.executeViaProxy(SCSCommand.java:353)

    at com.stellent.cis.server.api.scs.impl.SCSCommand.executeRequest(SCSCommand.java:335)

    ... 7 more

    Hello

    Try added SystemLocale = English-USA in the config.cfg and then restart the content server to which CIS connects to perform a test to see if the problem still persists.

    Thank you
    Srinath

Maybe you are looking for

  • HP 5530: 5530 mac envy

    I had a HP Envy 5530 for a few months and it worked without problem.  Now all of a sudden, even if the printer is connected to the router, when I send a job to print wireless from my mac, is not printing. Any help would be appreciated.

  • generator of vision

    HelloI need to make a zoom in and zoom out in an acquired image that I show in my Vision Builder I-Inspection, but the problem is that there is no command button in my graphical user interface that allows me to do. I know that it is possible to have

  • WRT54G v3 - some devices connect more

    I have 3 devices connected wirelessly - my cell phone, my phone (LG Optimus) and my Roku box. This morning, my Roku and smartphone stopped connection. The laptop had no problem connecting. I tried to reset and power cycling the Roku box, turned the p

  • CONFIGURATION of E-MAIL blackBerry Smartphones

    SOMEONE HAS IT PLS, I AM A NEW USER OF BB. HOW CAN I SET UP MY EMAIL? I RECEIVED A MESSAGE - SERVICE IS NOT AVAILABLE FOR THIS DEVICE. WHY I have CANT ACTIVATE MY EMAIL IN THE FIRST PLACE, PLS HELP Thank you

  • BlackBerry Smartphones Blackberry Email

    I just had to replace my 8350i (because of water damage), and I can't get my blackberry email to restore. The record is still playing on my phone but it can't receive or send. I tried everything I can think of. Thanks for any help.