Results 1 to 9 of 9

Thread: Any way out ?

  1. #1
    Join Date
    Nov 2003
    Location
    India
    Posts
    114

    Unanswered: Any way out ?

    I want to see description of around 30 tables. These all tables have 1 word "CAMPAIGNS" in common . Do I need to use
    describe command for all 30 tables seprately . Is there some way out through which I Can do the reuired work by using some query.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    set verify off pause off feedback off heading off echo off pagesize 0
    spool abc123.sql
    select 'DESC ' || table_name
    from user_tables
    where table_name like '%CAMPAIGN%'
    /
    spool off
    set verify on pause on feedback on heading on echo on pagesize 0
    spool campaign.log
    @abc123.sql
    spool off
    exit

    Use SQL to write SQL & then run the new SQL.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2004
    Posts
    108
    SELECT 'DESC '|| object_name
    FROM all_objects
    WHERE owner = USER
    AND Object_Type = 'TABLE'
    AND object_name LIKE <<YourCriteria>>

    spool it ..... run it ....

  4. #4
    Join Date
    Feb 2004
    Posts
    108
    Originally posted by anacedent
    set verify off pause off feedback off heading off echo off pagesize 0
    spool abc123.sql
    select 'DESC ' || table_name
    from user_tables
    where table_name like '%CAMPAIGN%'
    /
    spool off
    set verify on pause on feedback on heading on echo on pagesize 0
    spool campaign.log
    @abc123.sql
    spool off
    exit

    Use SQL to write SQL & then run the new SQL.
    Exactly.

  5. #5
    Join Date
    Nov 2003
    Location
    India
    Posts
    114
    Have U Checked Ur query before posting the reply...

    I am not getting the required output . I am showing U result of this query. U can easily figure out wats happening from this output

    SQL> select 'DESC ' || table_name
    2 from user_tables
    3 where table_name like '%CAMPAIGN%'
    4 /

    'DESC'||TABLE_NAME
    -----------------------------------
    DESC CAMPAIGNS1
    DESC CAMPAIGNS2
    DESC CAMPAIGNS3
    DESC CAMPAIGNS4
    DESC CAMPAIGNS5

  6. #6
    Join Date
    Feb 2004
    Posts
    108

    and then I said, spool it ... run it !

  7. #7
    Join Date
    Feb 2004
    Posts
    108
    I suggest, anacedent's solution is best. You simple have to copy-paste it.

    Most folks can be led to .....

  8. #8
    Join Date
    Nov 2003
    Location
    India
    Posts
    114

    Thanx But ^#$^

    Thanx for Ur Reply . Its working . But frankly telling I m used to going to bed by 10 and it was already 12 when I read the answer and tried to implement it. Dats y a silly miss. May be Sleep Gods had taken control over mine mind.

    I M writing all this Coz Ur Last Comment-----

    Most Folks ------------- Did hurt me. I m Not like Dat.

  9. #9
    Join Date
    Jul 2003
    Posts
    2,296
    OR:
    PHP Code:
    break on TABLE_NAME skip 1

    SELECT 
      table_name
    ,
      
    column_name,
      
    data_type||'('||data_length||')'
    FROM 
      cols
    WHERE 
      table_name like 
    '%CAMPAIGN%'
    Last edited by The_Duck; 04-16-04 at 17:17.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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