Import the last row written in a database

Hello!
I want know what i have to do to import the last row written in a table from a MySQL database.
I'm using labview database toolkit.
Thank you in advanced.
Larson

Hi Larson
I total agree that my first suggestion isn't what you want but I wanted to put the idea across that you can retrieve records from table in the order they were written using a simple SQL command.
When dealing with databases I always design my queries using Design View in MS Access. Once you have the query designed you can then convert the query you have just designed in Design View to SQL by changing to SQL View.
So this example SQL statement would return the MAX Timestamp.
SELECT Max(tblTimeStampTest.Timestamp) AS MaxOfTimestamp
FROM tblTimeStampTest;
Say the timestamp was 12/14/2005 8:18:33
SELECT tblTimeStampTest.*
FROM tblTimeStampTest
WHERE (((tblTimeStampTest.Timestamp)=#12/14/2005 8:18:33#));
This will return your last record as long at the timestamps are unique and records are written in timestamp order. You can then use Build Text Express VI or Format into String to build your SQL strings that have variables like the timestamp above.
I have no experience with mySQL but I would assume MS Access could interface to it somehow either through ODBC or MS Access Projects so that can build you SQL commands.
David

Similar Messages

  • How to get the last row of a database table.

    HI ,
    I want to get record exactly from the last row of a database table.
    How is that possible?

    Hi,
    To fetch last record from an internal table, just do find the number of records in it and read using index.
    DESCRIBE TABLE ITAB LINES L_LINES.
    READ TABLE ITAB INDEX L_LINES.
    You can also use LOOP .. ENDLOOP but the above method is better (performance wise).
    using LOOP .. ENDLOOP.
    LOOP AT ITAB.
    **do nothing
    ENDLOOP.
    **process ITAB (Header record of ITAB).
    **after ENLOOP, ITAB will have the last record of the internal table.
    [here ITAB is internal table as well as header record.]
    But what is the requirement?
    If you are looking for the current record of an employee then you can use ENDDA = HIGH_DATE.
    My advice is to review your requirement again and try to fetch only that record which you need.
    Mubeen

  • HELP! How te retrieve the last row in MYSQL database using Servlet!

    Hi ,
    I am new servlets. I am trying to retireve the last row id inserted using the servlet.
    Could someone show me a working sample code on how to retrieve the last record inserted?
    Thanks
    MY CODE
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class demo_gr extends HttpServlet {
    //***** Servlet access to data base
    public void doPost (HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
         String url = "jdbc:mysql://sql2.njit.edu/ki3_proj";
              String param1 = req.getParameter("param1");
              PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");
              String semail, sfname, slname, rfname, rlname, remail, message;
              int cardType;
              sfname = req.getParameter("sfname");
              slname = req.getParameter("slname");
              rfname = req.getParameter("rfname");
              rlname = req.getParameter("rlname");
              semail = req.getParameter("semail");
              remail = req.getParameter("remail");
              message = req.getParameter("message");
              //cardType = req.getParameter("cardType");
              cardType = Integer.parseInt(req.getParameter("cardType"));
              out.println(" param1 " + param1 + "\n");
         String query = "SELECT * FROM greeting_db "
    + "WHERE id =" + param1 + "";
              String query2 ="INSERT INTO greeting_db (sfname, slname ,semail , rfname , rlname , remail , message , cardType ,sentdate ,vieweddate) values('";
              query2 = query2 + sfname +"','"+ slname + "','"+ semail + "','"+ rfname + "','"+ rlname + "','"+ remail + "','"+ message + "','"+ cardType + "',NOW(),NOW())";
              //out.println(" query2 " + query2 + "\n");
              if (semail.equals("") || sfname.equals("") ||
              slname.equals("") || rfname.equals("") ||
              rlname.equals("") || remail.equals("") ||
              message.equals(""))
                        out.println("<h3> Please Click the back button and fill in <b>all</b> fields</h3>");
                        out.close();
                        return;
              String title = "Your Card Has Been Sent";
              out.println("<BODY>\n" +
    "<H1 ALIGN=CENTER>" + title + "</H1>\n" );
                   out.println("\n" +
    "\n" +
    " From  " + sfname + ", " + slname + "\n <br> To  "
                                            + rfname + ", " + rlname + "\n <br>Receiver Email  " + remail + "\n<br> Your Message "
                                            + message + "\n<br> <br> :");
                   if (cardType ==1)
                        out.println("<IMG SRC=/WEB-INF/images/bentley.jpg>");
                   else if(cardType ==2) {
                        out.println("<IMG SRC=/WEB-INF/images/Bugatti.jpg>");
                   else if(cardType ==3) {
                        out.println(" <IMG SRC=/WEB-INF/images/castle.jpg>");
    else if(cardType ==4) {
                        out.println(" <IMG SRC=/WEB-INF/images/motocross.jpg>");
    else if(cardType ==5) {
                        out.println(" <IMG SRC=/WEB-INF/images/Mustang.jpg>");
    else if(cardType ==6) {
                        out.println("<IMG SRC=/WEB-INF/images/Mustang.jpg>");
    out.println("</BODY></HTML>");
         try {
              Class.forName ("com.mysql.jdbc.Driver");
              Connection con = DriverManager.getConnection
              ( url, "*****", "******" );
    Statement stmt = con.createStatement ();
                   stmt.execute (query2);
                   //String query3 = "SELECT LAST_INSERT_ID()";
                   //ResultSet rs = stmt.executeQuery (query3);
                   //int questionID = rs.getInt(1);
                   System.out.println("Total rows:"+questionID);
    stmt.close();
    con.close();
    } // end try
    catch (SQLException ex) {
              //PrintWriter out = resp.getWriter();
         resp.setContentType("text/html");
              while (ex != null) { 
         out.println ("SQL Exception: " + ex.getMessage ());
         ex = ex.getNextException ();
    } // end while
    } // end catch SQLException
    catch (java.lang.Exception ex) {
         //PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");     
              out.println ("Exception: " + ex.getMessage ());
    } // end doGet
    private void printResultSet ( HttpServletResponse resp, ResultSet rs )
    throws SQLException {
    try {
              PrintWriter out = resp.getWriter();
         out.println("<html>");
         out.println("<head><title>jbs jdbc/mysql servlet</title></head>");
         out.println("<body>");
         out.println("<center><font color=AA0000>");
         out.println("<table border='1'>");
         int numCols = rs.getMetaData().getColumnCount ();
    while ( rs.next() ) {
              out.println("<tr>");
         for (int i=1; i<=numCols; i++) {
    out.print("<td>" + rs.getString(i) + "</td>" );
    } // end for
    out.println("</tr>");
    } // end while
         out.println("</table>");
         out.println("</font></center>");
         out.println("</body>");
         out.println("</html>");
         out.close();
         } // end try
    catch ( IOException except) {
    } // end catch
    } // end returnHTML
    } // end jbsJDBCServlet

    I dont know what table names and fields you have but
    say you have a table called XYZ which has a primary
    key field called keyID.
    So in order to get the last row inserted, you could
    do something like
    Select *
    from XYZ
    where keyID = (Select MAX(keyID) from XYZ);
    Good Luckwhat gubloo said is correct ...But this is all in MS SQL Server I don't know the syntax and key words in MYSQL
    This works fine if the emp_id is incremental and of type integer
    Query:
    select      *
    from      employee e,  (select max(emp_id) as emp_id from employee) z
    where      e.emp_id = z.emp_id
    or
    select top 1 * from employee order by emp_id descUday

  • How to set focus on the last row of JTextPane

    how to set focus on the last row of JTextPane?
    import javax.swing.*;
    import javax.swing.text.html.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MyGUITest extends JPanel implements ActionListener
    {   public static void main(String[] args)
        {   SwingUtilities.invokeLater(new Runnable()
             {   public void run()
              {    JFrame f = new JFrame("My GUI");
                  MyGUITest GUI = new MyGUITest();
                  GUI.setOpaque(true);
                  f.setContentPane(GUI);
                  f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  f.pack();
                  f.setLocationRelativeTo(null);
                  f.setVisible(true);
        JTextPane txtP;
        JButton add;
        HTMLEditorKit hek;
        HTMLDocument hd;
        String txt;
        MyGUITest()
        {     this.setLayout(new BorderLayout());
         this.setPreferredSize(new Dimension(400,200));
         txtP = new JTextPane();
         txtP.setEditable(false);
         txtP.setContentType("text/html");
         txtP.setText("");
         hek = new HTMLEditorKit();
         txtP.setEditorKit(hek);
         hd = new HTMLDocument();
         txtP.setDocument(hd);
         JScrollPane sTxtA = new JScrollPane(txtP);
         add = new JButton("add");
         add.addActionListener(this);
         sTxtA.setBorder(BorderFactory.createTitledBorder(""));
         this.add(sTxtA, BorderLayout.CENTER);
         add(add, BorderLayout.SOUTH);
         new Thread(new Runnable()
         {   public void run()
             {   while(true)
              {   try
                  {     Thread.sleep(100);
                  }catch(InterruptedException ex)
                  {     ex.printStackTrace();
                  appendText("This is <b>HTML</b> text");
                  //add.doClick();
         }).start();
        public void actionPerformed(ActionEvent e)
        {     txt = "<b>asd</b>";
         try
         {   hek.insertHTML(hd, hd.getLength(), txt, 0, 0, null);
         }catch(Exception ex){   ex.printStackTrace();   }
        public void appendText(String txt)
        {     try
         {   hek.insertHTML(hd, hd.getLength(), txt, 0, 0, null);
         }catch(Exception ex){   ex.printStackTrace();   }
    }thanks~

    anIdiot wrote:
    im not sure what is the caret location...So don't youthink you should have looked for it in the API?
    anyway, i want the scroll bar to scrolled down automatically when the output is displayed.
    normally, the scroll bar is scrolled down automatically when a new text is inserted, but it doesnt work on this timeGo through camockr's http://tips4java.wordpress.com/2008/10/22/text-area-scrolling/
    db

  • Sort rows in JTable except the last row

    Hi All,
    I have a JTable, which contains columns with numbers. The last row contains column sums.
    I want to be able to sort rows, but the last row with sums must remain motionless.
    Does anyone know the solution of this problem?
    Thanks in advance.

    These two posts are my example. It works pretty good but there is one significant niggle - when moving a column the 'total' table does not move smoothly but it does move. I look forward to 'camickr' reducing this to about 1 line.
    Part A.
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Font;
    import java.text.DecimalFormat;
    import java.util.Comparator;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.TableColumnModelEvent;
    import javax.swing.event.TableColumnModelListener;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableColumnModel;
    import javax.swing.table.TableModel;
    import javax.swing.table.TableRowSorter;
    public class Sabre20090331
        static private class TotalizingTableComponent extends JScrollPane
            private TotalizingTableComponent(final TableModel tableModel)
                final SecondaryTableModel secondaryTableModel = new SecondaryTableModel(tableModel);
                final JTable secondaryTable = new JTable(secondaryTableModel);
                for (int i = 1; i < secondaryTableModel.getColumnCount(); i++)
                    secondaryTable.getColumnModel().getColumn(i).setCellRenderer(new NumberCellRenderer());
                secondaryTable.getColumnModel().getColumn(0).setCellRenderer(new TitleCellRenderer());
                final TableColumnModel secondaryTableColumnModel = secondaryTable.getColumnModel();
                secondaryTable.setRowSelectionAllowed(false);
                final JTable primaryTable = new JTable(tableModel);
                for (int i = 1; i < tableModel.getColumnCount(); i++)
                    primaryTable.getColumnModel().getColumn(i).setCellRenderer(new NumberCellRenderer());
                final TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
                final DoubleComparator doubleComparator = new DoubleComparator();
                for (int i = 1; i < tableModel.getColumnCount(); i++)
                    sorter.setComparator(i, doubleComparator);
                primaryTable.setRowSorter(sorter);
                primaryTable.getColumnModel().addColumnModelListener(new TableColumnModelListener()
                    @Override
                    public void columnAdded(TableColumnModelEvent e)
                        // System.out.println("columnAdded()" + e);
                    @Override
                    public void columnRemoved(TableColumnModelEvent e)
                        // System.out.println("columnRemoved()" + e);
                    @Override
                    public void columnMoved(TableColumnModelEvent e)
                        //System.out.println("columnMoved()" + e);
                        secondaryTableColumnModel.moveColumn(e.getFromIndex(), e.getToIndex());
                    @Override
                    public void columnMarginChanged(ChangeEvent e)
                        //System.out.println("columnMarginChanged()" + e);
                        final TableColumnModel cm = (TableColumnModel) e.getSource();
                        for (int i = 0; i < cm.getColumnCount(); i++)
                            secondaryTableColumnModel.getColumn(i).setPreferredWidth(cm.getColumn(i).getWidth());
                    @Override
                    public void columnSelectionChanged(ListSelectionEvent e)
                        //System.out.println("columnSelectionChanged()" + e);
                final JTableHeader primaryHeader = primaryTable.getTableHeader();
                JPanel inner = new JPanel(new BorderLayout());
                this.setColumnHeaderView(primaryHeader);
                this.setViewportView(inner);
                inner.add(primaryTable, BorderLayout.NORTH);
                inner.add(secondaryTable, BorderLayout.CENTER);
            public static void main(String[] args)
                final JFrame frame = new JFrame("Totalizing JTable Example");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                final TableModel tableModel = new PrimaryTableModel();
                frame.setContentPane(new TotalizingTableComponent(tableModel));
                frame.pack();
                frame.setVisible(true);
    }Edited by: sabre150 on Apr 1, 2009 9:21 AM
    Changed the layout of the inner panel so that the secondary table is now in the CENTER. This stops the secondary table becoming detached from the primary when one expands the frame beyond the prefferred size.

  • The last row count

    how can i make it when i after insert the data in a table ,it let me know the new total row number or the last row number.
    example.
    -now got 12 row datas
    -after i insert a new entry
    -it tell me now is row 13
    thanks

    Re: the last row count
    jesperdj Registered: Jun 10, 2003 1:00 AM      Nov 10, 2005 2:05 AM
    Let's get this straight first: You are talking about inserting a row into a database and counting the number of rows in a database table, right?
    Or are you talking about a table in a GUI?
    inserting row into a database is not a problem..and then..where after i insert the data into the database..i will retrieve the whole database and display it in my TAble in GUI...my problem now is..how i make it to highlight the new insert data in my table?or other way to say,how i highlight my newly insert datarow in my table?

  • How to get the last row in a resultset or query

    Hi All
    Say If I have a complex query which returns a resultset say 15 rows. Now I want to limit the output showing only the last row.
    How can we do this

    Keep in mind Oracle does not keep "row" order as such. Unlike a graphical type db like Access, Oracle will not always give you back the results in order.
    Even if you were to use a sequence, your query is never guaranteed to give back the results in the order you are expecting. You must then give an order by statement to all queries expecting the order.
    Your definition of last row too is vague - if it is in fact the greatest amount, use the inline view suggestion. If you simply want to see the last inserted row, consider adding a last_update_date column inserting the sysdate (by a trigger perhaps). This would then allow you to see the last inserted row.
    Enjoy!

  • Hiding bloc of Lines in a web template in the last row

    Hello,
    I want to hide a bloc of lines in a web query.
    Here I use the table interface with the method
    characteristic cell according to the "How to" - paper
    (How to hide a column).
    Normally , there is no problem to set the tag
    '<!--' in the first column ot the row to be suppressed and the tag
    '-->' in the first column of the row, I want to display again.
    But the problem is the last row. Here I must close the
    tag in the last column of the last row. The effect is
    something like a double line at the end of the output.
    (I think, I see here another time the first column of
    a row, because I cannot close the tag properly)
    As a result, I have problems with the print manager, we use to enhance the web printing.
    Can someone give me the information, how to close the tag
    in a proper way at the last row.
    Many thanks for your help.
    Regards
    Ralph

    Hi,
    I don't think this is possible. I would try to use c_cell_extend to extend the style of each <td>-Tag with style="visibility:hidden; display:none" This should have the same affect (for all cells which have to be hidden) (depending on your table styles there might be some padding or spacing effects; you have to try this out).
    Heike

  • How can I delete the last row of a Matrix

    Hi All,
    Does anyone know whether deleting the last row of a matrix controlled by a UDO child table gives problems? I have the strange effect that I cannot delete the very last existing row in the matrix, i.e. after updating the delete the last to-be deleted row comes back into my matrix !!
    I give you a snippet of my code (function getSelectedRow gives the selected row in the matrix):
    ==
    if (evnt.ItemUID.Equals(ViewConstants.Items.DELETEBUTTON))
      if (evnt.EventType == BoEventTypes.et_ITEM_PRESSED)
        if (evnt.BeforeAction)
          form = BusinessOne.Application.Forms.Item(formUID);
          mtx = (Matrix)form.Items.Item(ViewConstants.Items.MATRIX).Specific;
         int numRow = getSelectedRow(mtx);
         if (numRow != -1)
                                            mtx.DeleteRow(numRow);
                                            form.Mode = BoFormMode.fm_UPDATE_MODE;
                                       Item btn = (Item)form.Items.Item(ViewConstants.Items.ADDBUTTON);
                                       btn.Enabled = true;
    ==
    Cheers,
    Marcel Peek
    Alpha One
    Message was edited by: Marcel Peek
    Message was edited by: Marcel Peek

    Yes, there is a problem to delete the last row.
    It is fixed in version 2005.

  • To find out the last row that is updated in a View Object

    Hi OAF Gurus,
    I have requirement like,
    I have to find out the last row that is updated on a particular View Object and I have send a mail to the users about the change.
    JegSAMassMobVOImpl vo = getJegSAMassMobVO1();
    JegSAMassMobVO is the View Object Name and it displays certain rows that has already been added to the VO in the Page.
    Now the issue is when a user updates a particular row,I have to find which row gets updated and have to send a email to that particular employee about the change.
    Just want to know,how to find out the last updated row in a particular VO.
    Any Help would be appreciated as this a immediate requirement.
    Regards,
    Magesh.M.K.
    Edited by: user1393742 on May 4, 2011 1:06 AM

    Hi Magesh
    It shoud be a Advanced table ,so when user will update the row ,the specific row will fire the PPR and on that event u can capture the row using row reference ,this is the sample code below
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean); OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    262
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    Thanks
    Pratap

  • Needs  help to retrive the last row in a  select query without using rownum

    Hi ,
    i need to retrive the last row from the select sub query without using rownum.
    is there any other way to retrive the last row other than the below query.
    is that the ROWNUM=1 will always retrive the 1 row of the select query ?
    select from*
    *(select ename from employee where dept_id=5 order by desc) where rownum=1;*
    Please advise.
    thanks for your help advance,
    regards,
    Senthur

    957595 wrote:
    Actually my problem is ithat while selecting the parents hiearchy of the child data using
    CONNECT BY PRIOIR query
    I need the immediate parent of my child data.
    For example my connect BY query returns
    AAA --- ROOT
    BBB --PARENT -2
    CCC --PARENT-1
    DDD IS my input child to the connect by query
    Immediate parent of my child data "DDD" ---> CCC(parent -1)
    i want the data "CCC" from the select query,for that i am taking the last row of the query with rownum.
    I got to hear that using ROWNUM to retrive the data will leads to some problem.It is a like a magic number.I am not sure what the problem will be.
    So confusing with using this rownum in my query.
    Please advice!!!It's not quite clear what you're wanting, but perhaps this may help?
    you can select the PRIOR values to get the parent details if you want...
    SQL> ed
    Wrote file afiedt.buf
      1  select empno, lpad(' ',(level-1)*2,' ')||ename as ename, prior empno as mgr
      2  from emp
      3  connect by mgr = prior empno
      4* start with mgr is null
    SQL> /
         EMPNO ENAME                                 MGR
          7839 KING
          7566   JONES                              7839
          7788     SCOTT                            7566
          7876       ADAMS                          7788
          7902     FORD                             7566
          7369       SMITH                          7902
          7698   BLAKE                              7839
          7499     ALLEN                            7698
          7521     WARD                             7698
          7654     MARTIN                           7698
          7844     TURNER                           7698
          7900     JAMES                            7698
          7782   CLARK                              7839
          7934     MILLER                           7782
    14 rows selected.(ok, not the best of examples as the mgr is already known for a row, but it demonstrates you can select prior data)

  • RFC - XI - JDBC(mapping only the last row of a record)

    Hello all,
    in a mapping response from an oracle base after a RFC call with a select statement, i have the following response :
    <StatementSelect_response>(cardinality 0..1)
    <row1>(cardinality 0..unbounded)
    <field1>1</field1>
    <field2>2</field2>
    </row1>
    <row2>
    <field1>3</field1>
    <field2>4</field2>
    </row2>
    </statement>
    i have to map those fields in a RFC_response like :
    <RFC_response>(0..1)
    <field1>
    <field2>
    </rfc _response>
    Problem : I only need to send back to the rfc_response the last records of my StatementSelect_response in order to have the following message :
    <RFC_response>
    <field1>3
    <field2>4
    </rfc _response>
    How can i select only the last row of my records plz ?
    Thanks by advance

    VJ wrote:>
    > Hi,
    >
    > public void LastRow(String[] a,ResultList result,Container container){
    >
    > int len = a.length();
    > Result.addValue(a\[len-1\]);
    >
    > }
    VJ,
    Please don't confuse him. If you want to update the thread, let me leave it aside.Coz it shouldn't cause him trouble. Can u check a.length() is correct? it has to be a.length, isn't it?
    We all here to help others, not under any motivation of compete..
    Sorry, if I hurt you..
    raj.

  • How to display the last row in a table

    I have a table that is constantly updating, and I always want to see the last row. How can I get my table to auto scroll?

    Hi žabić,
    there is a property called "top left visible row". You can use it to scroll your table.
    edit:
    Maybe this is not the exact name, but you can see an example here
    Mike
    Message Edited by MikeS81 on 05-27-2010 03:57 PM

  • Using firefox 4.0.1, IBM SVC console internal server, rows with I think form data, the last row is corrupted and overlays a prior row.

    IBM SVC console uses websphere. Screen data that is presented in table form last row appears to overwrite the prior row only. In other similar layouts, the last row is cut in half and cannot be seen. The prior version of Firefox 3 (something) did not have this problem. OS Windows XP Pro SP3
    Firefox V3.6.17 worked fine

    Seeing the same problem using the HMC with FF7 beta.

  • Insert a button on the last row of a report

    Hi all,
    my client wants an "add" button on the last row of any report that he has. I can do it easy on the first row (SELECT DECODE(rownum,1,'button','')), but I couldn't find a solution for this situation.
    Can anyone help me?
    Thanks in advance.
    Nelson Freitas

    Sorry, but I didn't quite understand the answer. Here's my example, a real one :)
    select     "SGP_DIS_ENT_ANO"."SCE_ID" as " ",
         "SGP_ANO_ESC"."SAE_ANO" as "Ano",
         "SGP_CUR"."SCU_DES" as "Curso",
         "SGP_DIS"."SDE_DES" as "Disciplina"
    from     "SGP_ANO_ESC" "SGP_ANO_ESC",
         "SGP_EST_ANO" "SGP_EST_ANO",
         "SGP_CUR" "SGP_CUR",
         "SGP_DIS" "SGP_DIS",
         "SGP_DIS_CUR" "SGP_DIS_CUR",
         "SGP_DIS_ENT_ANO" "SGP_DIS_ENT_ANO"
    where "SGP_DIS_ENT_ANO"."SDC_ID"="SGP_DIS_CUR"."SDC_ID"
    and     "SGP_DIS_CUR"."SDE_ID"="SGP_DIS"."SDE_ID"
    and     "SGP_DIS_CUR"."SCU_ID"="SGP_CUR"."SCU_ID"
    and     "SGP_DIS_ENT_ANO"."SEA_ID"="SGP_EST_ANO"."SEA_ID"
    and     "SGP_EST_ANO"."SAE_ID"="SGP_ANO_ESC"."SAE_ID"
    and "SGP_DIS_ENT_ANO"."SEN_ID" = :P19_SEN_ID
    Could you help me with it?
    Thanks

Maybe you are looking for