How to display a record count in a text field?

I am trying to return a record count of a query and place that count in a text field on my search page in APEX. I have that text field defined under Items on the search page. How do I get a query record count to display in my text field?
Thanks,
John
Edited by: user7381760 on Jan 22, 2009 3:47 PM

Hi Dan,
Thank you for your reply and yes I was able to select "Source Type" and "SQL Query". The SQL expression I used was:
SELECT COUNT(ID) FROM master_table;
This worked great to count the total number of records from the master_table. However what I am trying to do is to get a record count each time I complete a search from my search page. I have input fields on this page and a GO button which executes the query. The SQL query is location in one place under Regions/Display Point. My display field on my search page is named P16_COUNT2 and I was trying to make this work inside the main query code. I tryed something like this, COUNT(ID) INTO :P16_COUNT2, to pass the record count each time I execute the GO botton to P16_COUNT2 field. This I could not get to work. Any ideas how to proceed?
Regards,
John

Similar Messages

  • How to display multiple records in a block text items

    Can fetching be done to dispplay multiple records in the text items base on the query.

    put the code in post-query trigger

  • How can I get record count with a query?

    In Client/Server pplication,the client send a query to server.
    How can server get record count by oracle call interface?
    Is it need execute "select count(*) from ...."?

    Yes.
    Either that or increment a counter for each record fetched and
    loop round until you hit the last record.
    The first method would be more efficient on large datasets.

  • How to display a percentage sign ( % ) after a text box in a screen

    hi experts,
    Can anybody tell me how to display a percentage sign ( % ) after a text box in a screen.

    Hi Ajay,
    Try to use the  [Position|http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dba7e235c111d1829f0000e829fbfe/frameset.htm] option of selection screen.
    By using this you can place the text as a comment at a desired position on the selection screen.
    The syntax would be like this :
    SELECTION-SCREEN POSITION <pos>.
    Regards,
    Swapna.

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • How can I limit numeric codes in a text field?

    How can I limit numeric codes in a text field? For example I want to list Industry SIC codes and I want to block someone from inputting an exlcuded industry code.

    We don't offer that type of input restriction for a text field. 
    Can you create a list of all allowed codes and use a Drop Down menu or Single/multiple Choice field? 
    Thanks,
    Josh

  • F8as2-displaying leading zeros in a dynamic text field

    F8as2-
    Background:
    Currently I have to use two different text fields to display 10000 due to the different font sizes.
    The 10 is a larger font and the 000 is a smaller font.  When I assign '0 'to the dynamic text fields of the smaller font I get just that a '0' not a '000' which is what I want.
    Question:
    Is there an easy way to display leading zeros in a dynamic text field?  Or can a dynamic text field have different character positions displayed in different font sizes?  or both?
    Thanks for the help.

    F8as2-
    Thanks for the reply kglad.
    Are for saying the best way to display numerically calculated numbers that need leading zeros and or different font sizes is to convert them to a string for display purposes with textFormatting??

  • How do I auto populate the date into text fields when form is first opened?

    Hello,
    I read all about the changing the scripts but its not really working for me. I was hoping someone could help me with directions on how to auto populate the date into designated text fields when my adobe document is first opened?
    I am working in Adobe Acrobat 9.
    Thank you,
    Sheri

    When you add a new document JavaScript (Advanced > Document Processing > Document JavaScripts > Script Name (enter something) > Add), you will be given a function skeleton by default. Just delete it and enter the line of code I showed above. Now, whenever the document is opened, the code will get triggered and the field will be updated with the current date. There is no "Document Open" action (at least that's accessible via Acrobat's UI), but this is effectively the same thing since any document-level JavaScripts are executed when the document is opened.

  • How to put a image url to a text field in flex

    I am facing problem when getting
    a image  url  with the help
    of    FileReference ..  Actuallly  i want to display the  image url to a text field after browsing the image location when I press
    a button............. my code is given below
    private function getImageUrl():void {
                   private var fileRef:FileReference = new FileReference();
                   fileRef.browse();
    Any one can help me to solve the problem

    Hi,
    If you use file reference with an AIR app you have access to the file path, with a browser based app security prevents you from having access to the file path you can access the name of the file only.
    this is an example of grab a list of files(images) using filereferencelist and filereference and displaying the image in a list, its a similar process for just getting a list of file names
    http://gumbo.flashhub.net/pagedrop/  sourcecode enabled (right click in the browser and select view source)
    for filereference  the name property will return the file name only not the path
    for filereferencelist you have the .filelist[X].name to get the file name.
    hope this helps
    David

  • How to display multiple records in smart forms in new page for each record

    Hi,
              How to display the data from a internal table in a smart form.
    I want each record to be displayed in seperate page.
    please tell me with example.
    thank u,
    Sarath

    Do this ,
       in the main window - open a loop on your internal table ,
    within the loop open the text and give the output fields,
    after this text  use the Command node and in this set the next page as page1,
    so when the loop gets executed its first record will be on the first page and the second record will be on the next page and so on ..
    Reward to usefull answers.

  • Files and Streams in java -- How to display successive records

    Hi,
    I developed an application in which I enter name and id in a gui. Each time I enter, the records are added in the sequential file.
    Then I have a button to open that file. It also opens.
    Then I have a button to read the records(which has name and id) in sequential order. Each time I click next button records should be displayed in their respective text boxes. But, only the 1st record is displyed. Then I get IOException. Why am I not able to move to records after 1st record. How could I disply records till EOF is reached.
    Plz see my code for open function and read next function
    private void openFile()
    input=new ObjectInputStream(new FileInputStream("c:/file.dat"));
    openf.setEnabled(false);
    readf.setEnabled(true);
    private void readNext()
    rcrd=(Record)input.readObject();
    String val[]= {String.valueOf(rcrd.getId()),rcrd.getName(),rcrd.getAddr()};
    gui.setFieldValues(val);
    Why am I not able to move to records after 1st record. How could I disply records till EOF is reached.

    package files;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import files.FileGui;
    import files.Record;
    import java.util.*;
    import java.lang.*;
    public class CreateFile extends JFrame
         private ObjectOutputStream output;
         private FileGui gui;
         private JButton enter, readf, openf;
         private Record rcrd;
         private ObjectInputStream input;
         boolean eof;
         LinkedList link = new LinkedList();
         ListIterator li=link.listIterator();
         public CreateFile()
              super( "Creating sequential file" );
              getContentPane().setLayout( new BorderLayout() );
              gui = new FileGui();
              enter = gui.getTask1();
              enter.setText("Enter");
              enter.setEnabled(true);
              enter.addActionListener(
                        new ActionListener()
                             public void actionPerformed( ActionEvent e )
                                  addRecord1();
              addWindowListener(
                        new WindowAdapter()
                             public void windowClosing( WindowEvent e )
                                  if(output != null)
                                       closeFile();
                                  else
                                       System.exit(0);
              openf = gui.getTask2();
              openf.setText("Open");
              openf.addActionListener(
                        new ActionListener()
                             public void actionPerformed(ActionEvent e)
                                  openFile();
    readf = gui.getTask3();
              readf.setText("Read Next");
              readf.addActionListener(
                        new ActionListener()
                             public void actionPerformed(ActionEvent e)
                                  readFile();
              getContentPane().add(gui, BorderLayout.CENTER);
              setSize(300,200);
              show();
         private void readFile()
                        try
                             rcrd=(Record)input.readObject();
                             String val[]={String.valueOf(rcrd.getId()),rcrd.getName(),rcrd.getAddr()};
                             gui.setFieldValues(val);
                        catch(EOFException eof)
                             System.out.print("EOFException");
                        catch(ClassNotFoundException cnfe)
                             System.out.print("ClassNotFoundException");
                        catch(IOException ioe)
                             System.out.print("IOException");
         private void openFile()
                   JFileChooser fileChooser = new JFileChooser();
                   fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                   int result = fileChooser.showOpenDialog(this);
                   if(result==JFileChooser.CANCEL_OPTION)
                        return;
                   File fileName = fileChooser.getSelectedFile();
                   if(fileName==null || fileName.getName().equals(""))
                        JOptionPane.showMessageDialog(this, "Invalid file name", "Invalid file name", JOptionPane.ERROR_MESSAGE);
                   else
                        try
                             //File fileName=new File("c:/file.txt");
                             input=new ObjectInputStream(new FileInputStream("c:/file.dat"));
                             openf.setEnabled(false);
                             readf.setEnabled(true);
                   catch (Exception e)
                        System.out.println("Error in opening file");
         private void closeFile()
              try
                   output.close();
                   System.exit(0);
              catch(IOException ex)
                   JOptionPane.showMessageDialog(this, "Error Closing File", "Error", JOptionPane.ERROR_MESSAGE);
                   System.exit(1);
         private void addRecord1()
              String[] fieldValues = gui.getFieldValues();
              if(! fieldValues[0].equals(""))
                   try
                        int id=Integer.parseInt(fieldValues[0]);
                        if(id>0)
                             Record rcrd = new Record(id, fieldValues[1], fieldValues[2]);
                             System.out.println(" " +rcrd.getString());
                             link.add(" " +rcrd.getString());
                             //System.out.println("Hello3");
                             FileOutputStream fos = new FileOutputStream("c:/file.dat",true);
                             output = new ObjectOutputStream(fos);
                             output.writeObject(rcrd);
                             output.flush();
                             //gui.clearFields();
                             readf.setEnabled(true);
                   catch (NumberFormatException nfe)
                        JOptionPane.showMessageDialog(this, "Incorrect id", "Invalid number formate", JOptionPane.ERROR_MESSAGE);
                   catch (IOException io)
                        closeFile();
         public static void main(String args[])
              new CreateFile();
    }

  • Query to display all records count of all tables in a schema

    Hi,
    I need to count all the records of all my tables in a certain schema and display the max amount of the record count. Do you have a script for this one??

    SQL> create function countrec(in_tab in varchar2) return number is
      2  retval number;
      3  begin
      4    execute immediate 'select count(*) from '||in_tab into retval;
      5    return retval;
      6  end;
      7  /
    Function created.
    SQL> select table_name, countrec(table_name)
      2  from tabs;
    TABLE_NAME                     COUNTREC(TABLE_NAME)
    QUERY_TOOL_DATA_COLLECTION                        5
    TEST01                                            0
    T1                                               14
    EMP                                              14
    SALGRADE                                          5
    FILES                                             0
    PROVA                                             0
    TEST                                              0
    T_MASTER                                          1
    T_CHILD                                           3
    TAB_ONE                                          30
    TAB_TWO                                          10
    A                                                 3
    B                                                 4
    C                                                 3
    D                                                 3
    BONUS                                             0
    DEPT                                              4
    18 rows selected.Max

  • How to caculate the records count for a measurement with a filter?

    I have a fact table which add relationship to a datetime dimension. I create a measurement based on the fact table, like [MeasureA]. I want to calculate the record counts of [measureA] of today, how to write the mdx query? Thanks!

    Hi Lavandula,
    According to your description, you want to calculate the numbers of the record of a measure for a specific day, right? In this case, you can use
    Count function which returns the number of cells in a set to achieve you requirement. Here is a sample query on Adventure Works for your reference.
    WITH
    MEMBER [Measures].[SetCount] AS
    COUNT([Product].[Product].[Product].Members)
    SELECT
    {[Measures].[SetCount]} ON COLUMNS
    FROM
    [Adventure Works]
    Besides, if you want to count the cell numbers with a condition, you can use
    Filter funtion inside the Count function.
    WITH MEMBER [Measures].[High Volume Products Count] AS
    Count(Filter([Product].[Product].[Product], [Measures].[Internet Order Quantity] > 5))
    SELECT [Customer].[Customer Geography].[Country] ON 0
    , [Date].[Calendar].[Date].MEMBERS ON 1
    FROM [Adventure Works]
    WHERE [Measures].[High Volume Products Count]
    Regards,
    Charlie Liao
    TechNet Community Support

  • How can I get Record Count in JDK1.3 version

    Hi,
    I am using a JSP page which communicates with the database and fetches a query using a record set.
    How can I display 10 records per page using JDK1.3.
    Lets say the query fetches 15 records.I want the first 10 records to be displayed and a "Next" link at the bottom which when clicked should show the remaining 5 records.
    Could anyone help me regarding the above issue.
    Thanks in advance,
    Reji

    Check out the following url, it should suit ur need.
    http://jsptags.com/tags/navigation/pager/pager-taglib-1.1.html
    The pager tablib is free and it works well. it is well documented and explanations are provided on the website itself.
    hope u find it helpful.
    keep progRamming,
    Satyen.

  • How to return the record count of a query to a number variable

    How would I get the record count from a query without using a cursor to step through the query and count the records individually?
    query: select * from table1 where column1 = column2
    How would I get the record count of the query above?
    thanks,
    michelle

    I figured it out
    select count(*) into theCount
    from ( select * from table1 where column1=column2 );
    thanks,
    michelle

Maybe you are looking for

  • Error occuring while checking for updates in windows 7

    i have tried your solution of subinacl but still an error ocurred while checking updates in windows 7.how to i solve this problem

  • Font size and color

    can I change the font size and color of the items in a list?Font size can be changed and it is working in emulator but not in phones.I am using Nokia 6630 for testing purpose. I can't find any options to change color.

  • Trouble print on PDF created in Illustrator

    I have a problem I´ve created a 2 pages press release in Illustrator for web use, and save it to PDF. But in a moment my client print it, this show a paragraph in two differents colors, the first line print black 100% and second print in gray, this a

  • I'm finding that my ipad4 with retina display appears to be overheating what can I do

    My iPad 4 with retina display appears to be overheating as at times it becomes quite warm what can I do

  • WM-PP Control Cycle

    I've created a WM-PP Control cycle for Pick parts in HU- WM managed storage location and by releasing a production order I'm getting a message: No WM relevant components exist (function not possible) Message no. CO577 I've est-up everything from WM s