Results 1 to 2 of 2

Thread: Dynamic SQL

  1. #1
    Join Date
    Nov 2003
    Posts
    5

    Unanswered: Dynamic SQL

    Is it possible to write dynamic sql in Sybase 11.9.2 (or later versions) stored procedures?

    I know the following code works fine in MSsqlserver 6.5 or above.. Is there any way in sybase to pickup table (or columns) dynamically...

    declare @tablename varchar(40), @query varchar(255)

    select @tablename = 'mytable'

    select @query = 'select * from ' + @tablename

    select @query

    exec (@query)


    Thanks in advance..

  2. #2
    Join Date
    Nov 2003
    Location
    NYC
    Posts
    3

    Dynamic SQL

    This is not available in 11.9.x, but is in ASE 12.0 or later...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •