I was wondering how to use db2look to get the ddls of sequence.
db2look -d my_db_name -z my_proc_schema - I tried this but it is not showing any results.
Is there an option to directly mention the sequence name ?
You want to use the
-e option. That will export sequences along with a few other things. Depending on your sequences you could either use the
-z option for schema or the
-a option for all schemas. You may also want to use the
-o option to output to a file.
We tend to use the following a lot where I work
db2look -d my_db_name -e -o my_db_name_look.sql
EDIT: Based on the comments you have below, you can use db2look, or you could also use the system catalogs to retrieve what you need.
Why not run the following:
select seqschema,seqname from syscat.sequences where cycle = 'N'
That will retrieve those same sequences for you, but through querying and you won't have to use the db2look utility to retrieve everything you want. Of course if you want the DDL, you'd still have to use db2look to do that, but at least you can then use -z better to narrow down you schemas or do a search to find the names that came from your query.