insertion of a line of db from a form with a value passed in another page

We have a report (P1) on a table (T1). P1 has a link column (C), and C is the PK on T1. By clicking on a link (that is, a line) in the P1 report takes you to the form (P2). P2 is used to allow the user to insert a new row in T1, with the constraint that one of the columns (X) of T1 must have the same value as X was in the line connected on P1. In addition, the X is a NOT NULL attribute.

What we do is:
First of all, by the way C P2 by defining the name of the link = P2_X_C and the value of link = # c#
Second, P2, we establish the form P2_C via a SQL element:

SELECT X
FROM T1
WHERE C =: P2_X_C

P2 shows well. We put P2_C to display only and allow the user to enter the values for the other columns. The value for X is not NULL and properly to match the value of P1. However, when we hit the button CREATE on P2, we get error: ORA-01400: cannot insert NULL into "T1". » X ». Cannot process the row in the table T1.

APEX seems to have a 'problem' with having a value in a form 'set' and sent to the DB on the INSERT.

Any help would be greatly appreciated.

Hello

You must use a calculation that runs before the header to set the value of P2_C - you can use the SQL of the to do. A calculation in this way ensures that the value is stored in the session.

When you set the value as the source of a display only element, the value is not actually subject with the page. Alternatively, if you use 4 Apex, you can set the item save the Session Yes State setting. This creates a version hidden element that is submitted with the page.

Andy

Tags: Database

