Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: Dynamic Statement

    Hi All,

    How can I write dynamic statements in a stored procedure in Sybase Adaptive Server 12.5. In MS SQL I just use EXEC(statement).

    Thanks a lot for any response

    Arnold Rand Pablo

  2. #2
    Join Date
    Jun 2002
    Location
    Argentina
    Posts
    78
    Use "execute" to runs a dynamically constructed Transact-SQL command.

    exec[ute] (" string" | char_variable [+ " string" | char_variable]...)

    For example:

    USE master
    go
    DECLARE @cmd VARCHAR(30)
    SELECT @cmd = "select name from syslogins"
    EXEC ( @cmd )
    go

    Bye bye

    Sebastian

Posting Permissions

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