Edit C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\7.0.1\help\reference\flatfile.13.5.html
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <!-- MOTW-DISABLED saved from url=(0014)about:internet --> <title>Update Statement</title> <link rel="StyleSheet" href="css/flatfile.css" type="text/css" media="all" /> <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" /> <script type="text/javascript" language="JavaScript1.2" src="wwhdata/common/context.js"></script> <script type="text/javascript" language="JavaScript1.2" src="wwhdata/common/towwhdir.js"></script> <script type="text/javascript" language="JavaScript1.2" src="wwhdata/common/wwhpagef.js"></script> <script type="text/javascript" language="JavaScript1.2"> <!-- var WebWorksRootPath = ""; // --> </script> <script type="text/javascript" language="JavaScript1.2"> <!-- // Set reference to top level help frame // var WWHFrame = WWHGetWWHFrame("", true); // --> </script> <script type="text/javascript" language="JavaScript1.2" src="scripts/expand.js"></script> </head> <body class="" style="background-color: #FFFFEE;" onload="WWHUpdate();" onunload="WWHUnload();" onkeydown="WWHHandleKeyDown((document.all||document.getElementById||document.layers)?event:null);" onkeypress="WWHHandleKeyPress((document.all||document.getElementById||document.layers)?event:null);" onkeyup="WWHHandleKeyUp((document.all||document.getElementById||document.layers)?event:null);"> <br /> <div class="WebWorks_Breadcrumbs" style="text-align: left;"> <a class="WebWorks_Breadcrumb_Link" href="flatfile.13.1.html#106963">11 SQL Statements for Flat-File Drivers</a> : Update Statement</div> <hr align="left" /> <blockquote> <div class="head_1"><a name="106963">Update Statement</a></div> <div class="Body"><a name="106964">The Update statement is used to change rows in a database file. The form of the Update </a>statement supported for flat-file drivers is:</div> <div class="syntax_first"><a name="106965">UPDATE </a><span class="EquationVariables">table_name</span> SET <span class="EquationVariables">col_name</span> = <span class="EquationVariables">expr</span>, ...</div> <div class="syntax"><a name="106966">[ WHERE { </a><span class="EquationVariables">conditions</span> | CURRENT OF <span class="EquationVariables">cursor_name</span> } ]</div> <div class="Body"><span class="EquationVariables"><a name="106967">table_name</a></span> can be a simple table name or a full path name. A table name is preferred for portability to other SQL data sources.</div> <div class="Body"><span class="EquationVariables"><a name="106968">col_name</a></span> is the name of a column whose value is to be changed. Several columns can be changed in one statement.</div> <div class="Body"><span class="EquationVariables"><a name="106969">expr</a></span> is the new value for the column. The expression can be a constant value or a subquery. Character string values must be enclosed with single (â??) or double (") quotation marks, date values must be enclosed by braces {}, and logical values that are letters must be enclosed by periods (for example, .T. or .F.). Subqueries must be enclosed in parentheses.</div> <div class="Body"><a name="106972">The Where clause (any valid clause described in </a><span class="Cross_ref_"><a href="javascript:WWHClickedPopup('reference', 'flatfile.13.2.html#106182', '');">â??Select Statementâ??</a></span>) determines which rows are to be updated.</div> <div class="Body"><a name="106974">The Where Current Of </a><span class="EquationVariables">cursor_name</span> clause can be used only by developers coding directly to the ODBC API. It causes the row at which <span class="EquationVariables">cursor_name</span> is positioned to be updated. This is called a "positioned update." You must first execute a Select...For Update statement with a named cursor and fetch the row to be updated.</div> <div class="Body"><a name="106975">An example of an Update statement on the emp table is:</a></div> <div class="syntax_first"><a name="106976">UPDATE emp SET salary=32000, exempt=1 </a></div> <div class="syntax"><a name="106977">WHERE emp_id = 'E10001'</a></div> <div class="Body"><a name="106978">The Update statement changes every record that meets the conditions in the Where clause. </a>In this case, the salary and exempt status are changed for all employees having the employee ID E10001. Because employee IDs are unique in the emp table, only one record is updated.</div> <div class="Body"><a name="106979">An example using a subquery is:</a></div> <div class="syntax_first"><a name="106980">UPDATE emp SET salary = (SELECT avg(salary) FROM emp) </a></div> <div class="syntax"><a name="106981">WHERE emp_id = 'E10001'</a></div> <div class="Body"><a name="106982">In this case, the salary is changed to the average salary in the company for the employee </a>having employee ID E10001.</div> <script type="text/javascript" language="JavaScript1.2"> <!-- // Clear related topics // WWHClearRelatedTopics(); document.writeln(WWHRelatedTopicsInlineHTML()); // --> </script> </blockquote> <script type="text/javascript" language="JavaScript1.2"> <!-- document.write(WWHRelatedTopicsDivTag() + WWHPopupDivTag() + WWHALinksDivTag()); // --> </script> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de