Similar Questions

  • Populating a drop-down menu form with the values from MySQL database

    I'm creating a simple CMS that will allow staff to add new items on their site (sale of furniture).

    I want them to be able to choose from the list of values for some fields to ensure that the items are displayed on the website correctly (IE to avoid typos etc.).

    I have spent a lot of time to trawl forums and have so far obtained the code below.  When it was working I could only get the dropdown menu options of data contained in the database, as opposed to the list of DEFINED values that initially, I would put in my database.

    For example under the field named 'Type', I assigned these values: all ('table', 'chair', 'buffet', 'convenient', 'bottles', 'library', 'mirror', 'drawers','s chest', 'display', 'tvunit', "bedside", reads, "wardrobe", 'dressingtab', 'blanketbox', 'Office', 'filing cab', "workstation")

    Here's what I want to display in the drop-down, not only the five values of elements already in it.

    However, my CMS page is nothing display now not in the drop down and I can't understand why not!

    So my question is, first of all any ideas what's wrong with my code?  And second, how to fill the bottom of the fall with SET values?

    Thank you very much in advance for your help!

    I didn't want to bore you, then the code below is just the bit that is relevant to my question, rather than any connection $POST and info php etc.

    It is in my code php at the top of my page

     $sql = mysql_query("SELECT DISTINCT id, supplier, room, type, material, finish, bespoke, image FROM furniture ORDER BY ASC");
    
                        while($row = mysql_fetch_assoc($sql))
                        {
                    $supp .= "<option value=\"{$row['supplier']}\">{$row ['supplier']}</option>";
                    $room .= "<option value=\"{$row['room']}\">{$row['room']}</option>";
                    $type .= "<option value=\"{$row['type']}\">{$row['type']}</option>";
                    $material .= "<option value=\"{$row['material']}\">{$row['material']}</option>";
                    $finish .= "<option value=\"{$row['finish']}\">{$row['finish']}</option>";
                    $bespoke .= "<option value=\"{$row['bespoke']}\">{$row['bespoke']}</option>";
                        } 
    

    It's in my html code

    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form1"  id="form1">
    
                    <label for="supplier">Manufacturer</label>
                    <select name="supplier" id="supplier" title="<?php echo $row_add['supplier']; ?>" >
                      <? echo $supp; ?>
                     </select>
           
    
                     <label for="room">Room</label>
                    <select name="room" id="room" title="<?php echo $row_add['room']; ?>" >
                      <? echo $room; ?>
                     </select>
    
                           <label for="type">Type</label>
                          <select name="type" id="type" title="<?php echo $row_add['type']; ?>">
                           <? echo $type; ?>
                          </select>
       
    
                          <label for="material">Material</label>
                          <select name="material" id="material" title="<?php echo $row_add['material']; ?>">
                          <? echo $material; ?>
                              </select>
           
                              <label for="finish">Finish</label>
                          <select name="finish" id="finish" title="<?php echo $row_add['finish']; ?>">
                            <? echo $finish; ?>
                              </select>
       
                           <label for="bespoke">Can be made-to-measure?</label>
                           <select name="bespoke" id="bespoke" title="<?php echo $row_add['bespoke']; ?>">
                          <? echo $bespoke; ?>
                          </select>
    
                                  <input type="Submit" name="Add" id="add" value="Add" />
                          <input name="date" type="hidden" id="hiddenField" value="<?php echo $todayis['date']; ?>">
                          <input type="hidden" name="MM_insert" value="form1" />
                          </form>
    

    > So, don't you think not with my different approach?

    Yep, that's how it should be done.

    Note the OP also mentioned that they are filled with 6 drop-down lists:

    > 6 fields I want to post, drop downs in my a form are: provider, room, type of material, finish and custom.

    So you can create a table for each separate... but what I would probably do is store everything in a single table (depends of if you need to store additional information or if it's just a list of choice):

    optionsTbl

    Category ID value

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

    1 provider abc

    2 vendor xyz

    3 living room

    4 dining

    Enter values using a set of multiple records in the query: Select value of optionsTbl category WHERE = 'suppplier. " Select the value optionsTbl category = "room"; etc.

    Then fill the drop-down lists by looping through each query in the recordset and use next_result() to perform a loop on the next game.

  • Component report from a form with the input of the user parameters

    Hello

    I am new to Oracle reports. I have an application coded 6i. I currently use the application in Oracle Forms Builder 9i. There are also few reports which are called Forms. Given that the application has been developed in 6i, the report was called using Run_Product. Forms are a set of parameters of the user of the report using the parameter list pl_id. The syntax used is Run_Product ('D:\Report\sales.rdf', SYNCHRONOUS, DURATION, REPORTS, FILE system, pl_id, NULL);

    I learned that the Run_product does not work in 9i and we need to use run_report_object. I changed the code to use run_report_object and using web.show_document () I am able to run the report in the form. There are 2 parameters that should be passed to report forms. The parameters are from_date and to_date which will prompt the user to enter the performance of the form. In the report, the initial values of these parameters are defined. Thus, the report runs fine for the initial value always. But when I try to change to the form_date user input and to_date, the release of the report does not seem to take the new values, instead the old report with initial values (defined in the report) is running again.

    Can someone give me the code to pass the parameters defined by the user to the State of the forms? I defined a report object in the node forms such as REPTEST and defined a parameter list pl_id and form_date and to_date adds pl_id and uses the following encoding:

    vrepid: = FIND_REPORT_OBJECT ("REPTEST");
    vrep: = RUN_REPORT_OBJECT (vrepid, pl_id);

    But it does not work.
    In addition, the parameters defined in the forms and States should have the same name?

    Hello

    If you want to send the settings when you use RUN_REPORT_OBJECT, you simply line:

    SET_REPORT_OBJECT_PROPERTY (report_id, REPORT_OTHER,' FROM_DATE ='|: BLK_INPUT.) FROM_DATE | "= TO_DATE' | : BLK_INPUT. TO_DATE | »
    paramform = no ");"

    The hidden_action parameter is required to use PARAMFORM = YES and RUN_REPORT_OB JECT

    PARAMFORM Specifies whether to display the form of run setting when you run a report through CGI or a servlet. PARAMFORM is only used to supply parameters to the layout of paper reports, Web reports no JSP-based.

    http://www.Oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/Cmdline/common/bld_paramform.htm

    Regardss

  • Move to another page of amx from EPCO 12.1.3 java code. MAF

    Hello

    I am to go to the rest service in oracle MAF, I will get the response from the server remains in a java class. If the response is successful, I want to redirect to another page. How can I achieve this. Please help me.

    Thank you and best regards,

    Christelle N.

    Hello

    I found the solution.

    «"" "AMX page:»»"»

    text Disabled = "#{!}" Bindings.sendLoginDetails.Enabled}"="sendLoginDetails. "

    ID = "c1" >

    In the class of data control (which u create in the following way: right-click on a class in which you want to do as a class of data, click components to model, and then on Create data control)

    public void sendLoginDetails() {}

    If (Response.equalsIgnoreCase ("Success")

    {

    () AdfmfContainerUtilities.invokeContainerJavaScriptFunction

    AdfmfJavaUtilities.getFeatureName (),

    "adf.mf.api.amx.doNavigation,"

    (New Object() {"SUCCESS"});

    }

    }

    In the task-flow - accordingly:

                Success.AMX

           

                Login

               

                    SUCCESS

                    loginsuccesspage

               

           

    What the above code does is, if the response received from the server is successful, it redirects to another page comparing the key that you provide to us. For example in the code above, I gave HITS like key (new Object() {"SUCCESS"}) is compared to "SUCCESS" and redirects to success.amx who has the activity id ""loginsuccesspage "."

    Thanks & best regards,

    Christelle N.

  • When possible in Oracle Forms to insert a second line based on 1st row, so why not in the ADF?

    Mr President

    When possible in Oracle Forms to insert a second line based on 1st row, so why not in the ADF?

    The user just enter data in the Module of sales in one line of a Bill as below

    and it is displayed in two rows in financial Module.like below how to proceed in the ADF.

    You can see that invoice line contains the sales tax and the gross sales amounts, then it is posted to the financial Module above two lines.

    How to make ADF

    Respect of

    What I realized, this is:

    -You have a table in you screen.

    -You call CreateInsert 2 times to create 2 rows at the same time.

    -You will enter value in a specific column (c1) line1

    Looking for the value that you entered in row1 can be completely copied in the same column (c1), but in line2. is this correct?

    If so try to do the following:

    1. in the table inputText (c1) column set autoSubmit = true and setValueChangeListener to a method in backbean

    
           
    
    

    2. in the inputTextValueChangeListener method to write this code

      public void inputTextValueChangeListener(ValueChangeEvent valueChangeEvent)
      {
        DCIteratorBinding tableIter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("tableIteratorName");// write table iterator name from pageDef.
        for (int i = 0; i < tableIter.getViewObject().getEstimatedRowCount(); i++)
        {
          ViewRowImpl myRow = (ViewRowImpl) tableIter.getRowAtRangeIndex(i);
          EntityImpl entityImpl = myRow.getEntity(0);
          if (EntityImpl.STATUS_NEW == entityImpl.getEntityState())
          {
            System.out.println("New row found");
            myRow.setAttribute("AttributeName", valueChangeEvent.getNewValue());// write attribute name
          }
        }
      }
    

    3 - Add inputText id in the partialTrigger table

    
    

    4 - pageDef. Set of table iterator rangeSize = "-1".

  • Insert a blank line after each line grouped

    Oracle 11.2.0.1

    Windows XP

    I need to create a table (who have more to exported to the Excel SQL Developer) something like this:

    The user Scott Table Emp


    create the table temptbl as

    SELECT

    -case when lead (deptno) OVER (ORDER BY deptno) = deptno then empno otherwise null end AS empno.

    -case when lead (deptno) OVER (ORDER BY deptno) = deptno then ename otherwise null end AS ename.

    -case when lead (deptno) OVER (ORDER BY deptno) = deptno then job otherwise null end AS work,

    -case when lead (deptno) OVER (ORDER BY deptno) = deptno then null deptno otherwise end up LIKE deptno

    WCP

    Table created.

    SQL > select * from temptbl;

    EMPNO, ENAME, DEPTNO JOB

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

    7782 CLARK MANAGER 10

    PRESIDENT OF 7839 10 KING

    7566 JONES MANAGER 20

    FORD ANALYST 20 7902

    7876 ADAMS CLERK 20

    SMITH CLERK 20 7369

    7521 WARD SALESMAN 30

    7844 TURNER SELLER 30

    7499 ALLEN SALESMAN 30

    EMPNO, ENAME, DEPTNO JOB

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

    7900 JAMES CLERK 30

    MANAGER OF 7698 30 BLAKE

    14 selected lines.

    SQL >

    But it is not giving me the last row of deptno.  If I have to display the data on sqlplus then I can use break on jump 1, but since I create my correct query table (around 10 K lines), I just want to insert a blank line after each data grouped.

    Thank you.

    Select empno, ename, job, decode (empno, null, null, deptno) deptno emp

    Group by grouping sets ((empno, ename, job, deptno), deptno)

    /

    EMPNO, ENAME, DEPTNO JOB
    ----- ---------- --------- ----------
    7782 CLARK MANAGER 10
    PRESIDENT OF 7839 10 KING
    7934 MILLER COMMITTED 10

    SMITH CLERK 20 7369
    7566 JONES MANAGER 20
    7782 CLARK MANAGER 20
    SCOTT ANALYST 20 7788
    7876 ADAMS CLERK 20
    FORD ANALYST 20 7902

    7900 JAMES CLERK 30
    7499 ALLEN SALESMAN 30
    7521 WARD SALESMAN 30
    7654 MARTIN SALESMAN 30
    SALESMAN 7698 BLAKE 30
    7782 CLARK MANAGER 30
    7844 TURNER SELLER 30

  • INSERT INTO... SELECT FROM XMLTABLE()

    I'm trying to insert using a query to 11.2.0.3.  The table is defined as follows:

    CREATE TABLE book_master AS TABLE OF XMLTYPE XMLTYPE STORE AS SECUREFILE BINARY;
    

    The insert statement is structured in this way:

    INSERT INTO book_master
    SELECT
        t.invt_data
    FROM
        XMLTable(
            XmlNamespaces('http://www.mrbook.com/InventoryData' AS "invtdata", 
                      'http://www.mrbook.com/book' AS "book"),  
            '/book:BOOKS'
        PASSING ?
        COLUMNS
             invt_data XMLTYPE PATH 'invtdata:INVT_DATA'
        ) t;
    

    The parameter '?' is passed through JDBC.

    When I run the present, I get the error:

    Error report:
    SQL Error: ORA-19010: Cannot insert XML fragments
    19010. 00000 -  "Cannot insert XML fragments" 
    *Cause:    XML fragments got from extractNode cannot be inserted into the database.
    *Action:   Convert the fragment into a proper XML document before insertion.
    

    Is it possible to cast the XMLTYPE returned by XMLTable in a comprehensive document, instead of a node?

    Is it possible to cast the XMLTYPE returned by XMLTable in a comprehensive document, instead of a node?

    Well, the error message is pretty clear: you are trying to insert fragments, not a document (only root of content). It is not allowed.

    I guess that the query returns several items INVT_DATA, right?

    SQL > INSERT INTO book_master

    2. SELECT

    3 t.invt_data

    4

    (5) XMLTable

    6 ' / BOOKS»

    7 PASSAGE xmltype ('"")

    8 COLUMNS

    9 invt_data XMLTYPE PATH 'INVT_DATA '.

    (10) t;

    INSERT INTO book_master

    *

    ERROR on line 1:

    ORA-19010: cannot insert XML fragments

    We must build a document by encapsulating the fragments returned in a single root element.

  • Insert a blank line in the query output

    Is it possible to insert a blank line between two rows of the query output?

    In the EMP table, the column LINES is as follows:

    LINES
    1
    2
    3
    4
    1
    2
    3
    1
    2
    3
    4
    5

    I want to insert a blank line after every 1

    Please suggest.

    Sanjay

    I'm quite puzzled why you need rows in the dataset returned by a select statement that is empty.
    If you are using Oracle reports to the release date, you define the presentation of the report to have spaces between the rows returned by the select and have do not need to have the select statement returns a blank line after each line of data. If the output should be obtained by using another client, I think that the customer will have facilities for output formatting.

    Admit that you really need "blank lines" between data lines, I see only one way: use a temporary table and do an insert into select temporary_table (...) ... from... where... Then, in this temporary table, you can insert 'empty rows', which is actually not really empty, because they must have some fields that give the order of the rows. And then select in temporary_table, you place your order by the columns that are used to give the order for the release.
    Thus

    insert into temporary_table (
    ....
    )
    select ...
    from ...
    where ...
    ;
    for r in (
    select col1, col2, col3  -- columns used for order by
    from temporary_table
    order by col1, col2, col3
    )
    loop
      insert into temporary_table (col1, col2,col3, col4)
      values (r.col1,r.col2,r.col3, null);
    end loop;
    -- this way, a select * from temporary_tabel order by col1, col2, col3, col4 will return a blank row after each data row
    
  • CP5 narrow legends: insert a new line between existing lines

    In the Notes slide - closed captioning - 'Folienaudio' / 'Bilduntertitel' (narrow legends) is already there lines 1, 2, 3 and 4. I need to insert a new line between lines 3 and 4, but the + always opens a new line to the 2nd line.

    Is there a way to overcome this problem?

    Hello

    This can be done safely by the tab this subtitle in the audio slide dialog box.

    1. call the audio slide dialog box (shortcut: F5)

    2. go to the tab captions

    3. play audio

    4 stop the audio to the point where you need to add subtitles

    5. click on the button '+' to add captioning to the place you need.

    6. click on 'Save' to save the changes.

    This will save time.

    Rick: It could probably also completely accomplish the CC dialog box. I saw the recent problems reported with operation directly from this dialog box in CP5, so I offered to beginning of slide Notes.

    Ashwin: I do not see problems here Rick...

    Remi - Ashwin B

  • Insert a blank line in the result set

    Hi friends,

    SELECT * FROM EMPLOYEES ORDER BY DEPARTMENT_ID;

    As a result of the foregoing, I need to INSERT a blank line in the result for each department_id. for example, the result should resemble the following:

    EMP_ID - NAME - SALARY - DEPARTMENT_ID
    101 - Albert - 10 000 - 10
    102 - Benjamin - 8 000 - 10

    103 - Chitra - 10 500 - 20
    104 - David - 4 500-20
    105 - Elango - 6 000 - 20

    106 - faye - 6 000 - 30
    107 - Ganga - 9 000 - 30

    etc.

    I don't want to insert into the table. I need a blank line just on the screen.

    Thanks in advance.

    Published by: James on March 8, 2010 11:37

    Something like this->

    satyaki>
    satyaki>select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>select m.empno,
      2         m.ename,
      3         m.sal,
      4         case
      5           when sal is null
      6           and  empno is null
      7           and  ename is null then
      8             null
      9         else
     10           m.deptno
     11         end deptno
     12  from (
     13        select k.empno,
     14              k.ename,
     15              k.sal,
     16              k.deptno
     17        from (
     18                select empno,
     19                             ename,
     20                             sal,
     21                             deptno
     22                from emp
     23            ) k
     24        union all
     25        select t.*
     26        from (
     27                select distinct null empno, null ename, null sal, deptno
     28                from emp
     29            ) t
     30        order by 4
     31      ) m;
    
         EMPNO ENAME             SAL     DEPTNO
    ---------- ---------- ---------- ----------
          7782 CLARK            2450         10
          7839 KING             5000         10
          7934 MILLER           1300         10
    
          7566 JONES            2975         20
          7369 SMITH             800         20
    
          7902 FORD             3000         20
          7876 ADAMS            1100         20
          7788 SCOTT            3000         20
    
         EMPNO ENAME             SAL     DEPTNO
    ---------- ---------- ---------- ----------
          7900 JAMES             950         30
          7499 ALLEN            1600         30
          7844 TURNER           1500         30
          7654 MARTIN           1250         30
          7521 WARD             1250         30
          7698 BLAKE            2850         30
    
    17 rows selected.
    
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>
    

    Kind regards.

    LOULOU.

  • Why print preview and print lose lines of text from the image to the screen in the browser

    When I bring up (for example) a magazine article in my browser and you want to print it for future reference, print preview and printed image 'lost' lines of text between pages compared to the original image in the browser. For example: visit this link: http://www.pcauthority.com.au/Feature/408318, how-to-make-windows-admin-easy-with-powershell.aspx?eid=2 & edate = 20150828 & utm_source = 20150828 & utm_medium = newsletter & utm_campaign = weekly_newsletter & nl = weekly and select 'Print' from the menu. Print preview that appears - poster in portrait mode or landscape - loses one or two lines of text for the print version wraps useless. Where the missing text? pagination is not identical, and Firefox seems unable to handle it.

    I use a HP desktop with Intel i7 CPU 8 GB of RAM and Win 7 Pro SP1. Firefox is V40.0.3

    I do not see "imposed by the system of page breaks" encoded in this Web page. It would be difficult for an author of a Web page with an international audience.

    You use A4 paper, but what about those of us using letter-size paper? Page breaks may screw up page print to LETTER, from a Web site to THE like this.
    And what about the 'zoom' different levels? For printing which is called scale preview of Firefox and Page Setup print.
    I put systematically "modest" when printing to save paper, to keep the last page to only a few lines, or when the font size in print preview is too great (IMO) for printing on paper. And the size of police appeared to have worsened as monitor resolutions have gotten larger over the years.

    The only time wherever I lost lines of text between printed pages was when I was "pushing the limits" with the paper up and down / page margins. IOW, too small header / footer trying to get on each page as possible. By default, Firefox a. 5 "margins (left and right) with. 5 "header / footer (top and bottom margins) = letter-size paper. With 'A' type of paper using metric would be tantamount to the margins of 12.7 mm on all four sides. The /metric of inches "toggle" is with the size of the paper, the user has selected.

    Check the Page > margins & header / footer to see if you have the parameters of ~ 12mm or it they are smaller.

  • How better to insert a subarray (line) in a 2D array to the correct index which is based on the value of the first column

    Hello

    I would like to insert a subarray (line) in a 2D to the correct index table. The position is to say the index value depends on the value of the first column of the table 2d.

    As an examlple my 2d array would look like this

    230 50 215 255

    300 60 270 330

    360 20 350 370

    And I would like to insert another line (subarray) with the following values

    320 40 300 340

    This new line should be placed between the second and third rows (this is based on the first column only).

    I tried the threshold 1 d function table by taking an 1Dsub array of my 2d array (first column), then using the first of the new line (320) as the threshold. It sort of work, but it does not work when I start the table (IE there is only 1 row) and it seems to not work properly on other occasions (as explained in the help of Labview).

    Hopefully the explanation is clear enough for any suggestion. Thanks in advance for the help!

    JTRI wrote:

    The idea is I have start with a new table and add these lines in the right order every time that the user sets the values Jack

    Ahh, so try this.

    This will also work with an empty array.

    You want to do with this function it is a Subvi.

    Make the entries 'table' and 'subarray"on the connector, then 'new array' output.

    You can then put this Subvi in a loop with a registry to shift and it will help to add new lines in a sorted order, when they are added.

    That is what you were aiming for?

  • How to insert the new line char in sticky c# code?

    Hi all

    I paste the code complete c# on a line of string as follows.

    int _intUserID = 0; string _strUserName = string. Empty; string _strEmployeeID = string.empty;
     
    c# VS2005 .cs file code should stick as follows.

    int _intUserID = 0;
    String _strUserName = string. Empty;
    String _strEmployeeID = string. Empty;

    So how do you achieve this. by inserting the new line char in c#?

    Hi Murthy,

    Thanks for posting your query in Microsoft Community.

    I understand that you have problems with the code in Visual studio.

    The question you posted corresponds to the coding software, it would be better suited to the MSDN Community.

    Please visit the link below to find a community that will provide the support you want.

    http://social.msdn.Microsoft.com/forums/en-us/category/VisualStudio

    Hope it will be useful. If you still have questions, please reply and we will be happy to help you.

  • We can insert a new line at the end of af: table declaratively?

    Mr President.

    We can insert a new line at the end of af: table declaratively?

    Concerning

    In the t impl class substitution as below, after that, you should be able to insert at the end of the table.

    @Override

    {} public void insertRow (rank)

    Line lastRow = this.last ();

    If (lastRow! = null) {}

    int j = this.getRangeIndexOf (lastRow) + 1;

    this.insertRowAtRangeIndex (j, line);

    this.setCurrentRow (row);

    } else {}

    super.insertRow (row);

    }

    }

  • Create a trigger that send mail with attachment after insertion of a line in Oracle APEX

    I want to create an insert after trigger on a table that is to send a mail with an attachment. Here is my code.

    CREATE OR REPLACE TRIGGER tr_feedback

    AFTER INSERT on REVIEWS

    FOR EACH LINE

    DECLARE

    l_id NUMBER;

    BEGIN

    l_id: = APEX_MAIL. SEND)

                    p_to        => ' [email protected] ',

    P_FROM = >: NEW. E-mail

    p_subj = >: NEW. Object

    p_body = > "Please see the attachment."

    p_body_html = > ' review of < b > please < /b > the attachment ")

    APEX_MAIL. ADD_ATTACHMENT (p_mail_id = > l_id,)

    p_attachment = >: NEW. FILE,

    p_filename = >: NEW. FILE NAME,

    p_mime_type = >: NEW. MIME);

    END;

    But when I insert data, I get the following error:

    ORA-20022: Null value provided for the parameter p_filename.

    ORA-06512: at "APEX_040200.WWV_FLOW_MAIL", line 1070

    ORA-06512: at "APEX_040200.WWV_FLOW_MAIL_API", line 141

    ORA-06512: at "TR_FEEDBACK", line 11

    ORA-04088: error during execution of trigger 'TR_FEEDBACK '.

    Now, how can I fix that? Thanks in advance.

    Agree with the above.  Triggers (ab) should not be used in this way.  Nontransactional process should not be based on a transactional trigger.  These processes are part of the business logic and should be at the level of the company of codification (Summit, you can add a process to be executed once the completed insertion)

