How to write the function for bottom of logic...

I have a picture in the picture I have a records like below
code value
1 20
2 null
3 30
4 null
5 40
6 null


The output need to have the values displayed in the fields first, followed by the NULL values as below

code value
1 20
2 30
3 40
4 null
5 null
6 null

I think the suspicion is that the values must be concatenated with the replacement of NULL values with (;).
as
20, 30, 40
Get single values and insert into the table...

for this I don't know how to write function for who can please help me on these...

Published by: Claudia on June 22, 2011 22:45

Published by: Claudia on June 22, 2011 22:51

Create or replace function test_fun
is
cursor fun1 is the value select from table by CSA 2;-"this select query will return 20,30,40, null, null, null".
v_out varchar2 (20);
Start
fun1 open cursor;
loop
extract the fun1 in v_out;
dbms_output.put_line (v_out); - this is the command display output on the screen.
output when fun1 not found %;
end loop;
close;
end;

Please try it and tell us if no query...

Thank you
IQ

Tags: Database

Similar Questions

  • How to write the trigger for update or delete multiple columns in a table?

    Hello

    I create one in the form of table of sample_emp. In that, every time I want to change of name, team_id, team_leader_id, supervisor_id, manager_id it must store the update-able and old values of those in the job_history table. When I write the trigger for which it shows "ORA-04082 new or the old value not table level triggers. Here is my emp_table. My table also similar job_history like this. Need your help.

    Header 1 Header 2 Header 3 Header 4 Header 5 Heading 6 Heading 7 8 header Header 9
    EMP_IDEMP_NAMEDESIGNATIONTEAM_IDTEAM_LEADER_IDEMPLOYEEMANAGER_IDHIRE_DATERELIEVED_DATE

    --

    Thank you.

    Hi Joel,.

    Venky_prs wrote:

    Hello

    I create one in the form of table of sample_emp. In that, every time I want to change of name, team_id, team_leader_id, supervisor_id, manager_id it must store the update-able and old values of those in the job_history table. When I write the trigger for which it shows "ORA-04082 new or the old value not table level triggers. Here is my emp_table. My table also similar job_history like this. Need your help.

    Header 1 Header 2 Header 3 Header 4 Header 5 Heading 6 Heading 7 8 header Header 9
    EMP_ID EMP_NAME DESIGNATION TEAM_ID TEAM_LEADER_ID EMPLOYEE MANAGER_ID HIRE_DATE RELIEVED_DATE

    --

    Thank you.

    You can try something like this given below to complete the historical table on update and delete.

    create or replace TRIGGER  "CLONE_EMP_UPDATE_DELETE"
    BEFORE DELETE OR UPDATE ON EMP
    FOR EACH ROW
    DECLARE
        PRAGMA autonomous_transaction;
    BEGIN
    INSERT INTO JOB_HISTORY("EMP_ID","EMP_NAME","DESIGNATION","TEAM_ID","TEAM_LEADER_ID","SUPERVISOR_ID","MANAGER_ID"
    ,"HIRE_DATE","RELIEVED_DATE")
      VALUES(:OLD.EMP_ID,:OLD.EMP_NAME,:OLD.DESIGNATION,:OLD.TEAM_ID,:OLD.TEAM_LEADER_ID,:OLD.SUPERVISOR_ID,
    :OLD.MANAGER_ID,:OLD.HIRE_DATE,
    :OLD.RELIEVED_DATE);
    COMMIT;
    END;
    

    Hope this helps you,

    Kind regards

    Jitendra

  • How to write a function (for an ex-Flash-dev)

    Hiya,

    I am coming from a Flash/AS 3.0 environment and I'm getting a bit confused trying to write functions in EA.

    I'm quite new to JS and jQuery so that something is similar to actionscript, I'm still finding things a little confusing.

    I'm working on my first project with EA 2014.1.1 and managed to get away with the built in functions to date, but I now need to do something more custom.

    For example, in Flash, I would write a function to a button and it would go in the first frame of the timeline or a class file:

    function nameOfFunction (event) {}

    do things

    };

    Then the button, we would have a script event listener calling the function:

    myButton.addEventListener (MouseEvent.CLICK, nameOfFunction);

    Can someone explain to me how it works in the EA?

    It seems easy to use for the very basic functions, but anything more requires advanced js knowledge!

    I watched a lot of tutorials but they are for older versions of the edge or that they cover only the basic stuff.

    It doesn't seem to be much out there at all.

    Thank you very much

    Hello

    Put the function in the compositionReady

    SYM. Nomfonction = function() {}

    Do all that in the service

    }

    and call it when you want it

    SYM. Nomfonction();

    I hope this helps.

  • How to write the trigger for update of 2 tables

    Hi all
    I have 2 tables,

    1.lv_data,
    It contains the following fields,
    emp_name        tot_days
     guru                    18
                
    2.leave_data
    It contains the following fields,
     emp_name          From_date              to_date            no_of_days       remaining_days
     guru                    02/05/2012          03/05/2012           2                         
    In the second table, if the data is inserted.
    the no_of_days will be calculated automatically (from to_date - From_date) + 1,

    Here, I need to write the trigger to update the remaining_days column,

    First table for all tot_days emp_name is 18 days,
    Thus, in the second table every time that the record is inserted.
    the remaining_days must be calculated as follows,

    remaining_days: = tot_days - no_of_days and this (calculated) value should be updated in the tot_days column in the first table (lv_data).

    Example:
    emp_name        tot_days
    guru                    18
                
    2.leave_data
     emp_name          From_date              to_date            no_of_days        remaining_days
     guru                    02/05/2012          03/05/2012         2                          16
    [/code  
    
    Now the first table should be updated like,
    emp_name tot_days
    Guru 16


    So I need to update to 2 tables,
    can someone help me to update these 2 tables through TRIGGER?

    Thank you
    Kind regards
    gurujothi

    Edited by: Gurujothi may 1, 2012 19:54

    It is generally considered bad practice to store the value even in 2 places. You are having the kind of problems that you are experiencing now. It is much easier to store in the main table and get the value from there where you need to show in your forms.

  • How to write the function or procedure to function 'Round' in oracle

    Hello friends,

    Last week I went to attend the interview. I asked a function, or a procedure to achieve the functionality of the 'Round' function in oracle manually. I couldn't reach it properly. Can someone let me know how I can do this? Is a mathematical idea behind it?

    Thank you and best regards,
    SB

    Hello

    create or replace
    function my_round_fn (p_number in number, number of Round_Val)
    Return number
    is
    whole v_round;
    Start
    v_round: = P_number * Power (10, Round_Val);
    Return v_round / (Power (10, Round_Val));
    end my_round_fn;

    It works in all cases.

    Kind regards
    Praveen

  • How to find the function to remove the ink level

    Can someone please tell me how to find the function "for the removal of the ink level window" I need know when I use no to factory ink cartridges. I have Windows XP, but this is probably not important.

    Hi Laura,

    Find things such as ink levels is a function of the printer driver.

    This is provided by the manufacturer of the printer, and they are the best resource on the operation of their particular drivers.  Therefore, it is best to ask the manufacturer of the printer for advice on this issue.

    Sometimes, there is an icon in the taskbar that you can get this information.  Yet once, it is a function of the driver and the printer software.

    For reference:

    Check on a printer ink levels

    http://Windows.Microsoft.com/en-us/Windows-Vista/check-ink-levels-on-a-printer

    How can I check my ink or toner levels?

    http://Windows.Microsoft.com/en-us/Windows7/how-do-I-change-my-ink-or-toner-levels

  • How to write a function to estimate the number of rows returned SQL?

    How to write a function to estimate the number of rows returned SQL through SQL Execution Plan?
    My idea is
    Call dbms_sql.parse to create the SQL PLAN, then ask the PLAN for the number of estimated return lines.
    But how to get SQL plan through "id cursor?
    Thank you.

    You can use EXECUTE IMMEDIATE to explain plan statement. About the STATEMENT_ID generation, it could be anything. Even a SYSTIMESTAMP cast as TANK would work.

  • How to display the value of the variable for bottom of pl/sql

    How to display the value of the variable for bottom of pl/sql

    declare

    V_1 number: = 10;

    V_2 number: = 20;

    V_3 number: = 30;

    v_4 number: = 40;

    v_5 number: = 50;

    test varchar2 (100);

    Start

    I'm in 1.5

    loop

    test: = "v_" | I have;

    dbms_output.put_line(i||) e > ' | test);

    end loop;

    end;

    /

    How to get below output:

    1 > v_1

    2 > v_2

    3 > v_3

    4 > v_4

    5 > v_5

    But I want to output of

    1 > 10

    2 > 20

    3 > 30

    4 > 40

    5 > 50

    Hello

    You cannot reference variables as you did and get the value of the variable. Use pretty collection.

    set serveroutput on size 2000
    declare
      type      number_table is table of number;
      numbers   number_table := number_table(10, 20, 30, 40, 50);
    begin
      for i in numbers.first .. numbers.last
      loop
        dbms_output.put_line(i || '->' || numbers(i));
      end loop;
    end;
    /
    
    anonymous block completed
    1->10
    2->20
    3->30
    4->40
    5->50
    

    See the Collections of PL/SQL and Records http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS005

  • How to write a script for date get to the Clipboard

    Hi experts,

    How to write a script for date get to the Clipboard.

    the date format will be like this:

    05 - may

    respect of

    John

    Thanks guys, thanks Sanon

    I finally use the .bat doc

    like this:

    @@echo off
    for /f "delims =" % in (' wmic OS Get localdatetime ^ | find ".") "") Set "dt = %% a"
    the value "YYYY = % dt: ~ 0, 4%.
    the value "MM = % dt: ~ 4, 2%.

    If MM % is 01 set MM = January
    If % MM == 02 set MM = February
    If MM % is MM value = March 03
    If MM % is 04 MM value = April
    If MM % is 05 MM value = may
    If MM % is 06 MM value = June
    If MM % == 07 set MM = July
    If MM % is MM value = August 08
    If MM % is MM value = September 09
    If MM % is 10 MM value = October
    If MM % is 11A set MM = November
    If MM % is game MM 12 = December

    the value "DD = % dt: ~ 6, 2%.
    the value "HH = % dt: ~ 8, 2%.
    the value "Min = % dt: ~ 10, 2%.
    Set "s = % dt: ~ 12, 2%.

    Echo DD - MM HH % %% % Min | Clip

    It works

    respect of

    John

  • How to use the function @RETURN for poster messages Essbase in 11.1.2.1

    Hello

    I found the business support Essbase Hyperion Planning 11.1.2.1 @RETURN rule novelty.

    If I create a simple BR for planning app like below:
    "@RETURN ("test return message,"WARNING);
    Validation returns error and BR can not be deployed.

    One is how to use the function @RETURN br?

    Thank you!

    He probably should be in a calco for example block

    "Profit".
    (
    ....
    )

    It is more likely to be used with an IF ELSE command, you do not want to define the condition for the calculation, roughly what the feature is designed for output.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How can I write the trigger for the global temporary Table

    Hi Grus,
    How can I write the trigger for the global temporary Table.

    I created the TWG with trigger using the script below.


    CREATE A GLOBAL_TEMP GLOBAL TEMPORARY TABLE
    (
    EMP_C_NAME VARCHAR2 (20 BYTE)
    )
    ON COMMIT PRESERVE ROWS;


    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE, UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERRING AGAIN AS NINE OLD AND OLD
    FOR EACH LINE
    BEGIN
    INSERT INTO VALUES EMPNAME (: OLD.) EMP_C_NAME);
    END;
    /


    trigger was created successfully, but her would not insert EMPNAME Table...

    Please guide if mistaken or not? If not wanting to give a correct syntax with example


    Thanks in advance,
    Arun M M
    BEGIN
    INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
    END;
    
    you are referencing old value in insert stmt.
    
    BEGIN
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    END;
    

    then run your app, it works very well...

    CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
    (
    EMP_C_NAME VARCHAR2(20 BYTE)
    )
    ON COMMIT PRESERVE ROWS;
    
    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE OR UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    dbms_output.put_line(:OLD.EMP_C_NAME||'yahoo');
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    dbms_output.put_line(:OLD.EMP_C_NAME);
    END;
    /
    
    create table EMPNAME as select * from GLOBAL_TEMP where 1=2
    
    insert into GLOBAL_TEMP values('fgfdgd');
    commit;
    select * from GLOBAL_TEMP;
    select * from EMPNAME;
    
    output:
    1 rows inserted
    commit succeeded.
    EMP_C_NAME
    --------------------
    fgfdgd               
    
    1 rows selected
    
    EMP_C_NAME
    --------------------
    fgfdgd               
    
    1 rows selected
    

    He got Arun

    Published by: OraclePLSQL on December 28, 2010 18:07

  • How to write a query for the data exchange between two columns?

    How to write a query for the data exchange between two columns?

    I tried a request, does NOT work.
    update tmp t1 set t1.m1=t1.m2 and t1.m2=(select t2.m1 from tmp t2 where t2.student_id = t1.student_id)
    Thank you.

    Published by: user533361 on October 23, 2009 14:04

    Just plain and simple:

    update tmp t1
     set t1.m1=t1.m2,
         t1.m2=t1.m1
    /
    

    SY.

  • How to write the select query for it

    Hello

    I had an html form and the area I drop down and he needs to select several values in the drop-down box. When I select multiple values then I have to write the query to SQL select statement.

    When I try to write the select statement and trying to run I get the error message.

    Select * from Table

    where emo_no = '1,2,3 '.

    That's how I write the query please suggest me how to write the query to select several values in the drop-down box.

    Thank you

    Use the keyword sql 'in '.  If you don't know how, I've heard good things about the book Teach Yourself SQL in 10 Minutes by Ben Forta.

  • How to enable the function keys beats again after the upgrade of the OS?

    How to activate the function of key Beats again after an upgrade of the OS which is Windows 7 Ultimate 32 bit, I use HP Mini 210-4000

    Stealth,

    The combination of bat function keys is

    FN + b

    as stated in your Quick Start Guide

    Chapter 1, Page 2

    The Guide:

    Beats Audio is an improved audio profile that offers a deep, controlled all low by maintaining a
    Crystal clear sound. Beats Audio is enabled by default.
    ▲ To enable or disable the Beats Audio, press fn + b.
    Select Start > Control Panel > hardware and sound > Beats Audio

    ---------------------------------------------------------------------------------------------------------------------------------------------------

    If you are having problems with the audio works as it should, you may have to (re) install the drivers from the website of your laptop.

    There are actually two different models in the category of 210-4000 Mini.

    Start here to the Support and drivers

    • Select the model entry that corresponds to your laptop.
    • Go to Software and Driver Downloads
    • Select your operating system (Windows 7, 32-bit), and then click "Next".
    • Scroll down
    • The Audio driver is the first category...
    • Download the package, pay attention to where it is saved.

    Given that you just upgraded (probably from Vista?), you may need to update some other software too.  Go through the different categories and see if you need / want any of the other packages.  Most of them can be added 'above' of what you already have on the system.  If you must delete something, the program will inform you when you try to install the new version.

    • If you have control of "Admin", we can highlight the package and "double-click" to install, if not right click, select "Run as Administrator" and install.

    For Audio driver... After you update / install the driver, reboot your computer.  After that, you should have your software Beats back.  If no joy yet, go back and get the software Quick Launch bar of your website (heading Software Solutions) and install it...

    Good luck!

    ----------------------------------------------------------------------------------------------------------

    Click on the star of white Kudos on the left to give Kudos for assistance.

    Please click "accept as Solution" to say the problem is solved.

    Always include: (Computer) product number , printer - model number ,.

    Never give your serial number

    ----------------------------------------------------------------------------------------------------------------

    2012 the year of the Dragon!

  • How to write a function block?

    Hello

    Someone knows how to write a function block with LabVIEW?  Something like those in real time live > function blocks >.

    Thank you very much in advance?

    Assuming you are referring to these specifically...

    http://www.NI.com/white-paper/7339/en/

    .. then the answer is that it is almost impossible to make a new. However, there is really nothing special all that to their topic. They are essentially normal subVIs (which you can learn about the other links) which just happened to have some terminals connected to shared variables. I personally would not normally recommend that anyway. If you could clarify what exactly you are trying to do, it might be possible to give more specific advice.

Maybe you are looking for