using the value null with a function

Guys, newbie here

What is the value NULL in function header? Does this mean that I can pass a value zero?

FUNCTION tot_sales

(company_id_in IN company.company_id%TYPE,

status_in IN order.status_code%TYPE: = NULL)

RETURN NUMBER

Hello

dorianpc wrote:

Guys, newbie here

What is the value NULL in function header? Does this mean that I can pass a value zero?

FUNCTION tot_sales

(company_id_in IN company.company_id%TYPE,

status_in IN order.status_code%TYPE: = NULL)

RETURN NUMBER

You can always pass NULL for any argument.

What does this code mean, is that the argument is optional (what, you don't have to spend), and if you do not pass it, status_in will be NULL inside the function.

So call for your function with 1 argument, like this:

t: = to_sales (c);

is equivalent to calling with 2 arguments, like this

t: = to_sales (c, NULL);

where the 2nd argument is null.

Tags: Database

Similar Questions

  • Can I use data value references with a functional overall?

    Can I use data value references with a functional global?  I am trying, but it causes problems:  I run the attached VI with "new DVR" selected.  Then I run it again with "return array" and I get the error 1556: "The reference is invalid. This error might occur because the reference has been deleted."  It seems to have forgotten the DVR, but I thought it should be stored in the shift register.
    
    Another odd thing:  In my VI, if I try to connect the wire shown in "something strange", then the type changes (from U16 array to DBL), i.e. it doesn't recognize the type referenced by the DVR.
    
    I want to pass a very large 4-dimensional array between parallel loops with a functional global.  To avoid memory problems, I want to use a DVR and in-place element structures.  If that's not allowed in Labview, I will try passing it through a user event or notifier.  Any problems with those alternatives?
    
    Thanks.
    

    I received a response from an engineer applications OR on this subject, and it seems that it is perhaps a problem with Labview.  They are working on it, so I'll go ahead and close this discussion.

    Thanks for the help,

    Allan

  • swfbridge has the value null with multi soft version Flex 3.3

    I use Flex 3.3 to implement a version of multi Flex AIR App (unique security and areas of Application of brother) using the Bootstrap method. When my main app load a sub app in a field of brother I find that the property of the SWFLoader swfbridge is null and therefore, I am not able to send all events between the main and void / apps. I saw a post on these forums that with Flex 4.0 you need to add the option in MXMLC

    -includes = mx.managers.systemClasses.MarshallingSupport. This class is not there in Flex 3.3? Is there something equivalent, that I can do with Flex 3.3?

    You should be able to access the content and attach headphones without the bridge.

  • using the function - how to use the values of the input variables on the table select statement names

    Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.

    CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    )

    RETURNS INTEGER

    AS

    -Declaring variables

    v_is_true INTEGER.

    BEGIN

    SELECT

    CASE

    WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)

    THEN 1

    ON THE OTHER

    0

    END

    IN

    v_is_true

    Of

    in_schema.in_tablename

    ;

    RETURN v_is_true;

    END;

    /

    When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist

    How to use the values of the input variables on the table select statement names?

    Hello

    Here's a way you can use dynamic SQL statements for this task:

    CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    in_first_date DATE DEFAULT SYSDATE - 1,.

    in_last_date DATE by DEFAULT NULL

    )

    RETURNS INTEGER

    AS

    -IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield

    -contains all the dates in the in_first_date of the range through included in_last_date

    - and it returns 0 if there is no such lines.

    -If in_last_date is omitted, the search only the data on in_first_date.

    -If in_first_date is omitted, it defaults to yesterday.

    -Time parts of the in_first_date and in_last_date are ignored.

    -Declaring variables

    sql_txt VARCHAR2 (1000);

    v_is_true INTEGER.

    BEGIN

    sql_txt: = 'SELECT COUNT (*).

    || 'FROM ' | in_schema | '.' || in_tablename

    || 'WHERE ' | in_datefield | ' > =: d1'

    || «AND» | in_datefield | '< >

    || 'AND ROWNUM = 1';

    dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE");  -For debugging

    Sql_txt EXECUTE IMMEDIATE

    IN v_is_true

    With the HELP of TRUNC (in_first_date) - d1

    TRUNC (NVL (in_last_date

    in_first_date

    )

    ) + 1                -- d2

    ;

    RETURN v_is_true;

    END is_ydaydata_to_table;

    /

    DISPLAY ERRORS

    If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above.  In this way, you can easily see exactly what will be executed.  Comment out the call to dbms_output under test is completed.

    Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future.  For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days.  The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).

  • Calculated field with the currency formatting, and hiding the values null

    I am designing a PDF form for quote and I have a field defined to multiply the amount of an article and the unit price to the total price.  There are 5 lines on each quote, and if users are citing only 1 or 2 items I want the values null in fields unused price extended to be hidden.

    I did it with the following script

    If (event.value == 0) event.value = ";

    But when I enter the quantity and total price of price is displayed as a regular number (100) instead of currency ($100).

    I can format to currency with

    Event.Value = util.printf ("$%.2f", event.value);

    I don't know there's a way to combine to give rise to such a situation then, so if the field is 0, make null and if not then format as currency but I don't know how to do it.

    Any help would be appreciated.

    Andrew

    Newer versions of Acrobat hide zero for fields values using the number format and with a currency symbol. »

    But since you can't control the updating of user systems, you must use a small function documented for formatting numeric fields on the fly.

    With the extended price field set to 'None' format, you can add the following script to the Validation script "Custom" or add it to a custom JavaScript calculation. The "Custom Validation will work with any method of calculation. Note that the form must be cleaned or recalculated to see the result of the validation script change.

    if(Event.Value == 0) {}
    Event.Value = ""; set the field value to null to a value of zero
    AFNumber_Format (2, 0, 0, 0, "", true); number with no currency symbol format
    } else {}
    AFNumber_Format (2, 0, 0, 0, "$", true); for the format of the values non-null for number with the currency symbol
    }

    The positional parameters are the number of decimal places, the Style separator, negative value Style, Style of (unused) currency, currency symbol, the currency symbol Pre-hanging chain.

  • Siri in him sending text with the value 'NULL '.

    When I say, "Siri, text my wife, 'X', ' Siri responds correctly,"here is your message to Jill: 'X'. "" "  "Ready to send it?"  I say 'Yes' and sends the message.  As soon as I get a text from my carrier saying the recipient of the message was invalid.  100% of the time, I see that Siri has sent a text with the value NULL.

    I tried to restart my phone.  I tried to remove and re-add my contacts.  Anyone else having this problem?  Someone knows how to solve?

    If it's by the carrier, you should contact them and see what they receive in return for their side. Ive had Siri send messages for me and I have never seen this one IOS.

  • Treatment options for form (use the value of a form field to select a shared list or a web redirect page)

    Hello

    I tried something with the processing of the forms which doesn't seem to work. I wonder if the function really works or if I'm doing something wrong.

    Here is an example of what I do: I have a form that I want to use. I add "Web Page redirection" processing step to my form. When I click on the processing step to set up, under "General settings" there is an option that says "Choose how the launch of destination page is selected." In this drop-down menu, there are three options: always redirect to the same landing page, use a drop-down list to select the landing page and the value of a form field allows you to select the destination page. I have a hidden field on the form that contains the URL of the web page to which I would like to redirect. When I select 'Use the value of a form field to select the landing page', I select the hidden field to the field that contains the URL of the web page to which I want to redirect. It's my setup. However, when I submit the form, nothing happens, I do not redirect to the URL contained in the hidden field... This function still works? I'm doing something wrong? I can't seem to get the function "Use a drop-down list to select the destination page" to work either. The same thing happens when I try to use the "Add Contact to shared the list" processing step. I add the name of the list that is shared in the field hidden, but the contact does not appear in the shared list... These functions still work? If yes how do I configure them?

    Thank you!

    Well, I understood the problem of the shared list... You must add the ID of the list shared in the hidden field. I had to use Firebug to see the real ID of the shared list. Once you have the ID, use you it as a static value in the field. If the HTML code of the form will look something like this:

    If you do not use the lookup data ID. You use the ID real asset on the shared list. You must use something like Firebug to find.

    I'm glad everything is working.

  • Using the value of the column in the subquery?

    Hello friends. Because I didn't realize anything today, although focusing on the problem for hours, I would like to ask you a question.

    I have a report based on a query. The following statement is the minimum to avoid confusion between you:
    select cnt_gebiet, null work, 1 cs from tbl_gebiet
    
    union
    
    select 
    a.lng_gebiet,
    case when (select max(a.lng_arbeitsschritt) from 
    tbl_arbeit_zu_gebiet a, tbl_arbeitsschritte_neu b
    where 
    a.lng_arbeitsschritt = b.cnt_arbeitsschritt and b.lng_typ_arbeitsschritt = 3) = 1 then 0 else (select max(a.lng_arbeitsschritt) from 
    tbl_arbeit_zu_gebiet a, tbl_arbeitsschritte_neu b
    where 
    a.lng_arbeitsschritt = b.cnt_arbeitsschritt and b.lng_typ_arbeitsschritt = 3) end as lng_arbeitsschritt,
    2 cs
    from tbl_arbeit_crit_date a inner join tbl_arbeitsschritte_neu b on a.lng_arbeitsschritt = b.cnt_arbeitsschritt 
    where a.lng_arbeitsschritt = 1
    order by  cnt_gebiet asc, cs asc 
    My problem:

    I need to add the cnt_gebiet criteria to the query
    select max(a.lng_arbeitsschritt) from 
    tbl_arbeit_zu_gebiet a, tbl_arbeitsschritte_neu b
    where 
    a.lng_arbeitsschritt = b.cnt_arbeitsschritt and b.lng_typ_arbeitsschritt = 3 
    Do you have any idea how I can the union row, using the value of line (cnt_gebiet) of the above query as a criterion in the subquery resp. lower?

    skahlert,

    Something like this might work:


    WITH upper_query 

         AS ()SELECTcnt_gebiet   

                    NULL WORK , 

                    1 cs    

             DE tbl_gebiet   

             UNION

             SELECT a . lng_gebiet , 

                    CASE

                      WHEN (SELECTMax(a. lng_arbeitsschritt )  

                            DE tbl_arbeit_zu_gebiet a ,    

                                   tbl_arbeitsschritte_neu b 

                             a . lng_arbeitsschritt = b . cnt_arbeitsschritt    

                                   ET b . lng_typ_arbeitsschritt = 3 )=1     

                      THEN 0 

                      Else (SELECTMax(a. lng_arbeitsschritt )  

                            DE tbl_arbeit_zu_gebiet a ,    

                                   tbl_arbeitsschritte_neu b 

                             a . lng_arbeitsschritt = b . cnt_arbeitsschritt    

                                   ET b . lng_typ_arbeitsschritt = 3 )   

                    END AS lng_arbeitsschritt ,  

                    2 cs   

             DE tbl_arbeit_crit_date a    

                    INTERIOR JOIN them tbl_arbeitsschritte_neu b   

                      ON a . lng_arbeitsschritt = b . cnt_arbeitsschritt   

              a . lng_arbeitsschritt = 1    

             ORDER BY cnt_gebiet CSA ,   

                      cs CSA ) 

    SELECT Max (a. lng_arbeitsschritt ) 

    DE tbl_arbeit_zu_gebiet a ,    

           tbl_arbeitsschritte_neu b , 

           upper_query

    a . lng_arbeitsschritt = b . cnt_arbeitsschritt    

           ET b . lng_typ_arbeitsschritt = 3   

           ET upper_query . cnt_gebiet = : variable   

    Jeff

  • ORA-00900 when you use the command COPY with dynamic SQL

    Helllo,
    I created the following procedure:

    create or replace procedure copyTable (pSourceTableOwner IN varchar2
    pSourceTableOwnerPasword IN varchar2
    pTargetTableOwner IN varchar2
    pTableName IN varchar2
    pDatabaseLink IN varchar2)
    as

    vStatement varchar2 (250): = null;

    Start

    vStatement: = "copy of". pSourceTableOwner | '/' || pSourceTableOwnerPasword | '@' || pDatabaseLink |
    "Insert" | pTargetTableOwner | '.' || pTableName | ' using select * from '. pTableName;

    immediately run vStatement;

    end;
    /

    The generated command (variable vStatement) looks like this:
    "Insert a copy of O_GLCEN/o_glcen@SELLENTW o_jh. "X_PLZ_CD_MERGED_CTIS using select * from X_PLZ_CD_MERGED_CTIS".

    When you call this procedure as "exec copyTable ('O_GLCEN', 'o_glcen', 'o_jh', 'X_PLZ_CD_MERGED_CTIS', 'SELLENTW');" the following lifts:

    FEHLER in line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "SYSTEMTECHNIK". COPYTABLE", line 20
    ORA-06512: at line 1

    But when you call the command COPY directly from SQL prompt the statement runs without error.
    Is in general not possible to use the dynamic COPY with SQL command? If it is possible does anyone has an idea what I am doing wrong?

    Any help will be appreciated...

    Rgds
    JH

    I would like to use something like

    vStatement: = ' start in f (select * from ' | pSourceTableOwner |) '.' || pTableName | '@' || pDatabaseLink | Insert loop ') in ' | pTargetTableOwner | '.' || pTableName | "f-values; end loop; end; »
    immediately run vStatement;

  • I can get the data of a hygrometer using the RS232 port with the following T75.2F:H17.0% using a RS232 data logger format. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.

    I can collect data from a hygrometer in a text file using the RS232 port with the following T75.2F:H17.0% format, these data are collected using a data logger software. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.

    The setting below causes the error. Change for the second selection, output values of all channels.

  • Assignment of identifiers automatically or using the value of basic in the rules

    The question is quite simple. I want to order the instances of an entity. How these bodies are classified are of no importance. The problem is that the only information available on instances of the age, which may be one of several bodies and makes impossible to order. Is there any way to assign an identifier automatically apply this ranking, say 0... the number of instances - 1 or is - it possible to use the value of an instance of rules?

    A loop is a bad choice here - a recursive function would end in the same logical dilemma on the tie-break as you you. (If I can offer any advice it would be that the rule loops should be a last choice as a general rule, not a first, they are certainly not as easy to manage as recursive functions in a standard programming language).

    Essentially, you want to work on the price of the ticket (IE an attribute at the level of the entity of ticket):

    the price of the ticket =
    0; If the number of tickets more expensive than me + number of tickets as well as me<= number="" of="" free="">
    nominal value * number of tickets I have to pay for my price/number of tickets, the same value as me; If the number of cheaper tickets than me < number="" of="" free="" tickets="" and="" number="" of="" tickets="" more="" expensive="" than="" me="" +="" number="" of="" tickets="" same="" as="" me=""> number of free tickets
    otherwise the price of the ticket face value =

    where the number of tickets I have to pay for my price = number of cards of the same value that me - (free tickets - number of cheaper tickets than me)

    As I said, you can use alleged relationships to help you work on:
    number of cheaper tickets than me
    and
    number of tickets as well as me

    Published by: Sean Reardon on April 11, 2013 08:35

  • What is the empty string, the value null in the column, or...?

    I use Oracle 11.2, a table tb_class as follows:

    TB_CLASS (number (3) id, varchar2 (32) nm, seqNum number (3));

    1, 212
    2, "under", 12
    3, 'qq', 12

    Select * from TB_CLASS where id = 1 and n = null;... .no selected line
    Select nvl (nm) in the TB_CLASS where id = 1; ... 1 selected line

    Any know what's in the column of row id = 1 nm? I thought that it is an empty string, but why it returns no rows in the first query?

    Thank you!

    (1) in Oracle there is no difference between NULL and an empty string.

    (2) NULL is never equal to what whatsoever (including another NULL). NULL is never spotty what whatsoever (including another NULL). You must use the IS NULL and IS NOT NULL operators to search for NULL values

    SELECT *
      FROM tb_class
     WHERE nm IS NULL
    

    or

    SELECT *
      FROM tb_class
     WHERE nm IS NOT NULL
    

    Of course, it is also possible that you declare that the NM column contains one or more spaces or it contains one or more non-printable characters and not a NULL value. That's why we asked you what dump (nm) returns

    Justin

  • Not able to connect after changing the password using the VALUES ALTER clause

    Hello

    John explained earlier the clause VALUES below thread.

    Status expired

    I created a new account named SURI, and tried to use the password of the user account from the HR by using the VALUES clause. I was able to change the password but not able to connect SURI with HR password.

    Please see below for details. And the SQL statements that I have tried.
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 13 18:44:50 2012
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Enter user-name: sys as sysdba
    Enter password:
    
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    SQL> SELECT password
      2  FROM dba_users
      3  WHERE username = 'HR';
    
    PASSWORD
    ------------------------------
    4C6D73C3E8B0F0DA
    
    SQL> ALTER USER SURI IDENTIFIED BY VALUES '4C6D73C3E8B0F0DA';
    
    User altered.
    
    SQL> SELECT password
      2  FROM dba_users
      3  WHERE username='SURI';
    
    PASSWORD
    ------------------------------
    4C6D73C3E8B0F0DA
    
    SQL> conn suri/hr     -- HR account's password is hr only
    ERROR:
    ORA-01017: invalid username/password; logon denied
    
    
    Warning: You are no longer connected to ORACLE.
    
    SQL>
    Thank you
    Suri

    Its because you have used a different username.
    Oracle produces a hash based on the user name and the password, not only the password.

    Therefore, you can not use the hashed password of a user to log on to the account of another user.

    You need to get the password hashed Suri and then connect you to suri by using the password hashed Suri (using the identified by the syntax of values)

  • How to upgrade a table column using the values in the Oracle collection

    create or replace procedure test_coll
    
    IS
    
    CURSOR upd 
    IS
    SELECT CONTACT_NAME FROM Supplier_16;
    
    TYPE dept IS TABLE OF upd%rowtype;
    cur_var dept;
    
    Type List Is table Of  varchar2(20);
    Name List:=  List('Shilpi','Sunil','Shreyas','Saral');
    
    BEGIN
    
    OPEN upd;
    LOOP
         FETCH upd BULK COLLECT INTO cur_var;
    --    EXIT WHEN upd%NOTFOUND;
    
         FORALL i IN cur_var.FIRST..cur_var.LAST
      
         UPDATE supplier_16
    **  SET Contact_name= name(i);  ***
         
         COMMIT;
    
    END LOOP;
    CLOSE upd;
    
    END;
    On the "BOLD" line, I don't know how I should move the values of the collection of name I said without which are set all the values in the table supplier_16 = 'Saral.

    Help, please.

    Aashish S. wrote:
    Thank you very much...

    Yes, I slide collections and was trying to reach somwthing on similar lines to which you provided the code example...

    My essay is equipped to take a collection: initialized with values of say 3-4...

    Take other tables... A column... and update the column in the table (not PK, FK anything) using the values of the initialized collection...

    However, I am stuck between the two on how the UPDATE clause should be...

    OK, if it's just because you want to practice with collections, you might do something like this...

    SQL> set serverout on
    SQL> create table supplier_16 as
      2  select 'Frederick' as contact_name from dual union all
      3  select 'Robert' from dual union all
      4  select 'Jeremy' from dual union all
      5  select 'Simon' from dual
      6  /
    
    Table created.
    
    SQL> create or replace procedure test_coll is
      2    CURSOR upd IS
      3      SELECT CONTACT_NAME
      4      FROM Supplier_16
      5      FOR UPDATE;
      6    Type List Is table Of  varchar2(20);
      7    Name List := List('Shilpi','Sunil','Shreyas','Saral');
      8    v_contact_name varchar2(30);
      9    v_idx          number := 1;
     10  BEGIN
     11    OPEN upd;
     12    LOOP
     13       FETCH upd INTO v_contact_name;
     14       EXIT WHEN upd%NOTFOUND;
     15       UPDATE supplier_16
     16       SET    contact_name = name(v_idx)
     17       WHERE CURRENT OF upd;
     18       DBMS_OUTPUT.PUT_LINE(v_contact_name||' update to '||name(v_idx));
     19       v_idx := v_idx + 1;
     20    END LOOP;
     21    CLOSE upd;
     22    COMMIT;
     23  END;
     24  /
    
    Procedure created.
    
    SQL> exec test_coll;
    Frederick update to Shilpi
    Robert update to Sunil
    Jeremy update to Shreyas
    Simon update to Saral
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from supplier_16;
    
    CONTACT_N
    ---------
    Shilpi
    Sunil
    Shreyas
    Saral
    

    Of course, there is treatment rank by rank and is not best for performance, but it allows you to access your collection that you created names.

  • How can I fill the records using the value LOV

    Create a form based on the use of the following output Table EMP

    Create a database block IE control-> Dept No. block


    Create a database block - EMP
    Create a LOV to the Dept not according to the dept table.
    For the current No. Dept. Complete records of the employees

    How can I fill the records using the value LOV?


    Thank you

    Hello

    Create trigger KEY-LISTVAL for control_block.dept_no with code similar to the following:

    IF SHOW_LOV ('LOV_NAME') THEN
            SET_BLOCK_PROPERTY ('EMP_BLOCK', DEFAULT_WHERE, 'DEPT_NO = ' || :CONTROL_BLOCK.DEPT_NO);
         GO_BLOCK ('EMP_BLOCK');
         EXECUTE_QUERY;
    END IF;
    

    Hope this helps

    Best regards

    Arif Khadas

Maybe you are looking for

  • I can't unlock the phone, also, I'm sure that I type the correct pass

    I put the password for the lock screen, then I lock the phone (zte open), but when I try to unlock the device, pass fail.

  • Toshiba Q300 480 GB HARD drive does not start after migration

    Hello I bought a disc of Q300 489 GB to replace a small 840EVO of Samsung. I used the toshiba tool to clone the smallest to the largest player. However when the clone is finished and the reboot of the machine the machine hangs just at the start of th

  • HP Pavilion p7 - 1207c: HDMI or VGA output

    I hope someone can help me. I have a desktop HP Pavilion p7 - 1207c but he nor an HDMI or an exit VGA DVI only. Most recent monitors do not have a DVI input which I just bought one because my old monitor no longer works. Is it possible to install thi

  • these fake microsoft tech called me today

    these fake microsoft tech called me today I didn't give their my Bank info, but they had me there download 2 things a they were on my computer what do I do now to make sure im protected? and they can access all the computers in our modem now?

  • I can't open a file THM ext XP

    I imported the photos from my camera and I can't see some of them because they have a THM ext file name.