No BSD License  

Highlights from
Access a MySQL database

image thumbnail

Access a MySQL database

by

 

05 Dec 2007 (Updated )

(with mym.m)

MYDEMO: Demonstrate usage of mym utilities
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40" xmlns:ns0="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd"> <head> <meta http-equiv=Content-Type content="text/html; charset=unicode"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 12"> <meta name=Originator content="Microsoft Word 12"> <link rel=File-List href="mydemo_files/filelist.xml"> <title>MYDEMO: Demonstrate usage of mym utilities</title> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>Dimitri Shvorob</o:Author> <o:Template>Normal</o:Template> <o:LastAuthor>Dimitri Shvorob</o:LastAuthor> <o:Revision>3</o:Revision> <o:TotalTime>1</o:TotalTime> <o:Created>2007-12-05T18:09:00Z</o:Created> <o:LastSaved>2007-12-05T18:10:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>638</o:Words> <o:Characters>3638</o:Characters> <o:Company>Vanderbilt University</o:Company> <o:Lines>30</o:Lines> <o:Paragraphs>8</o:Paragraphs> <o:CharactersWithSpaces>4268</o:CharactersWithSpaces> <o:Version>12.00</o:Version> </o:DocumentProperties> </xml><![endif]--> <link rel=themeData href="mydemo_files/themedata.thmx"> <link rel=colorSchemeMapping href="mydemo_files/colorschememapping.xml"> <!--[if gte mso 9]><xml> <w:WordDocument> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:DontVertAlignCellWithSp/> <w:DontBreakConstrainedForcedTables/> <w:DontVertAlignInTxbx/> <w:Word11KerningPairs/> <w:CachedColBalance/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--> <style> <!-- @media print { pre.codeinput {word-wrap:break-word; width:100%;} } p {max-width: 600px; width:expression(document.body.clientWidth > 620 ? "600px": "auto" );} h1 {max-width: 600px; width:expression(document.body.clientWidth > 620 ? "600px": "auto" );} h2 {max-width: 600px; width:expression(document.body.clientWidth > 620 ? "600px": "auto" );} div.CONTENT div {max-width: 600px; width:expression(document.body.clientWidth > 620 ? "600px": "auto" );} /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:auto; mso-font-signature:0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-believe-normal-left:yes;} h1 {mso-style-priority:9; mso-style-unhide:no; mso-style-qformat:yes; mso-style-link:"Heading 1 Char"; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:1; font-size:24.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; color:#990000; font-weight:bold;} h2 {mso-style-priority:9; mso-style-unhide:no; mso-style-qformat:yes; mso-style-link:"Heading 2 Char"; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:2; font-size:13.5pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; color:#990000; font-weight:bold;} p {mso-style-noshow:yes; mso-style-priority:99; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} pre {mso-style-noshow:yes; mso-style-priority:99; mso-style-link:"HTML Preformatted Char"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; font-size:10.0pt; font-family:"Courier New"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} span.Heading1Char {mso-style-name:"Heading 1 Char"; mso-style-priority:9; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 1"; mso-ansi-font-size:14.0pt; mso-bidi-font-size:14.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#365F91; mso-themecolor:accent1; mso-themeshade:191; font-weight:bold;} span.Heading2Char {mso-style-name:"Heading 2 Char"; mso-style-noshow:yes; mso-style-priority:9; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 2"; mso-ansi-font-size:13.0pt; mso-bidi-font-size:13.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#4F81BD; mso-themecolor:accent1; font-weight:bold;} span.HTMLPreformattedChar {mso-style-name:"HTML Preformatted Char"; mso-style-noshow:yes; mso-style-priority:99; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"HTML Preformatted"; font-family:"Consolas","serif"; mso-ascii-font-family:Consolas; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Consolas;} p.footer, li.footer, div.footer {mso-style-name:footer; mso-style-unhide:no; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; text-align:right; mso-pagination:widow-orphan; font-size:7.5pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; color:gray; font-style:italic;} span.keyword {mso-style-name:keyword; mso-style-unhide:no; color:blue;} span.comment {mso-style-name:comment; mso-style-unhide:no; color:forestgreen;} span.string {mso-style-name:string; mso-style-unhide:no; color:#A020F0;} span.untermstring {mso-style-name:untermstring; mso-style-unhide:no; color:#B20000;} span.syscmd {mso-style-name:syscmd; mso-style-unhide:no; color:#B28C00;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:1260065174; mso-list-template-ids:-263585214;} @list l0:level1 {mso-level-number-format:bullet; mso-level-text:; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";} </style> <![endif]--><![if mso 9]> <style> p.MsoNormal {margin-left:7.5pt;} </style> <![endif]><!-- This HTML is auto-generated from an M-file. To make changes, update the M-file and republish this document. --> <meta name=date content=2007-12-05> <meta name=m-file content=mydemo> <!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="2050"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head> <body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:.5in; margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt'> <div class=Section1> <div> <h1><span style='mso-fareast-font-family:"Times New Roman"'>MYDEMO: Demonstrate usage of mym utilities<o:p></o:p></span></h1> <introduction> <p>Example: mydemo (Oh, the FEX code metrics..)<o:p></o:p></p> </introduction> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Contents<o:p></o:p></span></h2> <div> <ul type=disc> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#1">List available functions</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#2">Connect to MySQL</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#3">List available databases</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#4">Create database 'test2'</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#5">Confirm that database 'test2' was created</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#6">Make database 'test2' current</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#7">Load FEX download data in file 'fex.txt' to table 'fex'</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#8">List tables in database 'test2'</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#9">List names and types of 'fex' columns</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#11">Read contents of table 'fex' into Matlab workspace</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#12">Write loaded data back to MySQL (500 rows per pass), to a table that is a copy of 'fex'</a><o:p></o:p></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family:"Times New Roman"'><a href="#13">Disconnect from MySQL</a><o:p></o:p></span></li> </ul> </div> <h2><span style='mso-fareast-font-family:"Times New Roman"'>List available functions<a name=1></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>lookfor <span class=string>mym</span></pre><pre><span style='color:#666666'> dbadd<span style='mso-spacerun:yes'> </span>Create MySQL database<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> dbcurr<span style='mso-spacerun:yes'> </span>Current MySQL database<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> dbdrop<span style='mso-spacerun:yes'> </span>Delete MySQL database<span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'></span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> dblist<span style='mso-spacerun:yes'> </span>List MySQL databases<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> dbopen<span style='mso-spacerun:yes'> </span>Make MySQL database current<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> myclose<span style='mso-spacerun:yes'> </span>Disconnect from MySQL<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> myopen<span style='mso-spacerun:yes'> </span>Connect to MySQL<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbadd<span style='mso-spacerun:yes'> </span>Create MySQL table<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbattr<span style='mso-spacerun:yes'> </span>List columns of MySQL table<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbdrop<span style='mso-spacerun:yes'> </span>Delete MySQL table<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tblist<span style='mso-spacerun:yes'> </span>List tables of MySQL database<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbprint<span style='mso-spacerun:yes'> </span>List a few rows of MySQL table [mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbread<span style='mso-spacerun:yes'> </span>Read from MySQL table<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbrename Rename MySQL table<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbsize<span style='mso-spacerun:yes'> </span>Size of MySQL table<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> tbwrite<span style='mso-spacerun:yes'> </span>Write to MySQL table<span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'></span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> myisopen True if MySQL instance active<span style='mso-spacerun:yes'> </span>[mym utilities]<span style='mso-spacerun:yes'> </span><o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'></span>istable<span style='mso-spacerun:yes'> </span>True if MySQL table exists<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'> isdbase<span style='mso-spacerun:yes'> </span>True if MySQL database exists<span style='mso-spacerun:yes'> </span>[mym utilities]<o:p></o:p></span></pre><pre><span style='color:#666666'>MYM - Interact with a MySQL database server <o:p></o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Connect to MySQL<a name=2></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>myisopen</pre><pre style='background:#EEEEEE'>myopen(<span class=string>'localhost'</span>,<span class=string>'root'</span>,<span class=string>'zhir'</span>)</pre><pre style='background:#EEEEEE'>myisopen</pre><pre><span style='color:#666666'>mYm v1.0.8, Copyright (C) 2006, Swiss Federal Institute of technology, Lausanne, CH<o:p></o:p></span></pre><pre><span style='color:#666666'>mYm comes with ABSOLUTELY NO WARRANTY. This is free software,<o:p></o:p></span></pre><pre><span style='color:#666666'>and you are welcome to redistribute it under certain conditions.<o:p></o:p></span></pre><pre><span style='color:#666666'>For details read the GPL license included with this distribution.<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans =<o:p></o:p></span></pre><pre><span style='color: #666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>0<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans =<o:p></o:p></span></pre><pre><span style='color: #666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>1<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>List available databases<a name=3></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>dblist</pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans = <o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'information_schema'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'ibes'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'mysql'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'test'<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Create database 'test2'<a name=4></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>dbadd(<span class=string>'test2'</span>)</pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Confirm that database 'test2' was created<a name=5></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>isdbase(<span class=string>'test2'</span>)</pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans =<o:p></o:p></span></pre><pre><span style='color: #666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>1<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Make database 'test2' current<a name=6></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>dbcurr</pre><pre style='background:#EEEEEE'>dbopen(<span class=string>'test2'</span>)</pre><pre style='background:#EEEEEE'>dbcurr</pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans =<o:p></o:p></span></pre><pre><span style='color: #666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>Empty string: 1-by-0<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans =<o:p></o:p></span></pre><pre><span style='color: #666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>test2<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Load FEX download data in file 'fex.txt' to table 'fex'<a name=7></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>mym([<span class=string>'create table fex ('</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'time datetime, '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'id<span style='mso-spacerun:yes'> </span>mediumint unsigned, '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'rank smallint<span style='mso-spacerun:yes'> </span>unsigned, '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'file smallint<span style='mso-spacerun:yes'> </span>unsigned, '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'fcat tinyint<span style='mso-spacerun:yes'> </span>unsigned, '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'down smallint<span style='mso-spacerun:yes'> </span>unsigned)'</span>])</pre><pre style='background:#EEEEEE'>tic</pre><pre style='background:#EEEEEE'>mym([<span class=string>'load data infile ''D:/Program Files/Matlab/work/fexstat/fex.txt'' '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'into table fex lines terminated by ''\n'' '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'(@time,id,rank,file,fcat,down) '</span> <span class=keyword>...</span></pre><pre style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span class=string>'set time = str_to_date(@time,''%d-%b-%Y %H:%i:%s'')'</span>])</pre><pre style='background:#EEEEEE'>toc</pre><pre><span style='color:#666666'>Elapsed time is 42.149378 seconds.<o:p></o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>List tables in database 'test2'<a name=8></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>tblist</pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans = <o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'fex'<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>List names and types of 'fex' columns<a name=9></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>[names, types] = tbattr(<span class=string>'fex'</span>)</pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>names = <o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'time'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'id'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'rank'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'file'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'fcat'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'down'<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>types = <o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'datetime'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'mediumint(8) unsigned'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'smallint(5) unsigned'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'smallint(5) unsigned'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'tinyint(3) unsigned'<o:p></o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>'smallint(5) unsigned'<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre style='background: #EEEEEE'>tbsize(<span class=string>'fex'</span>)</pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans =<o:p></o:p></span></pre><pre><span style='color: #666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>1344031.00<span style='mso-spacerun:yes'> </span>6.00<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Read contents of table 'fex' into Matlab workspace<a name=11></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>who</pre><pre style='background:#EEEEEE'>tic</pre><pre style='background:#EEEEEE'>tbread(<span class=string>'fex'</span>,names,names,<span class=string>''</span>)</pre><pre style='background:#EEEEEE'>toc</pre><pre style='background:#EEEEEE'>who</pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>Your variables are:<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans<span style='mso-spacerun:yes'> </span>names<span style='mso-spacerun:yes'> </span>types<span style='mso-spacerun:yes'> </span><o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>Elapsed time is 54.241301 seconds.<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>Your variables are:<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans<span style='mso-spacerun:yes'> </span>down<span style='mso-spacerun:yes'> </span>fcat<span style='mso-spacerun:yes'> </span>file<span style='mso-spacerun:yes'> </span>id<span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'></span>names<span style='mso-spacerun:yes'> </span>rank<span style='mso-spacerun:yes'> </span>time<span style='mso-spacerun:yes'> </span>types<span style='mso-spacerun:yes'> </span><o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Write loaded data back to MySQL (500 rows per pass), to a table that is a copy of 'fex'<a name=12></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>tic</pre><pre style='background:#EEEEEE'>tbadd(<span class=string>'fex2'</span>,names,types,<span class=string>'replace'</span>)</pre><pre style='background:#EEEEEE'>tbwrite(<span class=string>'fex2'</span>,names,names,500)</pre><pre style='background:#EEEEEE'>toc</pre><pre style='background:#EEEEEE'><o:p>&nbsp;</o:p></pre><pre style='background:#EEEEEE'>tbsize(<span class=string>'fex2'</span>)</pre><pre><span style='color:#666666'>Elapsed time is 3014.397140 seconds.<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'>ans =<o:p></o:p></span></pre><pre><span style='color: #666666'><o:p>&nbsp;</o:p></span></pre><pre><span style='color:#666666'><span style='mso-spacerun:yes'> </span>1344031.00<span style='mso-spacerun:yes'> </span>6.00<o:p></o:p></span></pre><pre><span style='color:#666666'><o:p>&nbsp;</o:p></span></pre> <h2><span style='mso-fareast-font-family:"Times New Roman"'>Disconnect from MySQL<a name=13></a><o:p></o:p></span></h2> <pre style='background:#EEEEEE'>myclose</pre> <p class=footer><br> Published with MATLAB 7.2<o:p></o:p></p> </div> </div> <!-- ##### SOURCE BEGIN ##### %% MYDEMO: Demonstrate usage of mym utilities % Example: mydemo (Oh, the FEX code metrics..) %% List available functions lookfor mym %% Connect to MySQL myisopen myopen('localhost','root','zhir') myisopen %% List available databases dblist %% Create database 'test2' dbadd('test2') %% Confirm that database 'test2' was created isdbase('test2') %% Make database 'test2' current dbcurr dbopen('test2') dbcurr %% Load FEX download data in file 'fex.txt' to table 'fex' mym(['create table fex (' ... 'time datetime, ' ... 'id mediumint unsigned, ' ... 'rank smallint unsigned, ' ... 'file smallint unsigned, ' ... 'fcat tinyint unsigned, ' ... 'down smallint unsigned)']) tic mym(['load data infile ''D:/Program Files/Matlab/work/fexstat/fex.txt'' ' ... 'into table fex lines terminated by ''\n'' ' ... '(@time,id,rank,file,fcat,down) ' ... 'set time = str_to_date(@time,''%d-%b-%Y %H:%i:%s'')']) toc %% List tables in database 'test2' tblist %% List names and types of 'fex' columns [names, types] = tbattr('fex') %% tbsize('fex') %% Read contents of table 'fex' into Matlab workspace who tic tbread('fex',names,names,'') toc who %% Write loaded data back to MySQL (500 rows per pass), to a table that is a copy of 'fex' tic tbadd('fex2',names,types,'replace') tbwrite('fex2',names,names,500) toc tbsize('fex2') %% Disconnect from MySQL myclose ##### SOURCE END ##### --> </body> </html>

Contact us