 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; SQL variables</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/sql-variables/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 00:58:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Can you use variables as input and output when calling a stored procedure in COBOL?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/can-you-use-variables-as-input-and-output-when-calling-a-stored-procedure-in-cobol/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/can-you-use-variables-as-input-and-output-when-calling-a-stored-procedure-in-cobol/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 17:02:58 +0000</pubDate>
		<dc:creator>Bunkyg</dc:creator>
				<category><![CDATA[CL variables]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[SQL procedure]]></category>
		<category><![CDATA[SQL variables]]></category>
		<category><![CDATA[Variable fields]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[If you move data into your variable before calling your procedure, can the procedure then return a value back, which might be different? The procedure will intially be searching for the variable data, but, according to our .net programmer, will return a blank or null if it does not find the data. So far, that [...]]]></description>
				<content:encoded><![CDATA[<p>If you move data into your variable before calling your procedure, can the procedure then return a value back, which might be different? The procedure will intially be searching for the variable data, but, according to our .net programmer, will return a blank or null if it does not find the data. So far, that is not working, and he wants me to find the COBOL answer to this.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/can-you-use-variables-as-input-and-output-when-calling-a-stored-procedure-in-cobol/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Would using a table variable from a function be efficient?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/would-using-a-table-variable-from-a-function-be-efficient/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/would-using-a-table-variable-from-a-function-be-efficient/#comments</comments>
		<pubDate>Wed, 19 May 2010 07:16:49 +0000</pubDate>
		<dc:creator>C1140</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL tables]]></category>
		<category><![CDATA[SQL variables]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[We divided our tables from table zone_a, &#8230;_b, &#8230;_c to zone_z, these tables have the same attributes. We have divided this tables in this way so that any data that is under zone_a would only be on it&#8217;s specific table, and the same with the other remaining table. Since per table holds thousands of data [...]]]></description>
				<content:encoded><![CDATA[<p>We divided our tables from table zone_a, &#8230;_b, &#8230;_c to zone_z, these<br />
tables have the same attributes. We have divided this tables in this way<br />
 so that any data that is under zone_a would only be on it&#8217;s specific<br />
table, and the same with the other remaining table. Since per table<br />
holds thousands of data per day we have decided it to be designed this<br />
way and also hoping to reduce lock up of tables everytime a user<br />
accesses the table.</p>
<p>Now, we made a function that returns a table. This function will handle<br />
what table is to be selected. The body of this function contains a table<br />
 variable, it holds the data from the selected table. This function will<br />
 return the table variable </p>
<p>We have made this function hoping that it would be efficient to use for<br />
other future procedures.</p>
<p>Is it efficient?</p>
<p>Thank You in advance.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/would-using-a-table-variable-from-a-function-be-efficient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dynamic temporary table variable usage</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/dynamic-temporary-table-variable-usage/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/dynamic-temporary-table-variable-usage/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 19:53:42 +0000</pubDate>
		<dc:creator>PaminBuckeyeLand</dc:creator>
				<category><![CDATA[Dynamic SQL]]></category>
		<category><![CDATA[INNER JOIN]]></category>
		<category><![CDATA[SQL tables]]></category>
		<category><![CDATA[SQL variables]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[We have an sqr (running against a MS SQL Server DB), that references a dynamic temporary table variable in several begin-sql and begin-select statements. I am getting a syntax error in one begin-select statement where I can&#8217;t resolve the problem. It occurs after the INNER JOIN on the [$Temp_Final_IDlist] temp table. It appears as if [...]]]></description>
				<content:encoded><![CDATA[<p>We have an sqr (running against a MS SQL Server DB), that references a dynamic temporary table variable in several begin-sql and begin-select statements.  I am getting a syntax error in one begin-select statement where I can&#8217;t resolve the problem.  It occurs after the INNER JOIN on the [$Temp_Final_IDlist] temp table.  It appears as if SQR doesn&#8217;t see the replacement value for [$Temp_Final_IDlist].<br />
I&#8217;ve already made sure that the variable is not empty.<br />
Is there a limit in SQR on how many dynamic variables can be used in one program?</p>
<p>code:<br />
Cursor #28:<br />
   SQL = SELECT SEV_21A.ID,<br />
                SEV_21A.HouseHoldKey,<br />
                SEV_21A.HouseHoldCombineFlag,<br />
                SEV_21A.OrderSeqNbrStd,<br />
                SEV_21A.PrefixRankAdjusted,<br />
                SEV_21A.SalutationPrefixCode,<br />
                SEV_21A.PrefixFormalSal,<br />
                SEV_21A.PrefixFormalSalPunc,<br />
                SEV_21A.NickName,<br />
                SEV_21A.FirstName,<br />
                SEV_21A.FirstNamePunc,<br />
                SEV_21A.LastName,<br />
                SEV_21A.Gender,</p>
<p>                SEV_21B.ID,<br />
                SEV_21B.HouseHoldKey,<br />
                SEV_21B.HouseHoldCombineFlag,<br />
                SEV_21B.OrderSeqNbrStd,<br />
                SEV_21B.PrefixRankAdjusted,<br />
                SEV_21B.SalutationPrefixCode,<br />
                SEV_21B.PrefixFormalSal,<br />
                SEV_21B.PrefixFormalSalPunc,<br />
                SEV_21B.NickName,<br />
                SEV_21B.FirstName,<br />
                SEV_21B.FirstNamePunc,<br />
                SEV_21B.LastName,<br />
                SEV_21B.Gender  </p>
<p>         FROM Salutation_Elements_View    SEV_21A<br />
         INNER JOIN<br />
              [$Temp_Final_IDList]        TFI_21A   ON SEV_21A.ID = TFI_21A.ID<br />
                                                   AND TFI_21A.DropIDFlag = &#8216;N&#8217;<br />
         INNER JOIN<br />
               Salutation_Elements_View   SEV_21B   ON SEV_21A.HouseHoldKey = SEV_21B.HouseHoldKey<br />
                                                   AND SEV_21A.HouseHoldCombineFlag = SEV_21B.HouseHoldCombineFlag<br />
                                                   AND SEV_21A.EntityType           = SEV_21B.EntityType<br />
                                                   AND SEV_21A.SalutationType       = SEV_21B.SalutationType<br />
                                                   AND SEV_21A.OrderSeqNbrStd      &lt;&gt; SEV_21B.OrderSeqNbrStd<br />
                                                   AND SEV_21B.LastName IS NOT NULL<br />
                                                   AND SEV_21B.StopDateTime  IS NULL<br />
                                                   AND SEV_21B.StopUserID    IS NULL</p>
<p>         WHERE SEV_21A.LastName        IS NOT NULL<br />
           AND SEV_21A.OrderSeqNbrStd       = 1<br />
           AND SEV_21A.HouseHoldCombineFlag = &#8216;Y&#8217;<br />
           AND SEV_21A.SalutationType       = &#8216;A&#8217;<br />
           AND SEV_21A.StopDateTime    IS NULL<br />
           AND SEV_21A.StopUserID    IS NULL </p>
<p>         ORDER BY SEV_21A.HouseHoldKey, SEV_21A.ID</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/dynamic-temporary-table-variable-usage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Delete variable file in SQLRPG</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/delete-variable-file/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/delete-variable-file/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 09:01:36 +0000</pubDate>
		<dc:creator>Samuele</dc:creator>
				<category><![CDATA[DELETE statement]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL variables]]></category>
		<category><![CDATA[SQLRPG]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[How can I use any variable file in an instruction SQL of DELETE in SQLRPG?]]></description>
				<content:encoded><![CDATA[<p>How can I use any variable file in an instruction SQL of DELETE in SQLRPG?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/delete-variable-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server 2005</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-2005-3/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-2005-3/#comments</comments>
		<pubDate>Fri, 08 May 2009 06:37:15 +0000</pubDate>
		<dc:creator>Narendar</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL statements]]></category>
		<category><![CDATA[SQL variables]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[CAN ANYBODY HELP ME &#8220;HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE&#8221;. FOR EXAMPLE : TO ASSIGN A STRING IN A VARIABLE, WE DO LIKE THIS: DECLARE @A AS VARCHAR(20) SET @A=&#8217;HAI&#8217; PRINT @A OUTPUT: HAI SIMILARLY HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE.]]></description>
				<content:encoded><![CDATA[<p>CAN ANYBODY HELP ME </p>
<p>&#8220;HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE&#8221;. </p>
<p>FOR EXAMPLE :  TO ASSIGN A STRING IN A VARIABLE, WE DO LIKE THIS:</p>
<p>DECLARE @A AS VARCHAR(20)<br />
SET @A=&#8217;HAI&#8217;<br />
PRINT @A</p>
<p>OUTPUT:<br />
HAI</p>
<p>SIMILARLY HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-2005-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>pass variable from Foreach loop to stored Procedure parameters</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/pass-variable-from-foreach-loop-to-stored-procedure-parameters/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/pass-variable-from-foreach-loop-to-stored-procedure-parameters/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 20:51:22 +0000</pubDate>
		<dc:creator>IG1944</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Parameters]]></category>
		<category><![CDATA[SQL stored procedures]]></category>
		<category><![CDATA[SQL variables]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[in control flow I run &#8220;Execute SQL Task&#8221; to retrive array variables like State Code (&#8216;AR&#8217;, &#8216;WI&#8217;, .. et). Then I run ForeEach Loop Container and pass global variable gv_StateCode into Data Flow, where I run stored proc with one parameter in &#8220;OLE DB Source&#8221; (like exec sp_StProcname ?) and i assign parameter in Set [...]]]></description>
				<content:encoded><![CDATA[<p>in control flow  I run &#8220;Execute SQL Task&#8221; to retrive array variables like State Code (&#8216;AR&#8217;, &#8216;WI&#8217;, .. et). Then I run ForeEach Loop Container and pass global variable gv_StateCode into Data Flow, where I run stored proc with one parameter in &#8220;OLE DB Source&#8221; (like exec sp_StProcname ?) and i assign parameter in Set Query parameters dialog to gv_StateCode as Parameter0 = User::gv_StateCode.<br />
When I run this package I got error: &#8220;The SQL command requires a parameter named &#8220;@p_StateCode&#8221;, which is not found in the parameter mapping.&#8221;</p>
<p>Please help me to resolve this issue.</p>
<p>Thanks IG</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/pass-variable-from-foreach-loop-to-stored-procedure-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server trigger , insert result of multiple where clause into a variable</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-trigger-insert-result-of-multiple-where-clause-into-a-variable/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-trigger-insert-result-of-multiple-where-clause-into-a-variable/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 08:23:48 +0000</pubDate>
		<dc:creator>Jacquesvdm</dc:creator>
				<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL variables]]></category>
		<category><![CDATA[Triggers]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi All, I have a select statement that stores the result in a variable,this works fine if there is only one condition and field in the clause.How do I go about it if there is more than one? For example (Working one) SELECT @Variable = (SELECT [Field] FROM [Table] WHERE [FIELD] = Value) But I [...]]]></description>
				<content:encoded><![CDATA[<p>Hi All,</p>
<p>I have a select statement that stores the result in a variable,this works fine if there is only one condition and field in the clause.How do I go about it if there is more than one?</p>
<p>For example (Working one)<br />
SELECT @Variable = (SELECT [Field] FROM [Table] WHERE [FIELD] = Value)</p>
<p>But I am looking for something like this </p>
<p>IF EXIST(SELECT * FROM [Table] WHERE [FIELD1] = Value1 AND [Field2] = Value2)<br />
     BEGIN<br />
           INSERT<br />
                @Variable<br />
           VALUE<br />
                 [FIELD3]<br />
     END</p>
<p>Thanks Alot</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-trigger-insert-result-of-multiple-where-clause-into-a-variable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/26 queries in 0.033 seconds using memcached
Object Caching 716/834 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 06:50:20 -->