Maybe you are looking for

  • Tecra M2: Can play a game of the graphics card?

    It seems that play Flight Simulator could destroy the graphics card on the laptop! I never thought this would be possible. I gave a friend my old Tecra M2 (as a wedding gift) which he also uses to play FS9. A few years ago, he had to have the motherb

  • Envy5660 HP: Hp envy 5660

    When you press scan to e-mail function, error message below:SERVER CONNECTION ERRORThere was a problem connecting to the server. Press Retry to connect again, or OK to exit.When I retry, it won't work. Grateful if someone can advice here.Thank you

  • M200: Anycom BSH - 100 BT headset want connect to the A2DP profile

    I have an Anycom BSH-100 bluetooth headset, and I want to connect my M200 to play music via the A2DP profile. I have v4 stack, and I get an error message trying to configure the connection saying: "You cannot connect to a device that is not copyright

  • Strange Lag issues on Windows vista 32-bit as well as game slow load time

    OK, this is really starting to annoy me, and I would be very grateful if anyone can solve this problem for me. Well since I had my HP Pavilion Vista 32-Bit seems "randomly Lag" occasionally. For example, I'd be right on the web, and then all the comp

  • Issue of ASA VPN client

    Hello. I have a question about a connection between an asa5505-sec-bun-k9 (who acts as easy VPN client) and an EASY VPN server. The connection with the easy VPN server is OK, but I can't connect to the internet and create VPN for my ASA5505 connectio