Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2002
    Posts
    162

    Unanswered: Quickest way to extract procedures

    I am trying to figure out a way to spool or extract all my procedures DDL
    without having to copy and paste each one,into an editor file.

    Thanks in advance for the help.

    I am using ASE 11.5

    'W

  2. #2
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    If you have perl then I suggest using dbschema.pl (http://www.midsomer.org).

    Michael

  3. #3
    Join Date
    Mar 2003
    Posts
    15

    Re: Quickest way to extract procedures

    Originally posted by Wale
    I am trying to figure out a way to spool or extract all my procedures DDL
    without having to copy and paste each one,into an editor file.

    Thanks in advance for the help.

    I am using ASE 11.5

    'W

    use sybase utility defncopy...

    you can write a select statement to create defncopy commands or get all object names and then write a awk

    HTH
    db_mate

  4. #4
    Join Date
    Jun 2002
    Location
    Argentina
    Posts
    78
    This is the dirty way !!
    You can try to make a select to "syscomments", but the trouble is that the code is split in rows.
    So I use this select into SQL Advantage :

    SELECT "#", text
    FROM syscomments,
    sysobjects
    WHERE sysobjects.id = syscomments.id
    AND type = "P"
    AND uid = user_id()
    ORDER by syscomments.id,
    syscomments.colid2,
    syscomments.colid


    and then replace with regexp like this " \n# " all the split lines (I use Textpad).

    Be carefull !!
    You must know that may be there is some store that need extra code to create temp tables before create the store.

  5. #5
    Join Date
    Mar 2002
    Posts
    162
    Originally posted by svelasco
    This is the dirty way !!
    You can try to make a select to "syscomments", but the trouble is that the code is split in rows.
    So I use this select into SQL Advantage :

    SELECT "#", text
    FROM syscomments,
    sysobjects
    WHERE sysobjects.id = syscomments.id
    AND type = "P"
    AND uid = user_id()
    ORDER by syscomments.id,
    syscomments.colid2,
    syscomments.colid


    and then replace with regexp like this " \n# " all the split lines (I use Textpad).

    Be carefull !!
    You must know that may be there is some store that need extra code to create temp tables before create the store.

    hehe thanks a lot man!

Posting Permissions

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