Assign a value of zero for no. selected lines

Try to find a way to assign a value to null if my account has no line.

What I have right now is:
CREATE OR REPLACE FUNCTION count_deductions (empno IN emp.empno%TYPE)
RETURN NUMBER
IS
  ded_count      NUMBER(2);
BEGIN
  SELECT count(deduction_amount)
  INTO   ded_count
  FROM   emp_deductions
  WHERE  fk_empno = empno;
EXCEPTION 
  WHEN NO_DATA_FOUND THEN
    ded_count :=0;
  RETURN ded_count;
END;
/
Have tried different ways but I still get the message:
SQL > select * from show_deduction_v where empno = 7169;

no selected line

Instead of the zero value by filling in the field.

Ok. So the problem is that the view returns no rows. It has nothing to do with the service. The function returns 0 if there is no such thing as the EMPNO spent. The problem is that there is no line in the EMP with a 7169 EMPNO. This means that the function is never called.

Why do you want the view to return a row for an EMPNO that does not exist? Is there a table somewhere in the database where a 7169 EMPNO is? If so, your vision may outer join to that table.

Justin

Tags: Database

Similar Questions

  • Activate GoLink for a selected line

    Hello



    I have an af:table with one of the columns defined on a goLink which arises from the current record in a layout of the form. Is it possible to activate the link to the currently selected line? I have a problem because if they click on the link in another line, it will still open the folder they have currently selected.



    I was hoping to do something like #{bindings. {PubHtmlMainVO.collectionModel.selectedRow not true} for the property of the link disabled, however that everything causes errors. All those put in place something similar?



    Any help would be appreciated.



    Thank you



    JDev 11.1.2.0.0

    Check the work of Frank around this problem: https://blogs.oracle.com/jdevotnharvest/entry/jdeveloper_11_1_2_command

    Timo

  • COMMIT statement for a selected line

    Hello
    I'm working on an OAF page where there is a table region.
    This area of the table is linked to a VO and VO at an OA.
    I plugged on an EO because the user must be able to enter data directly on the table.

    I gave a button down save so that clicking on it, you need to a handler function in my AM.

    In the manager function, I getAllFetchedRows in a table, then one by one, I perform checks and then save by calling getOADBTransaction.commit after (vo.setAttribute) with the corrected values.


    Now my problem is that I use the same OS used in the above table when recording. So even if I want to save the line by line after audits by programming, the time getOADBTransaction.commit is called for the first line, all lines is saved without even going through the controls.

    Is there another way to call the validation so that it only records the line passed and all the lines.

    Concerning
    Hawker

    Raj,

    As the method getOADBTransaction.commit is called it will hire all the rows in your table, as you have in the annex EO based VO.

    For your condition, you will need to set the commit to the final loop instead of put for each iteration.

    Kind regards
    GYAN

  • a value of zero for the repeated value

    Hi all

    I have a table with columns and data as below:
    user, user void, total_amount, tour_id
    1000,1000,23.12,2345
    1000,1001,2.11,2341
    1000,1002,31.1,2345
    2000,2000,65.33,5321
    2000,2001,33.00,2345

    A user can have 0 or more users of void. In the above data, user 1000 has 2 under users and user 2000 a 1 user void.
    A user of sup and the respective user must not have the same tour_id, if they have the same id of Tower then under user total_amount must be changed to 0.
    In the above data, the user void 1002 has the same id of Tower as its user. If his total will have to be changed to 0.

    the output should look like,

    user, user void, total_amount, tour_id
    1000, 23.12, 2345
    1000,1001,2.11,2341
    1000,1002,0,2345
    2000, 65.33, 5321
    2000,2001,33.00,2345

    Can someone help me with the query.
    I appreciate your help.
    Thank you

    Your question is how change total_amount title assign zero value - which is why I responded with an update ;-) statement.

    Do you mean that you have not want to update the data? But it's just your query result that should display a zero without changing the data in the table?

    One way might be:

    select
    t.user,
    t.sub_user,
    case
       when t.sub_user != t.user and
          t.tour_id = (
             select t_user.tour_id
             from the_table t_user
             where t_user.user = t.user
             and t_user.sub_user = t.user  -- To get the user, not a sub_user
          )
       then 0
       else t.total_amount
    end as total_amount,
    t.tour_id
    from the_table t
    order by
    t.user,
    t.sub_user;
    

    A faster way using Analytics could be:

    select
    t.user,
    t.sub_user,
    case
       when t.sub_user != t.user and
          t.tour_id = first_value(t.tour_id) over (partition by t.user order by t.sub_user)
       then 0
       else t.total_amount
    end as total_amount,
    t.tour_id
    from the_table t
    order by
    t.user,
    t.sub_user;
    

    BUT the solution above only works if sub_user id are always superior to their user id.
    So for this solution I guess that something that seems to be involved in your sample data, but I can't be sure that it is always the case for your actual data ;-)

  • Remove the feature for the selected lines in the scrolling area

    Hello

    I created a scroll box with selector box at level 1, so that end users can select desirable to delete lines. I need help of your gurus on the removal of the line feature.

    PeopleSoft offers a built-in function to remove lines or Javascript is the best option?

    Please help me

    Thank you

    I assumed that the box was a field of a derived record that you placed on the grid yourself.
    Probably, you use the grid selection option.

    In this case you must use the property Selected of the Row object as an indicator.

    Local Rowset &RS1;
    
    &RS1 = GetLevel0()(1).GetRowset(Scroll.MBT_DEPT_TBL);
    For &I = &RS1.ActiveRowCount To 1 Step - 1
       If &RS1(&I).Selected Then
          &RS1.DeleteRow(&I);
       End-If;
    End-For;
    

    In the previous code, I had a typo in online

    &RS2.DeleteRow(&I);
    

    It must be

    &RS1.DeleteRow(&I);
    

    Kind regards

    Halin

  • assign the value to a selection of the result of a query control

    I want to assign a value to my controls with the result of the query.

    It works for CFINPUT TEXT, but it does not work to SELECT

    I want to know are there any way tp affect my drop-down list value based on the result of questy.

    I have CFSTOREPROC as follows:

    < cfstoredproc procedure = "PSP" >

    < cfprocparam value = '#form. "IDNumber #" CFSQLTYPE = "cf_sql_integer" >

    < name cfprocresult = resultset "spResult" = "1" >

    < / cfstoredproc >

    < type CFINPUT = 'text' id = "txtIDNumber" value = "" #spResult.IDNumber # "/ >"

    I am able to name a TEXT of ENTRY CF as above the code value,

    < select id = "lstNumber" value = "#spResult.lstNumber #" > < / select >

    but it does not affect the value of my result of the query to SELECT entry.

    Is it possible to assign a value to the query result SELECTION control?

    I tried to use JavaScript that works if I pass a number, but it does not work if I pass a query result,

    Your help is very appreciated,

    Kind regards

    Iccsi,

    @Iccsi,

    My bad!  Yes, you will either need to the CFOUTPUT tag (that you commented out in your code) but without specifying a query or change the CFLOOP query CFOUTPUT = "Notes".  If one of these should work:

    OR

    -Carl V.

  • ([JDev12c, ADF] 1) how to get the value of a field of the line currently selected in question 2) af:table: flowScope

    Hallo,

    How can I get the value of a field in the row that is currently selected in an af:table?

    I need to pass this value to a setCurrentRowWithKeyValue who took the record to display in another (by a button) called page:

    Limited workflow

    Page1 - goToPage2-> setCurrentRowWithKeyValue-> PAGE2

    I defined a managed bean flowScope for the workflow in which I created the variable 'CodeToSetPage2Row '.

    I will store the value of the field for the selected line in this variable so that I can move on to the setCurrentRowWithKeyValue.

    Could be this method OK? Ore is there any good practice to achieve this goal?

    The managed bean flowScope used to go to the stubborn task may take some values from the outside?

    The workflow defined will be executed in a dynamic region.

    Thank you

    Federico

    Federico, you cannot use a flow variable scope for this page. The region has no access to the bean. You must use a workflow for this parameter.

    To get an attribute of the currently selected line you make slide data vo of control on the page attribute. This will create a link attribute for this attribute. Once this link exists, switch to source mode and remove the component that you do not want.

    The framework passes the value of the current row in this affair of the attribute (table should be in single selection mode).

    Click on the button, you switch the binding of the attribute for the setting of task flow using a setPropertyListener.

    In the workflow, you call the setCurrentRowWithKeyValue with the parameter of workflow as the default activity.

    Timo

  • EL for obtaining a value of selected line

    Hello experts!

    I have a page with a table of users and I implement a button named "Reset the user password".

    I want to display a popup with a title: "reset password for user: xxxx", where xxx is to be obtained by EL referring to the current user selected in the users table.

    Any idea? I use jdev 12.1.2

    Thank you!

    I found the solution in the book Jobinesh-Oracle that I bought a long time ago! (Thanks!)

    Declaratively reading the value of the attribute of the currently selected line

    It is very common that when a line is selected in a table, you can update

    other fields in the user interface or call some specific operations with attributes of the selected

    line. There is an easy way to retrieve the attributes you want for the current of line

    definition of the attribute for the attribute binding.

    To set the attribute binding, do the following:

    1. double-click on the file page definition to open the presentation Editor.

    Alternatively, if you have the JSF page opened in the designer

    window, and then by selecting the links tab will open the corresponding

    page definition file editor.

    2. Select the links and the executable tab and click the Green plus icon to

    create a control's binding icon that will be displayed on the bindings panel.

    3. in the dialog window insert an element, select the generic category of links (if it)

    is not selected by default) in the menu drop down and select attribute values

    as the point to be created. Click OK to proceed to the next step. In the

    Create the attribute Binding dialog box, select the desired data source

    (instance of the view object) and then the attribute you want to read

    the line selected in the data source. Click OK to have the dialog box.

    The following is an example for a binding attribute value defined by choosing the

    Collection Departments as data source:

    It's in the page definition XML file

    ID = "DepartmentName" >

    Once you have defined the attribute bindings, you can refer to them using the

    EL of the client binding expression. For example, the value of the previous attribute

    reference can be made using the expression of ADF link as follows:

    #{bindings. DepartmentName.inputValue}

  • The MGP Apply mode / 'write' for the selected users?

    Is there a work around to implement the mode of MGP Apply / 'write' for the selected users? The reason is that we have registered who transact only the request online. In this case, they don't need to synchronize. Manually change the ALL_CLIENT$ CAN. OUTQUEUE_DIRTY to ' has only a temporary effect and would normally return to 'Y' after a user made another transaction online. Please advice.

    If you have users who just order updates, then why do need to be put in place in the mobile app? they still appear in synchronization history? If this isn't the case, then I suggest that you just drop them from the mobile server because they have no need for the application lite oracle, just access to the server application.

    Regarding updates to direct data to the tables of mobile repository then (although not recommended), normally they don't cause problems, but would bypass in some cases associated with the transformation.

    If you change the param_value in c$ all_subscription_parameters, then the new setting of subsetting to take effect. However, if you do the same action via mobile manager, it also triggers a reset (if used) customer zero, assignment of new values in sequence and re-evaluation of the list of items of publication associated with c$ all_client_items - these products of two change would be lost if you just update the data in the table

  • ORA-06550 assign the value to the parameter

    Hi trying to assign the date quarter to a variable and get this error message, how can I assign a value to this parameter to PL/SQL:

    declare

    Neighborhood varchar (2);

    Start

    Select to_char (sysdate, 'YYYY-Q') in double shifts;

    dbms_output.put_line (Quarter);

    end;

    [Error] Execution (05:42): ORA-06550: line 2, column 42:

    PLS-00201: identifier 'vQUARTER' must be declared.

    ORA-06550: line 2, column 50:

    PL/SQL: ORA-00904: invalid identifier

    ORA-06550: line 2, column 3:

    PL/SQL: SQL statement ignored

    ORA-06550: line 3, column 26:

    PLS-00201: identifier 'vQUARTER' must be declared.

    ORA-06550: line 3, column 5:

    PL/SQL: Statement ignored

    your error message refers to vQUARTER, which is not listed in your code example.

    In addition, quarter is 2 characters such as defined in your code, but you ask to 6 characters in there, for example, 2016-1

  • Passing the value of the SQL query select list

    Hello

    In my application users have in their homepage to a region which has two simple things, a part of LIST SLECT lov function and a BUTTON

    There is also another page which has a normal life to report which shows the employees.


    Homepage the user can select certain number of Department in its 'SLECT-LIST' and click 'open '.


    For example: If the user has selected a DEP_NUM_5 and click on the BUTTON it will be redirected to the page of a report and gets only showed the employees belonging to the Department 5.


    The report page contains a simple SQL query, and I understand that somehow I must pass the value in the SELECT LIST, where I now have the '?


    How can I do this, where should I start?

    Of course I would really appreciate an example of code, if anyone has time to do a.

    
    select "EMP_ID", 
    "EMP_FORNAME",
    "EMP_SURNAME",
    "DEP_NUMBER"
    from EMP E
    where E.DEP_NUMBER = ????????
    
    

    Hi Sozua,

    1. create an item hidden on the page where you have the report.

    I say P2_DEPT_NO

    2 assign to that in your sql query

    select "EMP_ID",
        "EMP_FORNAME",
        "EMP_SURNAME",
        "DEP_NUMBER"
        from EMP E
        where E.DEP_NUMBER = :P2_DEPT_NO
    

    below the area source ther is also an option

    Elements of page to submit-> put this element in this.

    for example;

    Page to submit items: P2_DEPT_NO

    3. change your button

    Action: Redirecting to page of this application

    Page: 2 / / assuming that page 2 is the report page

    Place these items: P2_DEPT_NO

    with these values: & P1_SELECT_LIST.  assuming that selection list is on page 1

    Hope this helps you,

    Kind regards

    Jitendra

  • How to assign the value to the application-level element

    Hello

    I'm learning to APEX.  I use version 4.2.6.

    My question is, I set a text field called 'FINANCIAL_YEAR' in the login page.  I wanted to know how to assign this value to a text element of Application level (on page sent), so that I can get this value through at my request.

    Thank you

    -Anand

    anand_gp wrote:

    Yes, I created a 'text area' under 'HTML' in the 'Home' page  Who accepts the exercise of a table through LOV.  I intend to assign this value to a global variable so that this variable can be read in any of the application to filter the result set from different tables (not yet built the rest of the application).  To do this, I was intending to use "Shared components"-> "Elements of Application".  I'm still not quite sure how it works.

    Start by reading the documentation on elements of application.

    Go to the shared components > Application parts and create your G_FINANCIAL_YEAR item. Value Session State Protection Restricted - can not be set the browser so that the value is not editable by the user, falsification of URLS or scripts.

    On the home page, if there is not already a button to submit the value of the fiscal year, add one in the HTML area, with the Action as a submit Pageclick. Otherwise, you can do without the button and using submit Page in Page Action when the changed value select the parameter in the list so he can undergo.

    Then, in the section of the Page processing, create a calculation:

    Point Type: Application-level element

    Calculate Item: Application: G_FINANCIAL_YEAR

    Point calculation: After submit

    Type of calculation: Value of the element

    Calculation:

    Run the application, select a value in the list of the fiscal year and submit the page. Review of current session state in the viewer of session state by clicking on the link of Session in the toolbar developer. Select the Elements of Application in the view list, and then click set. The element of your application and its current value must be visible. You can now reference value throughout your application by using the appropriate syntax.

    You should also consider if a default value (for example the current year) using a calculation Application from the point of calculation on the new Instance and coordinate the application point and part of the homepage using point application as the Source of value or an expression with Source page element, the value always, replacement of value that exists in the session state.

  • The assignment of value to the block multi-record in Oracle's 10 g

    Hi all

    I'm new to form of Oracle 10 g.

    I have a block of several recording that does not rely on the database. I need to assign the value to this block multi-record dynamically the ref cursor.

    I'm trying to set the value as below, but its does not work. Please help me on this.

    loop
         fetch cur Into screenval_rec ;
          exit when cur%notfound ;
          first_record;
       
      :BLOCK1.COL1:= screenval_rec.value1;
        :BLOCK1.COL2 := screenval_rec.value2;
        :BLOCK1.COL3:= screenval_rec.valu3;
      
         next_record;
    End loop;
    
    

    Kind regards

    REDA

    Hi Craig,.

    Thank you for your information.

    But I found the exact cause of this "Invalid cursor error' (ORA-01001) in Oracle forms. It is because of the unique enclosed in quotes the select statement of the REF cursor. I found in the paragraphs below Oracle.

    Note 170881.1 - ORA-1001 calling a stored procedure that contains a REF Cursor Oracle Forms

    Once I deleted the quotes, it's working properly now.

    Thanks again for your help.

    Kind regards

    REDA

  • How to assign the ID of group for each group in the SQL query.

    Hi all

    I want to assign the ID of group for each group (group ID of series). I tried with the row_number function but did not work for my requiredment. Here is my sample data and my requirement.

    Col1
    A
    A
    A
    A
    A
    B
    C
    D
    D
    D
    D
    E
    E
    E
    F
    G
    G
    G

    I want to get number of each column with ID group assign to it value. Here is my example output

    Col1 County Group ID
    A 5 1
    A 5 1
    A 5 1
    A 5 1
    A 5 1
    B 1 2
    C 1 3
    D 4 4
    D 4 4
    D 4 4
    D 4 4
    E 3 5
    E 3 5
    E 3 5
    F 1 6
    G 3 7
    G 3 7
    G 3 7

    Select col1, count (1) NTC (col1 partition).

    ROW_NUMBER() over (partition by col1 by col1 order) tbl_test grp_id.

    Please help me solve this problem.

    SELECT

    COL1,

    COUNT (*) ON MYCOUNT (COL1 PARTITION).

    DENSE_RANK () OVER (ORDER BY COL1) GROUPID

    Of

    T1;

  • 3.1 assignment multiple value formatting

    I use "|" as my multiple assign delimiter. In my chart LoadData, merge multiple values using that delimiter. I have the code in a loop like this:

    ResourceInfo ResourceInfo = + ' | '.

    In my bulk loading, I set the delimiter to assign several ' |. '  In 3.0, when I show this multiple assign field in a results list, each value is separated by a line break, like this:

    Project resources: Karen James-Project Worker

    Ryan Bookout-project worker

    Steven Davis-project worker

    But to the point 3.1, each value is separated by a comma with no line breaks, like this:

    Project resources: Karen James-project worker, Ryan Bookout-project worker, Steven Davis-project worker

    Is there a way of 3.1 having set several values are displayed with a power line as it did in 3.0?

    I found how to display multiple values on individual lines (rather than strung separated by a semicolon or a comma). In the Studio, when you added a field multi - attribute to the list of results, change the attribute, open the display options, and for values multiple display select "individual lines. I did not notice this option before.

Maybe you are looking for

  • pls confirm 855-602-7992 is mozilla &amp; service of Cyber crime

    I was on the phone with very useful help system that I couldn't go to Mozilla - I've had for many years. I was told that my ip address has been hacked. Melvin was extremely helpful and told me that I needed a level 3 anti-piracy expert that my driver

  • Missing error profile

    Firefox does not load. Error is "profile is missing or incomplete. I tried Firefox in removing and reinstalling. Same mistake. Where is my profile and how to fix it?

  • Netflix queue problem?

    When you try to add a movie to my Netflix queue, I get the following message: we're sorry, an error has occurred while processing your request. "I called Netflix, they can add it manually in my queue. I edited the blocker to exclude from Netflix, but

  • Efi partition damaged or corrupted after installing windows 10

    Well, I had another post on this subject, but I decided I want to start a new thread that I have eliminated a lot of things and feel that I reduced it down to start EFI partitions.  Here is the fall back on what has caused all this. I had a copy perf

  • I hit the button 'block this computer' by mistake. How to unlock it?

    When I went to shut down my computer last night, I hit the button to "lock" by mistake. How to cancel it?