23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples<br />

Authorization<br />

UPDATE STATISTICS<br />

Must have DBA privilege or UPDATE privileges on all the specified columns of the target<br />

table, and SELECT privilege on all the other tables referred to in the statement.<br />

Related statements<br />

UPDATE STATISTICS<br />

Syntax<br />

UPDATE Orderline<br />

SET Qty = 186<br />

Where Ordernum = 22;<br />

Update Orderline<br />

SET (Itemnum) =<br />

(Select Itemnum<br />

FROM Item<br />

WHERE Itemname = 'Tennis balls')<br />

WHERE Ordernum = 20;<br />

UPDATE Orderline<br />

SET (Qty) = (200 * 30)<br />

WHERE OrderNum = 19;<br />

UPDATE OrderLine<br />

SET (ItemNum, Price) =<br />

(SELECT ItemNum, Price * 3<br />

FROM Item<br />

WHERE ItemName = 'gloves')<br />

WHERE OrderNum = 21 ;<br />

SELECT, OPEN, FETCH<br />

Queries data tables and updates the following statistics:<br />

• Table cardinality<br />

• Index statistics<br />

• Column data distribution for columns that are index components<br />

• Column data distribution for columns that are not index components<br />

UPDATE ( [ TABLE | INDEX | [ ALL ] COLUMN ] STATISTICS<br />

[ AND ]) ... [ FOR table_name ] ;<br />

Examples The following example shows default commands for table cardinality and data distribution for<br />

index component columns:<br />

69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!