<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dynamic sql for sybase 11.0 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754437#M835322</link>
    <description>Hi all,&lt;BR /&gt;Why nobody give me feedback ?</description>
    <pubDate>Fri, 28 Jun 2002 13:43:53 GMT</pubDate>
    <dc:creator>Catherine_3</dc:creator>
    <dc:date>2002-06-28T13:43:53Z</dc:date>
    <item>
      <title>dynamic sql for sybase 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754436#M835321</link>
      <description>Hi All,&lt;BR /&gt;I met a problem&lt;BR /&gt;I have a stored procedure that need to use dynamic sql:&lt;BR /&gt;I want to put the output to a variable.&lt;BR /&gt;I tried many ways, it doesn't work&lt;BR /&gt;it told me @old_data isnot defined.&lt;BR /&gt;&lt;BR /&gt;Thanks advanced&lt;BR /&gt;&lt;BR /&gt;(@deal_id  int)&lt;BR /&gt;AS begin&lt;BR /&gt; create table #dealdiff&lt;BR /&gt; (tablename varchar(30), &lt;BR /&gt;  fieldname varchar(30), &lt;BR /&gt;  old_data varchar(30), &lt;BR /&gt;  new_data varchar(30))&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; declare @name varchar(30),&lt;BR /&gt;  @buffer varchar(200),&lt;BR /&gt;  @new_data varchar(30),&lt;BR /&gt;  @old_data varchar(20)   &lt;BR /&gt; select @name='deal_id'&lt;BR /&gt; select @name&lt;BR /&gt;&lt;BR /&gt; select @buffer = 'select @old_data='+'convert(varchar(12),' + @name +') from trading..deal where deal_id =' + convert (varchar(12),@deal_id)&lt;BR /&gt; select @buffer &lt;BR /&gt; exec (@buffer)&lt;BR /&gt; select @old_data &lt;BR /&gt;end&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Jun 2002 12:32:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754436#M835321</guid>
      <dc:creator>Catherine_3</dc:creator>
      <dc:date>2002-06-28T12:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic sql for sybase 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754437#M835322</link>
      <description>Hi all,&lt;BR /&gt;Why nobody give me feedback ?</description>
      <pubDate>Fri, 28 Jun 2002 13:43:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754437#M835322</guid>
      <dc:creator>Catherine_3</dc:creator>
      <dc:date>2002-06-28T13:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic sql for sybase 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754438#M835323</link>
      <description>11.0 is rather old, perhaps no participants on the list are using it.  Have you check Sybase's web site to see if 11.0 supports dynamic sql?  You may need to upgrade to 11.5 or 12.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark</description>
      <pubDate>Fri, 28 Jun 2002 15:38:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754438#M835323</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-06-28T15:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic sql for sybase 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754439#M835324</link>
      <description>So how about Sybase 12?&lt;BR /&gt;How to write it ?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 28 Jun 2002 15:44:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754439#M835324</guid>
      <dc:creator>Catherine_3</dc:creator>
      <dc:date>2002-06-28T15:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic sql for sybase 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754440#M835325</link>
      <description>Sybase did not support dynamic SQL until 12.0.  There are still some limitations.  I quit being directly involved in Sybase at 11.9.2 or so.  There are a few work-arounds you can use with any version of Sybase:&lt;BR /&gt;&lt;BR /&gt;1.  Use one stored procedure to generate the SQL you need to exeucte, save that in a temporary file, and execute the file.  This is easy to do with isql.&lt;BR /&gt;&lt;BR /&gt;2.  Any client-side application can create and execute dynamic SQL.  It's static by the time the server sees it.  The least painful way is probably in Perl using the sybperl module.  You can also use C/C++ with CtLib or Java and JDBC.&lt;BR /&gt;&lt;BR /&gt;If you really have to do this in a stored procedure, check out the 12.0 documentation.</description>
      <pubDate>Sat, 29 Jun 2002 04:29:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamic-sql-for-sybase-11-0/m-p/2754440#M835325</guid>
      <dc:creator>Mark Seaman</dc:creator>
      <dc:date>2002-06-29T04:29:04Z</dc:date>
    </item>
  </channel>
</rss>

