Query using the functions, research and additions?

I am new to SQL, databases, and APEX! I'm sure it's very easy for you all, but I've been racking me my brains for two days on it; time for experts.

My simple request is:

Select first_name. » '|| middle_name | » '|| last_name 'full name '.
of name_table;

The problem I have, is that each name above is in a foreign language (which I don't understand by the way!), but I have a table that has "English" translations for each name... so my question is how to replace my 'translanted' value in each case...

to translate the values, I do a:

Select translated_name
of translated_table
where orginal_name = FirstName (or middle_name or same last_name)
and translation source = "Dictionary" (there may be 3-4 or four sources of translation for each name...)


Looks like a 'feature' would be the best way to do it... After much googling, this is what I came up with (which obviously does not work!):

create or replace function TRANS_NAME (v_original in varchar2)
return varchar2
is
v_translated varchar2;
Start
Select translated_name from v_translated
of translated_table
where original_name = v_original
source = "Dictionary".
Return v_translated;
end;

I use the 'APEX' Explorer to create the function, for a few reasons:
1 SQL more does not display the foreign language (shows just a buch of? s), the APEX SQL tool indicates that the original language!
2. it gives immediate, if not cryptic, comments on syntax errors.

FYI, I'm using Oracle 11 g on a Sun Solaris 10 Server.

Appreciate any help you might be able to provide!

create or replace function TRANS_NAME (v_original in varchar2)
return varchar2
is
v_translated VARCHAR2 (255); -->> Add the LENGTH of your
Start
Select translated_name from v_translated
of translated_table
where original_name = v_original
source = "Dictionary"; --->> AND A SEMICOLON HERE
Return v_translated;
end;

Published by: hoek on May 15, 2009 16:21 bought some glasses and spotted the semicolon missing too

Tags: Database

Similar Questions

  • Unable to connect to the wireless network; Request to use the function keys and the keys on the keyboard

    * Original title: wireless connection problem

    I have an Inspiron computer (laptop).  I can't connect to my wireless Internet.  When troubleshooting it says use the buttons or the function keys on the front or side of the computer to turn on my wi - fi.  How to do that? How can I activate my wireless Internet connection?  Help, please!

    Hello

    Check with Dell support, their books online, the drivers/firmware, diagnostics and ask in their forums known issues.

    Dell support
    http://support.Dell.com/

    Dell support drivers - product manual & warranty Info (left side) - and much more
    http://support.Dell.com/support/index.aspx?c=us&l=en&s=DHS

    Dell forums
    http://en.community.Dell.com/forums/

    Dell PC Diagnostics
    http://www.Dell.com/support/Diagnostics/us/en/19/
    I hope this helps.
    --------------------------------------------------------------------------------------------
    Rob Brown - Microsoft MVP<- profile="" -="" windows="" experience :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Using the function tablet and external monitor at the same time

    Hello

    I was hoping with the docking station and the external monitor, I can work as with an ordinary computer and at the same time to use the computer screen Tablet laptop to take notes with Journal (extended desktop display).

    Unfortunately, when I touch the screen with the stylus, it is still planned for the external monitor - no matter what I set as main display it seems just really stupid.

    Does anyone have an idea how to prevent this?

    divB

    I've updated to the latest official drivers from the Wacom homepage (not Lenovo-, they are old!) and it seems to work!

    I hope he'll stay until now.

  • Using the function PLSQL return Record Type Index of Tables in ADF

    I have a PLSQL function, a return type. My ultimate goal is to take this binary integer index Table and print it on the screen...

    CREATE OR REPLACE PACKAGE my_pkg IS
     
    TYPE t_col IS RECORD(
     
    i NUMBER,
     
    n VARCHAR2(30));
     
    TYPE t_nested_table IS TABLE OF t_col;
     
      FUNCTION return_table RETURN t_nested_table ;
    END my_pkg;


    OPTION 1:

    1) has anyone got best practices to accept plsql RECORDS returned by a function?

    Here is an example.

    http://adfpractice-Fedor.blogspot.SG/2013/01/working-with-PLSQL-procedures-in-ADF-BC.html

    But it will be a lot of work... first of all accept the results in a loop... then store in a temporary storage can be a few VO or global temporary table and then display them on the page


    OPTION 2:

    Using the functions PIPLELINED and use in the select statement.  While I can use this select statement in the SQL query to create VO... and drag and drop the VO...

    CREATE OR REPLACE PACKAGE my_pkg IS
     
    TYPE t_col IS RECORD(
     
    i NUMBER,
     
    n VARCHAR2(30));
     
    TYPE t_nested_table IS TABLE OF t_col;
     
      FUNCTION return_table RETURN t_nested_table PIPELINED;
    END my_pkg;


    select * from table(my_pkg.return_table);


    Wow... I'm so smart! .. really possible?  who is the best/possible/recommended option?

    I'm sure that will be the question most read by many who wants to use PLSQL instead of JAVA to the treatment and CHOSEN to use only to display the output of the PLSQL functions or procedures.


    Thank you

    Rahul


    Dario

    Do you mean the scope of the defined Type pkg will be finished?

    I created guy outside the pkg as 'Create Type' if it works in this case?

    Yes, level objects schema (created with "create or replace type...") can be used in java and this can work.

    I think that then the scope of this TYPE will remain until the user session passes.

    Object definitions is not worn, but have their bodies.

    So, if you instantiate the data level object type schema in a plsql function, scope of this object is this function.

    Of course, if you instantiate the object as a variable package, then life of this object is equal to the lifetime of the package (which usually equals life of session db).

    Dario

  • Cannot find the prototype of the function DeleteLinesFromFile and InsertlinesInFile

    Hello

    I want to remove or insert a line in a file. I want to use the function 'InsertlinesInFile' and 'DeleteLinesFromFile '. but I did not find the library to declare the prototype.

    Anyone know the library include what I need to use this function or other solutions to my problems.

    Thank you for your response.

    Stéphane SQUARE

    Hello Stéphane!

    Functions are from Server ActiveX LabWindows/CVI Interface: http://zone.ni.com/reference/en-XX/help/370051Y-01/cvi/usermanual/actxappdeletelinesfromfile/

    You can see the \activex\cvi\cvidemo.prj sample project to see how it is used.

    -Johannes

  • I want the single update query without using the function.

    I want to update sells_table selling_code field with product_code date product table max.
    In the product table, there are several product_code date wise.

    I did with below charly with the use of the service, but we can do in the query what a single update
    without using the function.

    UPDATE sells_table
    SET selling_code = MAXDATEPRODUCT (ctd_vpk_product_code)
    WHERE NVL(update_product_flag,0) = 0;

    (P_product IN VARCHAR2) RETURN of HVL.maxdateproduct NUMBER FUNCTION to CREATE or REPLACE
    IS
    max_date_product VARCHAR2 (100);
    BEGIN
    BEGIN
    SELECT NVL (TRIM (product_code), 0)
    IN max_date_product
    FROM (SELECT product_code, xref_end_dt)
    PRODUCT
    WHERE TO_NUMBER (p_product) = pr.item_id
    ORDER BY xref_end_dt DESC)
    WHERE ROWNUM = 1; -He'll be back a single line - max date product code
    EXCEPTION
    WHILE OTHERS
    THEN
    RETURN 0;
    END;

    RETURN max_date_product;

    END maxdateproduct;

    Thanks in advance.

    Hello

    Something like that.

    update setlls_table st
            set selling_code =(select nvl(trim(product_code)) from
                                  (select product_code
                                          , rank() over (partition by item_id order by xref_end_dt DESC) rn
                                       from product
                                   ) pr
                                   where rn =1
                                         and pr.item_id = st.ctd_vpk_product_code
                               ) where NVL(update_product_flag,0) = 0 ;
    

    That such is not tested due to lack of sampling input.

    Concerning
    Anurag Tibrewal.

  • Create the view and by using the function that returns a type oracle

    Following is possible?

    A function returns an ORACLE object Type, and I want to use this feature, in my opinion, it is possible to access each field of the type once the function is executed and make a column in the view?
    create or replace TYPE SOME_INFO AS OBJECT
    ( 
      CHARGE FLOAT,
      SOME_DATE DATE,
      SOME_VAL VARCHAR(50)
    );
    
    CREATE OR REPLACE
      FUNCTION CALCULATE_INFO
        (
          p_chargeId NUMBER)
        RETURN SOME_INFO 
      AS 
      v_some_info SOME_INFO := new SOME_INFO(0, null, null);
    BEGIN
     
    -- function body populates the v_some_info
    return v_some_info;
     
    END calculate_info;
    Now, I want to use the function according to me - if the underlying query of the view follows-
     select c.*, calculate_info(c.charge_id) as someInfo from some_charge;
    How to recover someInfo.CHARGE, someInfo.some_date, someInfo.some_val? I can put them as columns in the view?

    If you use only functions that return a single value in a view?

    Thank you
    Mustapha

    Published by: Tina Giri on April 16, 2009 05:47

    How to recover someInfo.CHARGE, someInfo.some_date, someInfo.some_val?

    SQL>  create or replace type some_info
    as
       object (charge float, some_date date, some_val varchar (50));
    /
    Type created.
    
    SQL>  create or replace function calculate_info (p_chargeid number)
       return some_info
    as
       v_some_info   some_info := new some_info (0, null, null);
    begin
       -- function body populates the v_some_info
       return v_some_info;
    end calculate_info;
    /
    Function created.
    
    SQL>  select your_view.someinfo.charge,
           your_view.someinfo.some_date,
           your_view.someinfo.some_val
      from (select c.*, calculate_info (c.empno) as someinfo
              from emp c) your_view where rownum <= 3
    
    SOMEINFO.CHARGE SOMEINFO SOMEINFO.SOME_VAL
    --------------- -------- --------------------------------------------------
                  0
                  0
                  0                                                            
    
    3 rows selected.
    
  • I have an iMac 27' 2012 with macOS Sierra and Apple Watch with watch OS 3, I can use the function "Log?" in Apple Watch

    I have an iMac 27' 2012 with macOS Sierra and Apple Watch with watch OS 3, I can use the function "Log?" in Apple Watch

    Hi John 2078 Tito.

    I understand that you have updated your iMac and Apple Watch and now you're curious about unlock your iMac using your Apple Watch. I know that it is a nice feature to be able to quickly and safely unlock your computer, so I'm happy to help you.

    This feature is available on 2013 iMacs and later versions, which means that your iMac won't be compatible. You can see more info on this feature here:
    Unlock your Mac with Apple Watch - Apple Watch user's Guide

    Thank you for using communities Support from Apple. See you soon!

  • I have been using the functionality of Firefox in which I could have multiple sets of tabs open, but only see the game I was working with. I have updated and now the functionality is Gone

    I have been using the functionality of Firefox in which I could have multiple sets of tabs open, but only see the game I was working with. I have updated and now the feature disappeared. I had a small icon on the top right of my toolbar. I used it all the time to keep windows separated for financial, plans to travel items, news, etc.. Has it been removed from Firefox?

    Hello

    The feature of tab groups is always present. You can try with the button right of the + after the last tab and Customize. If the icon is hidden behind the other, or if it is available inside the mini window customize, you can put it back. If the problem persists, you can also try of reset toolbars and controls: and start to make changes and restart in Safe Mode screen.

  • I use Windows 10 and use the Canon SX20 IS. How to use the function of Photo stich?

    I use Windows 10 and use the Canon SX20 IS. How to use the function of Photo stich?

    Is it possible to get the procedure to use feature stich photo?

    Will be Zoombrowser EX for windows 10 wotk?

    If any expert can guide me... that will be great.

    Hi Sat17,

    Thank you for your inquiry.

    For Windows 8 and beyond, ZoomBrowser EX has been replaced by EX. ImageBrowser

    Your software you will need to updated for Windows 10.

    You can access the software for your camera by clicking here.  Once on our site, scroll down to "Drivers and downloads", then use the drop down menu to choose "8.1 Windows" or "Windows 8.1 (x 64)".»  Your camera software has not been updated for Windows 10, but for Windows 8.1 software will run on your computer.

    To update your software, click the [Select] button to the right, then click on "How to download and install" for installation instructions.

  • How can I access my computer in order to remove downloaded files that has not deleted using the control panel and the usual functions to delete?

    I recently received from remote assistance installed a new anti-virus program. During using the remote technician, I he observed several open windows because it deleted the files that were left by previous anti-virus programs on my computer.  These files prevent the download of the new program.  As I watched him navigate through my programs and files, I noticed that there are a lot of game files that have been deleted by using the functions of the control panel and uninstalling still in my computer.  The technician of 3-4 programs installed on my computer while he removed residual files of the antivirus and promptly removed from these programs when it was correctly installed my new anti-virus program.  I would really like to know how to access files or records what he did and then delete the game files that I thought were removed.  I downloaded at least 100 trial offers for sets of objects hidden over the years and you don't want no trace with my memory of the computer.  No help available out there?

    Hey,.

    You can follow this link to recover lost or deleted files:

    http://Windows.Microsoft.com/en-us/Windows-Vista/recover-lost-or-deleted-files

    also, look for the file/game:

    http://Windows.Microsoft.com/en-us/Windows-Vista/save-your-search-results

    Hopefully this should help you.

  • I have saved via a website magazine and am now unable to disconnect! It is an interactive Web site, and I am unable to use the functions, so want to close your session, as there is no button 'unsubscribe '.

    I have saved via a website magazine and am now unable to disconnect! It is an interactive Web site, and I am unable to use the functions, so want to close your session, as there is no button 'unsubscribe '. Thanks for any info provided.

    You should contact the website of the magazine for assistance.  This isn't a Windows, or a problem of Microsoft.

  • When you modify a form in the DC or Pro Player I can enter text etc., save, close, and return later to change it. However, once I use the function "Fill &amp; Sign" and save the document, it locks the file and all other fields are not editable. Is there a

    Hi guys,.

    When you type information in a form in the DC or Pro Player I can enter text with fields of text etc and then save, close and return later to change the form. However once I use the function "Fill & Sign" to sign the document, and then save, it locks the file and all other fields become editable. Is there a way around this to remove this feature where it becomes locked and instead allows me to change the form after a signature is applied and saved. All the security properties of the form are on 'admitted', there is no restriction. Even though the document is locked all the properties remain still as 'authorized '.

    The signing is FINAL.  You cannot sign a PDF paper advance. Complete and save, do not sign.

  • I want to rename and move files from a shoot 5 d. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    I want to rename and move files from a shoot 5 d on a new drive. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    HI -.

    As a prelude to 2014.0, we have added a feature allowing you to choose what number to start the increment of.  Look in the section ingest Rename dialog and change your preset. When you click the button, you should see the option "Custom Auto Increment". This will allow you to choose what number to start on.  We've also added a few newspapers to try to remember where let prelude last successfully interfere the operation by using this option. So, in theory, to remember the number for you. But if it isn't (maybe you want multiple kickoff ingested at the same time) you can always manually set the number to start with.

    Check that out and let me know how it works for you.

    Kind regards

    Michael

  • Is it possible to hide a conditional function in responsibility. Say it together a small number of users, I need the function display and for some users, it must be hidden.

    Is it possible to hide a conditional function in responsibility. Say it together a small number of users, I need the function display and for some users, it must be hidden.

    Hello

    The normal thing to do is to create a similar additional responsibility and using Exclusions to 'hide' the features you want.

    Then assign it to restricted users.

    Kind regards

    Bashar

Maybe you are looking for