Determine the space used for each row in the table

I am trying to determine how much disk space each row in the table will take place (data and indexes). I use sys_guids for my (PK_ID) primary key and foreign key columns (FK_xx), so who are on varchar2 (32).

What is the best way to determine this?


CREATE TABLE STU_ENROLLMENT
(PK_ID VARCHAR2 (32), sys_guid() by default)
CONSTRAINT pk_stu_enrollment
KEY ELEMENTARY SCHOOL
With the HELP of INDEX TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0),.
FK_STU_SCHOOL VARCHAR2 (32)
FK_SCHOOL_CALENDAR VARCHAR2 (32)
FK_PCC_CODE VARCHAR2 (32),
FK_GRADE_LEVEL VARCHAR2 (32),
FK_VOTECH VARCHAR2 (32),
FK_SPECIAL_ED VARCHAR2 (32),
FK_TUITION_CODE VARCHAR2 (32),
FK_HOME_INSTRUCTION VARCHAR2 (32),
FK_DISTRICT VARCHAR2 (32),
FK_PROGRAM_CODE VARCHAR2 (32),
FK_SERVING_SCHL VARCHAR2 (32),
FK_RESPONSIBLE_SCHL VARCHAR2 (32),
FK_ADA_CODE VARCHAR2 (32),
FK_ENROLL_TYPE VARCHAR2 (32),
FK_PCC_REASON VARCHAR2 (32),
STANDARD_DAY NUMBER (3).
PCC_NOTES VARCHAR2 (1000).
USER_FLD1 VARCHAR2 (100),
USER_FLD2 VARCHAR2 (100),
USER_FLD3 VARCHAR2 (100),
USER_FLD4 VARCHAR2 (100),
USER_FLD5 VARCHAR2 (100),
PCC_TRANSACTION_ID VARCHAR2 (32),
TRANSACTION_NUMBER DEFAULT NUMBER '1',
TRANSACTION_TYPE VARCHAR2 (1) DEFAULT 'A,'
DATE OF LAST_UPDATE_DATE,
LAST_UPDATE_USER VARCHAR2 (100))
TABLESPACE sis_express_base
STORAGE (5120 INITIAL
NEXT 5120
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I ON STU_ENROLLMENT (FK_STU_SCHOOL, FK_SCHOOL_CALENDAR, FK_PCC_CODE) SINGLE
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I2 ON STU_ENROLLMENT (FK_SCHOOL_CALENDAR)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I3 ON STU_ENROLLMENT (FK_PCC_CODE)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I4 ON STU_ENROLLMENT (FK_GRADE_LEVEL)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I5 ON STU_ENROLLMENT (FK_VOTECH)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I6 ON STU_ENROLLMENT (FK_SPECIAL_ED)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I7 ON STU_ENROLLMENT (FK_TUITION_CODE)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I8 ON STU_ENROLLMENT (FK_HOME_INSTRUCTION)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I9 ON STU_ENROLLMENT (FK_DISTRICT)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I10 ON STU_ENROLLMENT (FK_PROGRAM_CODE)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I11 ON STU_ENROLLMENT (FK_SERVING_SCHL)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I12 ON STU_ENROLLMENT (FK_RESPONSIBLE_SCHL)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I13 ON STU_ENROLLMENT (FK_ADA_CODE)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I14 ON STU_ENROLLMENT (FK_ENROLL_TYPE)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I15 ON STU_ENROLLMENT (FK_PCC_REASON)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I16 ON STU_ENROLLMENT (PCC_TRANSACTION_ID)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

CREATE INDEX STU_ENROLLMENT_I17 ON STU_ENROLLMENT (FK_STU_SCHOOL, PCC_TRANSACTION_ID, PK_ID)
TABLESPACE sis_express_index
STORAGE (4096 INITIAL
NEXT 4096
PCTINCREASE 0);

Hello

The maximum size of the row in the table

Select table_name, ROUND (sum (data_length) / 1024,2) SIZE_IN_KB
of user_tab_cols
where table_name = 'STU_ENROLLMENT '.
TABLE_NAME GROUP;

+

Select index_name table_name, ROUND (sum (CHAR_LENGTH) / 1024,2) SIZE_IN_KB
of USER_IND_COLUMNS
where table_name = 'STU_ENROLLMENT '.
GROUP BY index_name table_name;

See the size of the table - method with the average row size

Concerning
Hitgon

Published by: hitgon on May 2, 2012 18:19

Published by: hitgon on May 2, 2012 18:39

Tags: Database

Similar Questions

  • Call a procedure only once for the last place of the trigger FOR EACH ROW

    Hello world

    I wonder if someone could help me in the execution of the trigger. My use case what follows:

    -a trigger after each INSERT or UPDATE operation;
    -use FOR EACH ROW algorithm for relaxation;
    -collect certain values inserted/updated fields as: new.uuid and store in a set defined on the layer of the package;
    -only for the last inserted/updated line call a procedure from the global collection with the values collected as a parameter;

    Is it possible to be implemented for the type of the LINE FOR EACH of the trigger? Fact one: new identifier or trigger itself have special attributes such as COUNTY, SIZE to set a size of data inserted or changed to conditional logic? Is there another solution to possible workaround for thoughtful use cases.

    Thank you

    Andrey

    Hi, Andrey,

    I suggest you use 2 triggers:
    (1) A FOR EACH ROW trigger, as you described, to collect relevant data and store it in a temporary table overall or variable poackage. Whenever the trigger is activated, it will overwrite all the data from the previous row.
    (2) AFTER ( NOT FOR EACH ROW) trigger that calls the procedure by using the saved data.

  • the analysis of a word table of ms with different numbers of columns for each row

    I'm reading in a MS Word table that contains 20 lines, each with a different number of columns.  I have to iterate over each line then I iterate on each column of the row and read his text.  I don't know a way to find out how to stop an iteration on the columns.  Is a property or a method which tells you the number of columns in a specific line for a table in MS Word?

    ID says:

    I'm reading in a MS Word table that contains 20 lines, each with a different number of columns.  I have to iterate over each line then I iterate on each column of the row and read his text.  I don't know a way to find out how to stop an iteration on the columns.  Is a property or a method which tells you the number of columns in a specific line for a table in MS Word?

    For each row, use the count property of cells. Since there a number of subject lines is the number of columns.

    Ben64

  • using for each group to combine the 2 data lines

    My xml file has the following in it:

    -< AC_DEDUCTIONS >
    voluntary deductions < ELEMENT_CLASSIFICATION > < / ELEMENT_CLASSIFICATION >
    < ELEMENT_TYPE_ID > 3475 < / ELEMENT_TYPE_ID >
    < PRIMARY_BALANCE > 498500 < / PRIMARY_BALANCE >
    < PROCESSING_PRIORITY > 5750 < / PROCESSING_PRIORITY >
    < CURRENT_AMOUNT > 26.22 < / CURRENT_AMOUNT >
    < YTD_AMOUNT > 26.22 < / YTD_AMOUNT >
    < REPORTING_NAME > Opt life Emp < / REPORTING_NAME >
    < ATTRIBUTE_NAME / >
    < RATE_MUL / >
    < DISPLAY_NAME > Opt life Emp < / DISPLAY_NAME >
    < / AC_DEDUCTIONS >
    -< AC_DEDUCTIONS >
    voluntary deductions < ELEMENT_CLASSIFICATION > < / ELEMENT_CLASSIFICATION >
    < ELEMENT_TYPE_ID > 1181 < / ELEMENT_TYPE_ID >
    < PRIMARY_BALANCE > 3511 < / PRIMARY_BALANCE >
    < PROCESSING_PRIORITY > 5750 < / PROCESSING_PRIORITY >
    < CURRENT_AMOUNT > 0 < / CURRENT_AMOUNT >
    < YTD_AMOUNT > 474.95 < / YTD_AMOUNT >
    < REPORTING_NAME > Opt life Emp < / REPORTING_NAME >
    < ATTRIBUTE_NAME / >
    < RATE_MUL / >
    < DISPLAY_NAME > Opt life Emp < / DISPLAY_NAME >
    < / AC_DEDUCTIONS >

    Rather than having my exit needle 2 rows of data:

    current name amount CDA amount

    Opt life Emp 26.22 26.22
    Opt life Emp 0 474.95


    I'd like to see 1 row with the total amount:

    Opt life Emp 26.22 501.17


    How can I use for each group - in my rtf to achieve? Any help is greatly appreciated.

    Thank you.

    Susie

    I know what model you have copied :), I was there, when they created that

    It's yours:

    1 text form field-<><=19]?>
    2 text form field-
    3 text form field-
    4 text form field-
    5 text form field-

    change to:

    Text Form Field 1 -  
    Text Form Field 2 - 
    Text Form Field 3 - 
    Text Form Field 4 -  
    Text Form Field 5 - 
    
  • PLEADING... I NEED help with the boxes, one for each row in table.

    I have a tabular presentation I want to use to process once that will process once for each line that has had its check box selected. I worked on it... It seems... forever. I almost gave up. More than once I thought I had it all to find that I have no work.

    It seems always executed once for each row in the set of lines in the displayed table and I care about her contract so that the lines checked.

    Here is my select statement...
    Select
    APEX_ITEM. CHECKBOX (2, ISSUE_KEY, DECODE (issue_closed, 'Yes', 'CLOSED', 'No', 'DISABLED', null)) CHECK_KEY;
    TO_CHAR (ISSUE_DATE, ' ' DD-MON-YYYY HH24:MM:SS) FAILURE_DATE,.
    ISSUE_COMMENTS
    QUESTIONS


    I have a submit button that runs the following process
    DECLARE
    v_org_comments varchar2 (1024): = ";
    BEGIN
    BECAUSE me in 1... APEX_APPLICATION. G_F02. COUNTING LOOP
    SELECT ISSUE_COMMENTS
    IN v_org_comments
    QUESTIONS
    WHERE ISSUE_KEY = APEX_Application.g_f02 (i);

    UPDATE PROBLEMS
    SET
    ISSUE_COMMENTS = v_org_comments | » ' || : P4_X_ODF_NOTES,.
    ISSUE_CLOSED = "Yes"
    where ISSUE_KEY = APEX_Application.g_f02 (i);
    COMMIT;
    END LOOP;
    END;

    Hello

    I had the same problem. It seems that if you pass your columns to the columns in standard report it will fire for the checked columns. But if you proceed towards editable fields each line is treated as checked.
    So if you use line selector instead of manually creating check boxes and have a hidden primary key
    field, you can then use something like

    BECAUSE me IN 1.APEX_APPLICATION. G_F01. COUNTING LOOP
    UPDATE


    SET
    WHERE =
    APEX_APPLICATION. G_F02 (APEX_APPLICATION. G_F01 (i));
    END LOOP;

  • call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. The other rows are based on the entities

    Hi Experts,

    JDeveloper 12.1.3.0.0

    I have a VO based on entity object. With a column of the VO is transient attribute (I created).

    I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.

    So can anyone suggest how can I achieve this?

    Thank you

    AR

    I think that you need a stored function (which returns the value) in this case, is not?

    Take a look at:

    https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm

    and search for:

    Invoking stored function with only Arguments in

    call your function in the Get attribute and return value accessor...

  • How to map the entered value of attribute column to another attribute in the table for each row.

    Hi Experts ADF,

    JDev 12 c.

    I create a button and a table below. If the user clicks on the button create, I invoke CreateInsert. The new line now appears as an editable fields.

    So I suppose I have a column that is displayed in editable mode. If the user enters values in that. Has another column B whose value is not displayed in the UI must have the same value as the column.

    This occurs for each row added. During the click on save if user entered 2 in column A, then the value in column B must be same 2.

    Thank you

    Roy

    There is more than one way, for example:

    Generate ViewRowImpl Java class (with generate audited accessors) you will get for an attribute setter.

    Change the Set accessor to set the attribute B (IE, calling setAttribute ("B", value)) after setting a value

    OR, write valueChangeListener for inputText representative and set the B attribute to the same value

  • Creation of 5 rows in table B for each row in the table has

    create table A
    (col1 number,
    col2 varchar2(20)
    )
    /
     
    create table B
    (col1 number,
    col2 varchar2(20)
    )
    /
    
    insert into A values (1,'Jane');
    insert into A values (2,'Kate');
    insert into A values (3,'Stomp');
    
    
    SQL> select * from a;
    
          COL1 COL2
    ---------- -----------------
             1 Jane
             2 Kate
             3 Stomp
    For each row in the table, I want 5 rows to be created in the table b. table B should look like
        COL1   COL2
    ---------- -----------------
             1 Jane
             2 Jane
             3 Jane
             4 Jane
             5 Jane
             6 Kate
             7 Kate
             8 Kate
             9 Kate
             10 Kate
             11 Stomp
             12 Stomp
             13 Stomp
             14 Stomp
             15 Stomp
    How can I do this?

    Hello

    A way

    insert into b
    select rownum*5  , col2 from a
    union all
    select rownum*5+1, col2 from a
    union all
    select rownum*5+2, col2 from a
    union all
    select rownum*5+3, col2 from a
    union all
    select rownum*5+4, col2 from a
    

    Concerning
    Anurag

  • How can I create sequential shooting (1 for each 'row') numbers in a script in multiple column?

    How can I create sequential shooting (1 for each 'row') numbers in a script in multiple column?

    Sorry, but for now there no such function to put sequential numbers in the column number drawn.

  • How to find the value max and min for each column in a table 2d?

    How to find the value max and min for each column in a table 2d?

    For example, in the table max/min for the first three columns would be 45/23, 14/10, 80/67.

    Thank you

    Chuck,

    With color on your bars, you should have enough experience to understand this.

    You're a loop in the table already.  Now you just need a function like table Max and min. loop.  And you may need to transpose the table 2D.

  • I need a query that selects the amount of records for each day of a table.

    I need a query that selects the amount of records for each day of a table.
    For example, the result would be:

    1 14 date
    Date 2-3

    etc.

    Any ideas?

    Sort:

    SELECT count ([IDCommentaire]), convert (varchar, dateAdded, 112)

    OF COMMENTSgroup by convert (varchar, dateAdded, 112)

  • Creating a jsff to use for each method

    I use J Dev Studio Edition Version 11.1.1.4.0 on Win Server 08.

    I'm trying to recreate the next page of the jsff which basically takes a URL of RSS feed and returns the title and the description of the items following the example of the following blog:

    http://blogs.Oracle.com/Dana/entry/reusable_adf_library_rssfeedre

    The two main classes (pasted below) are FeedReader.java and Feed.java data controls have been successfully created.

    When I drop for each page I don't see an option to link to the ' links. Feed.rangeSet'. The blog does not explain in detail how the jsff page can be re-created, so I'll settle for the sample code.

    How the following code is created and how the linking options are created? It is simply a case of drop for each operation on the page jsff or does more need ot do to create correct links?


    rssFeedReader.jsff
    -------------------------

    <? XML version = "1.0" encoding = "windows-1252'?" " >
    < jsp:root xmlns:jsp = "http://java.sun.com/JSP/Page" version = "2.1".
    xmlns:af = "http://xmlns.oracle.com/adf/faces/rich" >
    < af:panelGroupLayout layout = "vertical" >
    < af:outputText value = "#{bindings.titleHead.inputValue} '"
    inlineStyle = "color: Black;" make-weight: bold; "/ >
    < af:outputText value = "#{bindings.titleDesc.inputValue} '"
    inlineStyle = ' color: gray; "/ >
    < af:spacer width = "10" height = "10" / >

    < af:forEach var = "row" items = "#{bindings." Feed.rangeSet} ">"

    < af:goLink text = "#{row.title} '"
    destination = "#{row." Link}.
    inlineStyle = "width: 100%;" make-weight: bold; color: ActiveCaption; "/ >
    < af:outputText value = "#{row.description} '"
    inlineStyle = "color: Black;" / >
    < af:spacer width = "10" height = "5" / >

    < / af:forEach >
    < / af:panelGroupLayout >
    < / jsp:root >

    FeedReader.java
    -----------------------

    package model.oracle.sample;

    import java.net.URL;
    to import java.util.Iterator;

    import com.sun.syndication.feed.synd.SyndEntry;
    import com.sun.syndication.feed.synd.SyndFeed;
    import com.sun.syndication.io.SyndFeedInput;
    import com.sun.syndication.feed.synd.SyndContent;
    import com.sun.syndication.io.XmlReader;
    import java.util.ArrayList;
    to import java.util.Collection;

    public class {FeedReader

    Collection < Feed > myFeedEntries = new ArrayList < Feed > ();

    public FeedReader() {}
    }

    /**
    @param arg
    * @return
    */
    public Collection < Feed > processFeed (String arg) {}

    If (arg! = null) {}
    try {}
    URL feedUrl = new URL (arg);
    last entry SyndFeedInput = new SyndFeedInput();
    final SyndFeed feed = input.build (new XmlReader (feedUrl));

    for (final iterator entryIter = feed.getEntries () .iterator ();)
    entryIter.hasNext ();)
    {
    Entry SyndEntry = entryIter.next () (SyndEntry);
    addEntry (feed.getTitle (), feed.getDescription (), entry);
    }
    }
    catch (Exception ex) {}
    ex.printStackTrace ();
    System.out.println ("ERROR:" + ex.getMessage ());
    }
    }
    Return myFeedEntries;
    }

    ' public void addEntry (String titleHead, String titleDesc, entry SyndEntry) {}
    Preparation of the variables used in the loops
    String title = entry.getTitle ();
    Link of chain = entry.getLink ();
    SyndContent contentDesc = entry.getDescription ((SyndContent));
    Dim description As String = contentDesc.getValue ();

    myFeedEntries.add (new Feed (titleHead, titleDesc, title, link, description));
    }

    }


    Feed.Java
    ---------------

    package model.oracle.sample;

    to import java.util.Collection;

    public class {Feed
    public Feed() {}
    }

    String titleHead;
    String titleDesc;
    String title;
    Link to the chain;
    Description of the chain;

    public Feed (String titleHead, String titleDesc, String title, link in the chain, String description) {}
    Super();
    this.titleHead = titleHead;
    this.titleDesc = titleDesc;
    This.title = title;
    This.Link = link;
    This.Description = description;
    }

    {} public void setTitleHead (String titleHead)
    this.titleHead = titleHead;
    }

    public String getTitleHead() {}
    Return titleHead;
    }

    {} public void setTitleDesc (String titleDesc)
    this.titleDesc = titleDesc;
    }

    public String getTitleDesc() {}
    Return titleDesc;
    }

    {} public void setTitle (String title)
    This.title = title;
    }

    public String getTitle() {}
    return title;
    }

    {} public void setLink (chain link)
    This.Link = link;
    }

    public String getLink() {}
    return the link;
    }

    {} public void setDescription (description of the chain)
    This.Description = description;
    }

    public String getDescription() {}
    return description;
    }
    }

    Excellent point Shay. So that the RSSFeedReader works as expected is really an example of creating a shared library and not an example of using the older for each method to iterate over the data. The recommended method is as Shay notes.

  • Page number will not be reset using for-each@section:

    Greetings,
    I have a page that I try to print from my Bill of lading. I use <? for-each@section:Shipment_Header_S10? > to generate my repeating group and reset the page numbers for each bill of lading (a new is generated for each shipment number). I have 453 pages for this example and the numbering of pages does not reset. In addition, on each page which follows the first, I get this black bar through the space above and a bit more at the top of each page.

    Thanks for the help.

    DVF

    sent the updated model check and let me know. You must keep the each@section code and end for each code outside the table. and if you used @section that you must not use split by a page break.

  • Results not updated for each row in BIpublisher

    Hi all I have a Bi publisher report that updates the results of the first line and in the second row to update the results is to choose the values of the first column itself and using the same values for all other lines.

    Here is my report format

    Months saving altogether, for 30,60,90,120
    Jan
    Feb
    Mar

    Total are registered by each month and days shows after 30,60,90,120 how much is still in operation. For example should give an idea of exactly what is happening

    For example:

    Total 30 days 60 days 90 days 150days 210days 180days 120days
    ------------------------------------------------------------------------------------------------------------------------------------------------------------ Jan saves 330 287 274 270 263 262 259 257

    Feb saves 298 255 242 238 231 230 227 225

    Mar saves 291 248 235 231 224 223 220 218


    So what happens is lets say for example there is a total of 330 enrolled in January and after 30days 287 are still active and after 60 days 274 are still in business after 90 270... etc.
    Get active January values correctly.

    But in the future when I see the values for February that the total for February is 298 and after 30 days, that do not operate gives me good.

    Is subtracting the same amount as jan. looking at the figures it is subtracting
    -43,-13,-4,-7,-1,-3,-2 for Jan who cancel after consecutive days
    It is subtracting the same amount for Feb also but my real cancelled for February is different we 45,12,8,9,2,2.
    It does the same thing for every month.
    There should be a change in the code. Here is the XSL code used in

    <? xdoxslt:set_variable($_XDOCTX,_'v_SavesCanceled',_SAVES_CANCELED_COUNT)? >

    <? xdoxslt:set_variable ($_XDOCTX, 'v_RtSaves', xdoxslt:get_variable($_XDOCTX,_'v_RtSaves') - xdoxslt:get_variable($_XDOCTX,_'v_SavesCanceled'))? >

    <? xdoxslt:get_variable($_XDOCTX,_'v_RtSaves')? >

    Effectively cancels it should be updated for each line but his picking cancels it even for each month.
    Hope it is clear let me know if you need any additional information
    Any help is appreciated.

    Thank you

    Can you send me the xml and RTF to [email protected]? I can take a look and try to help.

    Thank you
    Bipuser

  • Update a variable based on the expiration date checking against now() in each row of a table

    I use Coldfusion 9,0,0,251028 on Windows 7 64 bit with a Microsoft Access 97 database.

    I am creating a query that loops through all the rows in a table and checks if the current date is earlier than the date of expiration or later. 

    If the expiration date column is earlier to now(), it sets the column "is_current" to 0, which is a variable that determines if a message appears on a page (breakingnews.cfm) different. 

    The column that has the expiry date is "exp_dat" in the "news" table. The query I have at the moment is:

    <cfquery name="expire" datasource="#db#">
    

    Two things:

    1 - a query will never affect rows that you did not. So if new lines have the is_current set to 0, then it's because you want to set or out in the instructions of your return or you set a default value to the column. Just make sure that you set the 1 column when you insert the new line.

    2. Why are you doing this at all? Say you run your update query (which is relatively intensive) a millisecond before the expiration of one, it will still appear on your page. Why you not just do "SELECT * FROM MaTable WHERE correspondents > now() '?

    Obviously using cfqueryparams, but this is just an example. It seems for now what you do is store obsolete data in a database and cause you more work and overhead.

Maybe you are looking for