⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 command_createparam.html

📁 能够连接各种数据库的API
💻 HTML
字号:
<html>
<head>
<meta name="KEYWORDS" content="      library, C++,       Oracle, SQLServer, DB2, Sybase, Informix, InterBase, SQLBase, ODBC, 
      SQL, server, client, database, programming, development, software, 
      Win32, Windows, Linux, Unix, Solaris,
      Microsoft, Borland, Centura, Gupta, IBM"><meta name="DESCRIPTION" content=
"SQLAPI++ is C++ library for accessing SQL databases (Oracle, SQLServer, Sybase, DB2, InterBase, SQLBase, Informix, ODBC).
It uses native APIs, provides low-level access to database-specific features."><title>SQLAPI++ Library - Online Documentation - SACommand::CreateParam</title>
</head>
<body bgcolor="#ffffff" BACKGROUND="../images/bg.gif" text="#000000"><!--GlbHdr--> <table WIDTH="600" height="40" frame="hsides" BORDER="2" BORDERCOLOR="#004fcd" align="right" cellpadding="0" cellspacing="2" id="TABLE1">
    
    <tr><!--class="GlbDefault"-->        
        <td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../index.html" style="TEXT-DECORATION: none">
			<font color="white" size="3" face="sans-serif">
			<b>Home</b></font></A></td></TD>
        <td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../HowTo/index.html" style="TEXT-DECORATION: none">			<font color="white" size="3" face="sans-serif">
			<b>How To</b></font></A></td><!--class="GlbActive"-->
        <td width="70" bgcolor="#00bb00" bordercolor="black" align="middle"><A href="../OnLineDoc/index.html" style="TEXT-DECORATION: none">			<font color="white" size="3" face="sans-serif">
			<b>Online Documentation</b></font></A></td><!--class="GlbDefault"-->        
		<td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../Support/index.html" style="TEXT-DECORATION: none">			<font color="white" size="3" face="sans-serif">
			<b>Support</b></font></A></td>
        <td width=70 bgcolor=#000094 bordercolor=black align=middle>
			<A href="../Download/index.html" style="TEXT-DECORATION: none" >
			<font color=white size=3  
            face=sans-serif>
			<b>Download</b></font></A></td>
        <td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../Order/index.html" style="TEXT-DECORATION: none">			<font color="white" size="3" face="sans-serif">
			<b>Order</b></font></A></td>    </tr>
</table>&nbsp;

<p>&nbsp;</p>
<table width="100%">
	<tr>
		<td valign="top" width="165"><!--LeftMenu-->			
			<table frame="void" CELLSPACING="5" width="165">
				<tr><td><p>&nbsp;</p></td>
				</tr>
				<tr>
					<td><img align="middle" src="../images/red.gif" WIDTH="12" HEIGHT="12"><A href="Command.html" style="TEXT-DECORATION: none">
					<font color="white" size="2" face="sans-serif">
					SACommand</A> </FONT> </td>
				</tr>
				<tr>
					<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Connection.html" style="TEXT-DECORATION: none">
					<font color="white" size="2" face="sans-serif">
					SAConnection</A> </FONT> </td>
				</tr>
				<tr>
					<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Exception.html" style="TEXT-DECORATION: none">
					<font color="white" size="2" face="sans-serif">
					SAException</font></A> </td>
				</tr>
				<tr>
					<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Field.html" style="TEXT-DECORATION: none">
					<font color="white" size="2" face="sans-serif">
					SAField</A> </FONT> </td>
				</tr>
				<tr>
					<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Param.html" style="TEXT-DECORATION: none">
					<font color="white" size="2" face="sans-serif">
					SAParam</A> </FONT> </td>
				</tr>
				<tr><td><hr></td></tr>
				<tr>
					<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
					<A href="String.html" style ="TEXT-DECORATION: none" >
					<font color=white size=2 face=sans-serif>
					SAString</A> </FONT> </td>
				</tr>
				<tr>
					<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
					<A href="DateTime.html" style ="TEXT-DECORATION: none" >
					<font color=white size=2 face=sans-serif>
					SADateTime</A> </FONT> </td>
				</tr>
				<tr>
					<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
					<A href="Numeric.html" style ="TEXT-DECORATION: none" >
					<font color=white size=2 face=sans-serif>
					SANumeric</A> </FONT> </td>
				</tr>
				<tr><td><hr></td></tr>
				<tr>
					<td>
					<A href="Enums.html" style ="TEXT-DECORATION: none" >
					<font color=white size=2 face=sans-serif>
					Enums and Typedefs</A> </FONT> </td>
				</tr>
			</table>
		</td><!--empty column-->
		<td width="20"> 
			<p>&nbsp;&nbsp;</p>
		</td><!--Content-->
		<td valign="top" align="left">
			<table width="100%" cellspacing="2" cellpadding="2">
				<tr>
					<td align="left"><A href="Command_Usage.html" style="TEXT-DECORATION: none"><h3>Usage</h3></A>
					</td>
					<td align="left"><A href="Command.html" style="TEXT-DECORATION: none"><h3>Class Members</h3></A>
					</td>
					<td align="left"><A href="Command_Examples.html#CreateParam" style="TEXT-DECORATION: none"><h3>Examples</h3></A>
					</td>
				</tr>			
				<tr>
					<td colspan="3"><h1>SACommand::CreateParam</h1></td>
				</tr>			
			</table>
			<p><font face="Arial"><b>    SAParam&amp;  CreateParam( 
			const SAString  &amp;</b>sName<b>, 
			SADataType_t</b> eParamType<STRONG>, 
			int </STRONG> nNativeType<STRONG>, 
			int </STRONG> nParamSize<STRONG>, 
			int </STRONG> nParamPrecision<STRONG>, 
			int </STRONG> nParamScale<STRONG>, 
            SAParamDirType_t</STRONG> eDirType<b> );<BR > 
            throw (SAException);</b></font></p>

			<p>Creates parameter associated with the specified command.&nbsp; 
			</p>

			<h3>Parameters</h3>
            <P><EM>sName</EM>.&nbsp;&nbsp;&nbsp; A string representing the name 
            of parameter.</P>
            <P><EM>ePatamType</EM>.&nbsp;&nbsp;&nbsp; Type of the parameter's 
            value. <EM>eParamType</EM> can have one of the following values from 
            <STRONG>SADataType_t</STRONG> enum:</P>
            <UL>
                <LI><STRONG></STRONG><STRONG>SA_dtBool</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as <STRONG>bool</STRONG> data.
                <LI><STRONG>SA_dtShort</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as <STRONG>short</STRONG> data.  
                <LI><STRONG>SA_dtLong</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as <STRONG>long</STRONG> data. 
                <LI><STRONG>SA_dtFloat</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as <STRONG>float</STRONG> data. 
                <LI><STRONG>SA_dtDouble</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as <STRONG>double</STRONG> data. 
                <LI><STRONG>SA_dtNumeric</STRONG>&nbsp;&nbsp;&nbsp; 
                Data type is <STRONG>SANumeric</STRONG> (used 
                internally).</LI>  
                <LI><STRONG>SA_dtDateTime</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as standard C++ datetime structure 
                (<STRONG>struct tm</STRONG>). 
                <LI><STRONG>SA_dtString</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as string data (<STRONG>SAString</STRONG>). 
                <LI><STRONG>SA_dtLongBinary</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as long binary data 
                (<STRONG>SAString</STRONG>). 
                <LI><STRONG>SA_dtLongChar</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as long character data 
                (<STRONG>SAString</STRONG>). 
                <LI><STRONG>SA_dtBLob</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as BLob data (<STRONG>SAString</STRONG>). 
                <LI><STRONG>SA_dtCLob</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as CLob data (<STRONG>SAString</STRONG>). 
                <LI><STRONG>SA_dtCursor</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as Oracle REF CURSOR (<STRONG>SACommand</STRONG>). 
                <LI><STRONG>SA_dtSpecificToDBMS</STRONG>&nbsp;&nbsp;&nbsp; Sets 
                parameter's value as server-specific data type 
