Using an own function in a select how can i set that the function run once?

Hi
Using an own function in a select how can i set that the function run once, not in every row?
Please help me
Thanks
Viktor

Something like this ?
SQL> select * from dept;
    DEPTNO DNAME                          LOC
        10 ACCOUNTING                     NEW YORK
        20 RESEARCH                       DALLAS
        30 SALES                          CHICAGO
        40 OPERATIONS                     BOSTON
SQL> create or replace function ret_name (deptnum in number) return varchar2
  2  is
  3     name    varchar2(50);
  4  begin
  5     select dname into name
  6     from dept
  7     where deptno=deptnum;
  8     return name;
  9  exception
10     when no_data_found then
11             return('Not existent deptno');
12* end;
SQL> /
Function created.
SQL> select deptno, decode(rownum,1,ret_name(deptno),null) dname from dept;
    DEPTNO DNAME
        10 ACCOUNTING
        20
        30
        40
SQL>

Similar Messages

  • TS1324 I have synced my Ipad and Iphone and my Icloud storage is full now, I want to unsync so I can use both of their Icloud storages separately, how can I do that?!!

    I have synced my Ipad and Iphone and my Icloud storage is full now, I want to unsync them so I can use both of their Icloud storages separately, how can I do that?!!

    Your iCloud storage is linked to your Apple ID, you can't unlink the devices unless you use separate Apple ID's for each device. That's not a good idea as you will have to pay for the same purchases twice on each device and you don't want to do that.
    Backup with iTunes where the size of you backup is only limited by the a amount of available space that you have on your computer, buy more storage in iCloud, or .... and this makes no sense either but it is a possibility ... remove one of the devices from iCloud and backup one in iTunes. If you are going to backup with iTunes, backup both devices with iTunes and leave iCloud alone.
    You don't need to backup with iCloud if you backup with iTunes and you can still download your past purchases without having to actually use iCloud for backups.

  • HT1947 I lost my apple tv remote.  How can I set up the use of my iphone with the remote app?

    I lost my apple tv remote.  How can I set up the use of my iphone remote app without it?

    The remote app would require home sharing to be enabled and both to be on the same network. If that's not the case then you will need a new remote

  • How can i set print mode at run time in smartforms???

    Hi expert,
    In smartforms how can I  set print mode at run time.
    I have one screen.In this screen one check box is there.If user select that check box then print should be come double side otherwise it is coming single side.
    If it is possible then plz give me answer asap.

    Hi,
    Set These settings
    While calling smartform, paas control_parameters and output_options as mentioned below and set
    user_settings = ' '.
    It will send the smartform output to spool.
    DATA: wa_output_options TYPE ssfcompop,
    wa_ctrl TYPE ssfctrlop.
    wa_output_options-tdimmed = 'X'.
    wa_output_options-tddelete = 'X'.
    wa_output_options-tdimmed = ' '.
    wa_output_options-tddest = 'LOCL'.
    wa_ctrl-no_dialog = 'X'.
    CALL FUNCTION lv_fm_name
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = wa_ctrl
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = wa_output_options
    user_settings = ' '
    x_adrp = x_adrp
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Kumar(Reward if helpful).

  • Async tcp client and server. How can I determine that the client or the server is no longer available?

    Hello. I would like to write async tcp client and server. I wrote this code but a have a problem, when I call the disconnect method on client or stop method on server. I can't identify that the client or the server is no longer connected.
    I thought I will get an exception if the client or the server is not available but this is not happening.
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    How can I determine that the client or the server is no longer available?
    Server
    public class Server
    private readonly Dictionary<IPEndPoint, TcpClient> clients = new Dictionary<IPEndPoint, TcpClient>();
    private readonly List<CancellationTokenSource> cancellationTokens = new List<CancellationTokenSource>();
    private TcpListener tcpListener;
    private bool isStarted;
    public event Action<string> NewMessage;
    public async Task Start(int port)
    this.tcpListener = TcpListener.Create(port);
    this.tcpListener.Start();
    this.isStarted = true;
    while (this.isStarted)
    var tcpClient = await this.tcpListener.AcceptTcpClientAsync();
    var cts = new CancellationTokenSource();
    this.cancellationTokens.Add(cts);
    await Task.Factory.StartNew(() => this.Process(cts.Token, tcpClient), cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
    public void Stop()
    this.isStarted = false;
    foreach (var cancellationTokenSource in this.cancellationTokens)
    cancellationTokenSource.Cancel();
    foreach (var tcpClient in this.clients.Values)
    tcpClient.GetStream().Close();
    tcpClient.Close();
    this.clients.Clear();
    public async Task SendMessage(string message, IPEndPoint endPoint)
    try
    var tcpClient = this.clients[endPoint];
    await this.Send(tcpClient.GetStream(), Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async Task Process(CancellationToken cancellationToken, TcpClient tcpClient)
    try
    var stream = tcpClient.GetStream();
    this.clients.Add((IPEndPoint)tcpClient.Client.RemoteEndPoint, tcpClient);
    while (!cancellationToken.IsCancellationRequested)
    var data = await this.Receive(stream);
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(NetworkStream stream, byte[] buf)
    await stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive(NetworkStream stream)
    var lengthBytes = new byte[4];
    await stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await stream.ReadAsync(buf, 0, buf.Length);
    return buf;
    Client
    public class Client
    private TcpClient tcpClient;
    private NetworkStream stream;
    public event Action<string> NewMessage;
    public async void Connect(string host, int port)
    try
    this.tcpClient = new TcpClient();
    await this.tcpClient.ConnectAsync(host, port);
    this.stream = this.tcpClient.GetStream();
    this.Process();
    catch (Exception exception)
    public void Disconnect()
    try
    this.stream.Close();
    this.tcpClient.Close();
    catch (Exception exception)
    public async void SendMessage(string message)
    try
    await this.Send(Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(byte[] buf)
    await this.stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await this.stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive()
    var lengthBytes = new byte[4];
    await this.stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await this.stream.ReadAsync(buf, 0, buf.Length);
    return buf;

    Hi,
    Have you debug these two applications? Does it go into the catch exception block when you close the client or the server?
    According to my test, it will throw an exception when the client or the server is closed, just log the exception message in the catch block and then you'll get it:
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.Invoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    Console.WriteLine(exception.Message);
    Unable to read data from the transport connection: An existing   connection was forcibly closed by the remote host.
    By the way, I don't know what the SafeInvoke method is, it may be an extension method, right? I used Invoke instead to test it.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • HT3576 how can i verify that the network or firewall is not blocking access to port 5223.

    how can i verify that the network or firewall is not blocking access to port 5223?

    Talk to someone who knows something about networking and/or firewalls on an appropriate forum.
    Configuring your network and/or firewall is beyond the scope of this forum, which is devoted to issues using the iPhone.

  • How can I change all the fonts at once on labels I downloaded from Avery?

    How can I change all the fonts at once on labels I downloaded from Avery?

    select all (Edit > Select All), then open the font panel by selecting the menu item "Format > Font Show Fonts".  Now select the font you want.
    I could only find Templates from Avery for Pages.  I think my suggestion in still good but want you to know you posted this question in the forum for Numbers.

  • How can I set that my "new tab" opens as Google instead of Yahoo as it is set now?

    How can I set that my "new tab" opens as Google instead of Yahoo as it is now?

    I usually use Ubuntu, and am not aware of HTML5 being the default for Flash videos on Windows.
    Is it more likely you have chosen an option on the YouTube website to use HTML5. I think this page offers support and includes an option to toggle HTML5 or FlashPlayer.
    * https://www.youtube.com/html5

  • Last computer i was able to make 3 profiles and run 3 windows. each time it asked for the profile when i wanted to start each window. how can i set that up again

    ast computer i was able to make 3 profiles and run 3 windows. each time it asked for the profile when i wanted to start each window. how can i set that up again

    last time some1 set it up for me. i would only have 1 shortcut on my desktop. everytime i clicked on it, it would ask me which profile i wanted. even if i had 1 or 2 of the others open it would still ask me which profile i wanted to open. i want to be able to do it that way again.
    yes i already set up the 3 profiles. but once i open up the one profile, and click on the short cut to open another, it just opens a brwser window with the profile in use. so i could open 10 windows, its only 1 profile, the first profile i used.
    and yes i have the box not checked

  • How can I test that the ITS is setup right and working?.

    How can I test that the ITS is setup right and working?.
    At present when calling a CRM transaction (BOR object) via the Nav Bar of the Webclient IC I am getting a message box with the title of 'Message from Webpage' and the content saying 'Object expected'.
    I have re-checked the transaction launcher and navigation bar profile setting and these look okay, hence my question regarding the ITS and how we might test that its functional.
    Jason

    I assume that as I also have a call to a URL (website), which is working fine, then the ITS servicer is also working fine.
    That just leads me to know identify why my BOR object is not being called correctly.
    Within the Transaction launcher I have the following settings:
    Entries
    Launch Trans ID: ZZIC1_LT01
    Component set: ALL
    Technical details
    Description: xxxxx
    Class name: ZCL_ZZIC1_LT01
    Statefull: X
    Further Technical details
    Transaction type: BOR Transaction
    Logical system: CMDCLNT600
    BOR Object type: TSTC_UIF
    Method name: EXECUTE
    Transaction Parameters
    Parameter: Object_key
    Value: CRMD_BUS2000115
    Can anyone see any problems with these entries?.
    what's the best way to ensure that 'CRMD_BUS2000115' is a BOR object?. I can run it as a transaction.
    Jason

  • How can we know that JVM is running in our system?

    how can we know that JVM is running in our system?

    On a *dows system you can use pslist and the like:
    http://www.sysinternals.com/Utilities/PsTools.html
    http://www.sysinternals.com/Utilities/PsList.html

  • How can i ensure that the time capsule back up all my data?

    how can i ensure that the time capsule back up all my data and no any data missed during the back up? becz i was backing up my mac to time capsule for the first time and it takes only 5 hourse for 279GB which is doesnt make sense
    any idea, how to ensure that all my data been backed up

    well this tells you why you are having issues.. since you have a filevault and unless you are logged on as that user TM has no way to backup the vault.
    so that is why the backup is so small.
    And you cannot remove the file vault because the disk is too small.. you are in catch 22..
    You cannot backup and you cannot remove the vault..
    Login as the user who has the file vault and copy the files off the computer to a directory on the TC.. Then just delete the files on the computer.. that will then allow you to remove the file vault.
    But never  will I ever use file vaults so I am being theoretical .. please read it up yourself.
    http://pondini.org/TM/25.html
    You are not doing the background reading you need to understand what you are doing..
    read the whole of pondini's info.. or at least skim it so you know what is there.
    Avoid like the plague file vaults..
    When disks go belly up, as they always do.. your files will be lost. Somewhere they need to be stored in the clear.. so why bother .. put better security on the computer and forget vaults.

  • HT4436 I have a laptop Mac and an IPad, and would like to transfer pictures, videos, etc from the ipad to the Mac but not from the Mac to the IPad, how can I set up the iCloud in both devises to do so?

    I have a laptop Mac and an Ipad, and would like to transfer pictures, videos, etc from the ipad to the Mac but not from the Mac to the Ipad, how can I set up the iCloud in both devises to do so?

    Welcome to the Apple Community.
    Your best method would be to connect via USB and transfer that way, since videos are not transferred using photostream.
    However you can stop photos on your mac being added to photostream in the iPhoto preferences > photostream by unchecking the automatic upload box.

  • How can i check that server still running?

    Hi everybody,
    How can i check that server still running before sending post?

    There are several ways of verifying if server is still running
    1) Through JCMon command line tool on server
    Call jcmon as <sid>adm using following command
    jcmon pf=/usr/sap/<sid>SYS/profile/<sid>_<instance>_<host>
    jcmon displays the server processes in status "Running" if all applications have started successfully. Otherwise it displays the appropriate status message
    2) Through SAP MMC which again shows the graphical status as Green
    3) On NWDS using J2EE view
    4) If telnet port is enabled on J2EE Engine, then you can remotely check the status of server using telnet command

  • How can i indicate that the table columns have different size?

    How can i indicate that the table columns have different size?
    It is because i have a table that has several columns....but i would like to have the possibility to indicate the size for every column....could somebody help me please?
    Thanks,
    Mary

    Hi,
    don't know as much as I should about JTable, but it seems that using yourTable.getDefaultRenderer() could help you: if I clearly understood the javadoc notes, it returns an object inheriting from JLabel, so you should be able to use setHorizontalAlignment(int align) on it... no time to verify this, but I'd be thankfull if you tell me the results !!!
    Regards

Maybe you are looking for