value.&nbsp; 
            </LI></UL>
            <P><EM>nNativeType</EM>.&nbsp;&nbsp;&nbsp; An integer value 
            representes a code of server-specific data type, if known. 
            Otherwise, <STRONG>-1</STRONG>    
               .</P>
            <P><EM>nParamSize</EM>.&nbsp;&nbsp;&nbsp; An integer value 
            represents parameter's value size.</P>
            <P><EM>nParamPrecision</EM>.&nbsp;&nbsp;&nbsp; An integer value 
            represents parameter's value precision.</P>
            <P><EM>nParamScale</EM>.&nbsp;&nbsp;&nbsp; An integer value 
            represents parameter's value scale.</P>
            <P><EM>eDirType</EM>.&nbsp;&nbsp;&nbsp; Type of the parameter. 
            <EM>eDirType</EM> can have one of the following values from 
            <STRONG>SAParamDirType_t</STRONG> 
            enum:</P>
            <UL>
                <LI><STRONG>SA_ParamInput</STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                <STRONG>SAParam</STRONG> object is an input parameter. 
                <LI><STRONG>SA_ParamInputOutput</STRONG>&nbsp;&nbsp;&nbsp; 
                <STRONG>SAParam</STRONG> object is an input/output parameter. 
                <LI><STRONG>SA_ParamOutput</STRONG>&nbsp;&nbsp;&nbsp; 
                <STRONG>SAParam</STRONG> object is an output 
                parameter. 
                <LI><STRONG>SA_ParamReturn</STRONG>&nbsp;&nbsp;&nbsp; 
                <STRONG>SAParam</STRONG> object is a returning parameter. </LI></UL>

			<h3>Return value</h3>
            <P>A reference to a <STRONG>SAParam</STRONG> object.</P>

			<h3>Remarks</h3>
            <P>Normally you should not create parameters by 
            yourself. The Library automatically detects whether the command has 
            parameters in terms of the command text and implicitly creates a set 
            of <A href="Param.html">SAParam</A> objects.</P>
            <P>Nevertheless, if you call 
            <STRONG>CreateParam</STRONG>
            explicitly you have to delete all <A 
            href="Param.html">SAParam</A>
            objects created automatically by the 
            Library before. Use <A 
            href="Command_DestroyParams.html">SACommand::DestroyParams</A> 
            method before the first call of <STRONG>CreateParam</STRONG> 
            method.</P>
			
			<h3>Server specific notes</h3>
            <p>No specific information.</p>
			
			<h3>See also</h3>
			<p><A 
            href="Command_DestroyParams.html">DestroyParams</A>, <A 
            href="Command_CommandText.html">CommandText</A>, <A 
            href="Command_setCommandText.html">setCommandText</A>, 
			<A href="Command_CommandType.html" target="" >CommandType</A> 
			</p>
			
			<p>
			<A href="Param.html">SAParam</A>, <A 
            href="Enums.html">SADataType_t</A>, <A 
            href="Enums.html">SAParamDirType_t</A> 
			</p>
			
			<p><A href="../HowTo/errors.html">Error 
            handling</A> 
			</p>

			<h3>Problems and Questions</h3>
			<p>			If 
			you haven't found the answer to your questions or 
            have some problems on using the Library, please, send e-mail to <A href="mailto:howto@sqlapi.com">howto@sqlapi.com</A>.
			</p>
		</td>
	<tr></tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -