PLSQL - fail, cant get it work. PLEASE HELP

This is the sql: I am basically trying to loop through every table in a users schema and write a line in a file for all the columns it has:
repheader off
set echo off
set feedback off
set trimout on
set trimspool on
set verify off
set serveroutput on format wrap
DECLARE
CURSOR table_cur IS     SELECT DISTINCT table_name FROM dba_tab_cols WHERE owner = 'BATCH_AFTER' and not table_name like 'CB%' and not table_name like 'CE%' and not table_name like 'CF%'
and not table_name like 'CI%';
v_table          VARCHAR2(100);
v_col           VARCHAR2(100);
v_string VARCHAR2(32767);
file_name VARCHAR2(200);
out_file utl_file.file_type;
BEGIN
file_name := 'tables_to_check.txt';
out_file := utl_file.fopen('JOHAN',file_name, 'w');
v_string := 'select count(DISTINCT ';
FOR tab_rec IN table_cur
LOOP v_table := tab_rec.table_name;
EXIT WHEN table_cur%NOTFOUND;
DECLARE
     CURSOR table_col_cur IS
               SELECT DISTINCT a.column_name
               FROM dba_tab_cols a
               WHERE a.owner = 'BATCH_AFTER'
               AND a.table_name = v_table
               AND not a.column_name in ('O__EDN', 'O__KDN', 'O__EDX', 'O__KDX','O__KDXA', 'O__ST');
     BEGIN
          FOR tab_col_rec IN table_col_cur
          LOOP
          EXIT WHEN table_col_cur%NOTFOUND;
               v_col := RTRIM(tab_col_rec.column_name, ' ');
               v_string := v_string || v_col || '||' ;
          END LOOP;
     exception
     when others then
     DBMS_OUTPUT.put_line (v_table||v_col);
     END;
     v_string := RTRIM(v_string,'||');
v_string := v_string ||' from BATCH_AFTER.' ||v_table;
UTL_FILE.PUTF(out_file, v_string);
END LOOP;
UTL_FILE.FCLOSE(out_file);
exception
     when others then
     DBMS_OUTPUT.put_line (v_table||' ' ||v_col);
END;

Hello
I have review your code and i have rewritte it so you do not need those variables anymore, I hope that it will works for you
repheader off
set echo off
set feedback off
set trimout on
set trimspool on
set verify off
set serveroutput on format wrapDECLARE
out_file    UTL_FILE.file_type;
BEGIN
file_name := 'tables_to_check.txt';
out_file := UTL_FILE.fopen ('JOHAN', 'tables_to_check.txt', 'w');FOR tab_rec IN (SELECT DISTINCT table_name
FROM dba_tab_cols
WHERE owner = 'BATCH_AFTER'
AND NOT table_name LIKE 'CB%'
AND NOT table_name LIKE 'CE%'
AND NOT table_name LIKE 'CF%'
AND NOT table_name LIKE 'CI%')
LOOP
UTL_FILE.putf (out_file, 'select count(DISTINCT ');
FOR tab_col_rec IN (SELECT DISTINCT a.column_name
FROM dba_tab_cols a
WHERE a.owner = 'BATCH_AFTER'
AND a.table_name = tab_rec.table_name
AND NOT a.column_name IN
('O__EDN',
'O__KDN',
'O__EDX',
'O__KDX',
'O__KDXA',
'O__ST'
LOOP
UTL_FILE.put (out_file, RTRIM (tab_col_rec.column_name, ' ') || '||');
END LOOP;
UTL_FILE.put (out_file, ''''' from BATCH_AFTER.' || tab_rec.table_name);
UTL_FILE.new_line;
END LOOP;
UTL_FILE.fclose (out_file);
EXCEPTION
WHEN OTHERS
THEN
UTL_FILE.fclose (out_file);
DBMS_OUTPUT.put_line (SQLERRM);
END;

Similar Messages

  • My serach bar is gone. i cant get it back please help

    my search bar disappeared. I cant get it back please help

    The main search bar lives in the Toolbar, so the first question is to check that the Toolbar is being shown.
    http://chrisramsden.vfast.co.uk/13_Menus_in_Thunderbird.html
    http://www.ramsden.org.uk/5_Lost_toolbars.html
    http://www.ramsden.org.uk/6_I_cant_find_tools_options.html
    If you do have a Toolbar but no search box in it, then I'd next try adding it via the customization procedure.
    '''View|Toolbars|Customize'''
    then drag-and-drop the search box into place.

  • MS Azure - Can Logon says Free Trial Active But I cant get into portal , Please help ?

    Good Day all ,
    Last Week I subscribed to the free trial of MS AZURE ,
    created an account , used a credit crd , got confirmation from MS Azure,
    with link http://account.windowsazure.com
    I logged in and was able to go to portal no problem.
    Today I log in but cant get access to portal.
    Get I have no Subscription but when on Subscriptions it says Free Trial , Your free trial expires in 26 days.
    Please help
    Thanks
    Ciao

    Hello,
    I see that you are trying to log into the accounts portal. Please try logging into the management portal ( Old azure portal ) / Ibiza portal ( New Azure Portal ) using the below links.
    1. Management Portal https://manage.windowsazure.com
    2. Ibiza Portal https://portal.azure.com/ 
    https://account.windowsazure.com is an accounts portal,  only the account owner can login to the account for viewing the billing details etc.,
    Regards,
    Shirisha Paderu

  • Whenever i dial hash in last its always calling not requesting. i had upgraded to ios 7.   i cant get the balance please help me

    please help me.    whenever i dial hash i.e *1111#   insted of requesting its always calling.....

    Yes, I did.
    It restored everything [incl. photos] but phone contacts.
    And, after restoration the iOS was still 7.
    I tried twice but still no phone contacts.
    Please help me to get my phone contacts back!

  • Eaqsy question but cant get out. Please help

    Hey,
    for school i need to learn java. We have had some small projects but here i get stuck. Is there someone who van help me?
    There are 3 files below. 2 sub and 1 main.
    I need to connect the 2 with eachother and let the main display the info.
    Outcome, Lid@addbf1 needs to be Erik, what am i doing wrong??
    De titel van het boek is boeka en het is geschreven door auteura.
    De titel van het boek is boekb en het is geschreven door auteurb.
    De nieuwe titel van het boek is boekaa
    [email protected] class Boek {
    * (non-javadoc)
    private Lid lid;
    * Getter of the property <tt>lid</tt>
    * @return Returns the lid.
    public Lid getLid()
         return lid;
    * Setter of the property <tt>lid</tt>
    * @param lid The lid to set.
    public void setLid(Lid lid ){
         this.lid = lid;
    private String titel;
         private String auteur;
         private boolean isUitgeleend;
         private int hoeVaakUitgeleend;
         public Boek (String titel, String auteur) {
              this.titel = titel;
              this.auteur = auteur;
              this.isUitgeleend = false;
              this.hoeVaakUitgeleend = 0;
         public void setTitel (String titel) {
              this.titel = titel;
         public void setAuteur (String auteur) {
              this.auteur = auteur;
         public void setIsUitgeleend (boolean isUitgeleend) {
              this.isUitgeleend = isUitgeleend;
         public void setHoeVaakUitgeleend (int hoeVaakUitgeleend) {
              this.hoeVaakUitgeleend = hoeVaakUitgeleend;
         public String getTitel () {
              return titel ;
         public String getAuteur () {
              return auteur;
         public boolean getIsUitgeleend () {
              return isUitgeleend;
         public int getHoeVaakUitgeleend () {
              return hoeVaakUitgeleend;
    }Lid.java
    public class Lid {
    * (non-javadoc)
    private Boek boek;
    * Getter of the property <tt>boek</tt>
    * @return Returns the boek.
    public Boek getBoek()
         return boek;
    * Setter of the property <tt>boek</tt>
    * @param boek The boek to set.
    public void setBoek(Boek boek ){
         this.boek = boek;
    public Lid(String naam, String adres){
              this.naam = naam;
              this.adres = adres;
              this.aantalBoeken = 0;
    * (non-javadoc)
    private int aantalBoeken;
    * Getter of the property <tt>aantalBoeken</tt>
    * @return Returns the aantalBoeken.
    public int getAantalBoeken()
         return aantalBoeken;
    * Setter of the property <tt>aantalBoeken</tt>
    * @param aantalBoeken The aantalBoeken to set.
    public void setAantalBoeken(int aantalBoeken ){
         this.aantalBoeken = 0;
    * (non-javadoc)
    private String adres;
    * Getter of the property <tt>adres</tt>
    * @return Returns the adres.
    public String getAdres()
         return adres;
    * Setter of the property <tt>adres</tt>
    * @param adres The adres to set.
    public void setAdres(String adres ){
         this.adres = adres;
    * (non-javadoc)
    private String naam;
    * Getter of the property <tt>naam</tt>
    * @return Returns the naam.
    public String getNaam()
         return naam;
    * Setter of the property <tt>naam</tt>
    * @param naam The naam to set.
    public void setNaam(String naam ){
         this.naam = naam;
    BibAdmin.javapublic class BibAdmin {
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Boek a = new Boek ("boeka", "auteura");
              Boek b = new Boek ("boekb", "auteurb");
              Boek c = new Boek ("boekc", "auteurc");
              Boek d = new Boek ("boekd", "auteurd");
              System.out.println("De titel van het boek is "+a.getTitel()+ " en het is geschreven door "+ a.getAuteur()+ ".");
              System.out.println("De titel van het boek is "+b.getTitel()+ " en het is geschreven door "+ b.getAuteur()+ ".");
              a.setTitel("boekaa");
              System.out.println("De nieuwe titel van het boek is "+a.getTitel());
              Lid e = new Lid ("Erik", "Ronde weg");
              Lid f = new Lid ("Frank", "Vierkante weg");
              Lid g = new Lid ("Gert", "Ovale weg");
              Lid h = new Lid ("Henkjan", "Rechte weg");
              a.setIsUitgeleend(true);
              a.setHoeVaakUitgeleend(+1);
              e.setAantalBoeken(+1);
              a.setLid(e);
              e.setBoek(a);
              System.out.println(a.getLid());

    Hmm, i cant edit my post? well nvm, here it is again in correct code!
    I get this output., But in sted of Lid@addbf1 i need it to show Erik.
    De titel van het boek is boeka en het is geschreven door auteura.
    De titel van het boek is boekb en het is geschreven door auteurb.
    De nieuwe titel van het boek is boekaa
    [email protected]
    public class Boek {
    private Lid lid;
    public Lid getLid() {
         return lid;
    public void setLid(Lid lid ){
         this.lid = lid;
    private String titel;
         private String auteur;
         private boolean isUitgeleend;
         private int hoeVaakUitgeleend;
         public Boek (String titel, String auteur) {
              this.titel = titel;
              this.auteur = auteur;
              this.isUitgeleend = false;
              this.hoeVaakUitgeleend = 0;
         public void setTitel (String titel) {
              this.titel = titel;
         public void setAuteur (String auteur) {
              this.auteur = auteur;
         public void setIsUitgeleend (boolean isUitgeleend) {
              this.isUitgeleend = isUitgeleend;
         public void setHoeVaakUitgeleend (int hoeVaakUitgeleend) {
              this.hoeVaakUitgeleend = hoeVaakUitgeleend;
         public String getTitel () {
              return titel ;
         public String getAuteur () {
              return auteur;
         public boolean getIsUitgeleend () {
              return isUitgeleend;
         public int getHoeVaakUitgeleend () {
              return hoeVaakUitgeleend;
    }Lid.java
    public class Lid {
    private Boek boek;
    public Boek getBoek()
         return boek;
    public void setBoek(Boek boek ){
         this.boek = boek;
    public Lid(String naam, String adres){
              this.naam = naam;
              this.adres = adres;
              this.aantalBoeken = 0;
    private int aantalBoeken;
    public int getAantalBoeken()
         return aantalBoeken;
    public void setAantalBoeken(int aantalBoeken ){
         this.aantalBoeken = 0;
    private String adres;
    public String getAdres()
         return adres;
    public void setAdres(String adres ){
         this.adres = adres;
    private String naam;
    public String getNaam()
         return naam;
    public void setNaam(String naam ){
         this.naam = naam;
    }}BibAdmin.java
    public class BibAdmin {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Boek a = new Boek ("boeka", "auteura");
              Boek b = new Boek ("boekb", "auteurb");
              Boek c = new Boek ("boekc", "auteurc");
              Boek d = new Boek ("boekd", "auteurd");
              System.out.println("De titel van het boek is "+a.getTitel()+ " en het is geschreven door "+ a.getAuteur()+ ".");
              System.out.println("De titel van het boek is "+b.getTitel()+ " en het is geschreven door "+ b.getAuteur()+ ".");
              a.setTitel("boekaa");
              System.out.println("De nieuwe titel van het boek is "+a.getTitel());
              Lid e = new Lid ("Erik", "Ronde weg");
              Lid f = new Lid ("Frank", "Vierkante weg");
              Lid g = new Lid ("Gert", "Ovale weg");
              Lid h = new Lid ("Henkjan", "Rechte weg");
              a.setIsUitgeleend(true);
              a.setHoeVaakUitgeleend(+1);
              e.setAantalBoeken(+1);
              a.setLid(e);
              e.setBoek(a);
              System.out.println(a.getLid());
    }

  • First time Blackberry Used Pearl and can't get email working, please help

    I have been wanting to try a blackberry for a long time, and was waiting for the Bold, but i got an opportunity to try the Pearl for a good price. I am with ATT and got it today, have the plan, but when I put in the PIN and IMEI it is registered to someone else, so how do i set up my email account?
    ADDED:  I did get a blackberry.net email account created but the phone still has the other persons name listed below the icon and is linked to her, how do i change this?  Thanks again 
    Message Edited by cindyh on 08-17-2008 10:05 PM

    Hi and Welcome to the Forums!
    The reason you can't log in is that, when you had your carrier set up your GMail, they created a BIS account for you. Further, they created BIS credentials on that account -- which are then needed to access the BIS configuration screens even on the BB. You need those credentials. Contact whoever it is that set it up for you and have them tell you those credentials.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • My 7th gen ipod nano wil not show up on my laptop when I plug it in and neither will my brothers new ipad,they don't come up in my computher either and I've installed the new itunes twice but still no change,I really need to get this working,Please help

    I need help

    Thanks for a reply
    The cable that I'm using came with my 5th gen nano. The 6th gen Ipod shows that it's connected but the computer doesn't see it, so I don't think that it's the cable.
    I did try this before when looking at the troubleshooting guide and nothing happens. It just resets and then the Ipod screen tells me that it's connected to the computer. It still is unseen by Itunes and no where to be found in my computer.
    I don't have another computer to plug it into at the moment but I may be able to visit a friend that owns a decent PC in a few days. If that doesn't work out I will be getting a new lap top in a week and I'm hoping that it will work on that, but it won't be a Mac. So, let's say it works when I plug it into one of these computers, should I reset my Ipod from there or is there something else I should do?

  • HT5621 I Have followed all the steps and still cant remove iCloud to my existing account and add to the new one, the old email account was changed a year ago and cant get that email plus the password don't work please HELP!!

    I Have followed all the steps and still cant remove iCloud to my existing account and add to the new one, the old email account was changed a year ago and cant get that email plus the password don't work please HELP!

    Welcome to the Apple community.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7, or if you restore from a previous back up made before you changed your details.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID using your current password, you don’t need access to this address if it’s previously been used with your Apple ID, once you have saved these details enter the password as requested on your device and then turn off "find my phone".
    You should then change your Apple ID back to its current state, verify it once again, delete the iCloud account from your device and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    This article provides more information about Activation Lock.

  • I have problem with my wifi in 4 S, i cant connect to any wifi itried resetting network setting and reset all setting but the result was the same, its only keeps searching for wifi and cant find any, itried to use OTHER but also didnt work.please help me

    i have problem with my wifi in 4 S, i cant connect to any wifi itried resetting network setting and reset all setting but the result was the same, its only keeps searching for wifi and cant find any, itried to use OTHER but also didnt work.please help me???

    If Join was on then your home wi-fi must be set to Non-Broadcast.  If you did not set this up (maybe your provider did) then you will need to find the Network Name they used, and any password they used.  The SSID is Security Set ID and to see more try http://en.wikipedia.org/wiki/SSID .  Basically it is the name used to identify your router/network.  A lot of times the installer will leave it set as LinkSys, or Broadcom or whatever the manufacturer set it as for default.  Your best bet is to get whoever installed it to walk you through how they set it up, giving you id's and passwords so you can get in.  HOWEVER, if you are not comfortable with this (if you set security wrong, etc.) you would be well ahead of the game to hire a local computer tech (networking) to get this working for you.  You can also contact the vendor of your router and get help (if it is still in warranty), or at least get copies of the manuals as pdf files.  Sorry I can't give you more help, I hope this gives you an idea where to go from here to find more.

  • HT1338 Whenever I go to facetime on my macbook air it says call failed. My wifi is on, and so is my facetime. I tried turning it off , and back on but it's still not working please help.

    Whenever I go to facetime on my macbook air it says call failed. Both my WiFi and Facetime are connected. I tried turning my Facetime on, and off,yet it still does not work. please help.

    Hey Ekfree95,
    Thanks for the question, and great troubleshooting so far. The following article provides additional steps that may have to resolve your issue:
    FaceTime for Mac: Troubleshooting FaceTime
    http://support.apple.com/kb/TS4185
    Thanks,
    Matt M.

  • I cant access my ymail PLEASE HELP I can log into yahoo but cant get to mail? Think the words configure & rand flash in address bar

    I cant access my ymail PLEASE HELP I can log into yahoo but cant get to mail? Think the words configure & rand flash in address bar

    Hi Acrylik,
    Welcome to the Apple Support Communities!
    For assistance resetting your Apple ID password, please use the information in the following article. I understand you have already attempted to reset via email and security questions, but the article also includes a link to contact Apple support if necessary.
    If you forgot your Apple ID password
    http://support.apple.com/kb/HT5787
    Have a great day,
    Joe

  • HT201406 i have been having trouble my iphone 3gs doesn't work the slide to unlock is broken i have tired everything to get it open but it won't work please help me!

    i have been having trouble my iphone 3gs doesn't work the slide to unlock is broken i have tired everything to get it open but it won't work please help me!

    Basic troubleshooting steps are:  Restart, Reset, Restore,

  • I cant update Premiere Pro CC on Adobe Creative Cloud. Im getting impatient. Please help me.

    I cant update Premiere Pro CC on Adobe Creative Cloud. Im getting impatient. Please help me.

    A few customers reported a similar problem in this thread: http://forums.adobe.com/message/5847024#5847024.
    They reported getting an update error: U44M1P7. Are you getting the same error? Some other error?
    One of them reported that the cleaner tool here resolved his problems: http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

  • Flash player wont work please help

    I have flash player installed and recently no videos, for example youtube, will work on ANY browser. I have tried troubleshooting and resetting browsers and nothing has worked, I cant watch any videos, please help!
    It looks as if the videos keep restarting 2 or 3 times then crash altogether if that helps

    This is super weird, particularly because the ActiveX (for Internet Explorer), NPAPI (for Firefox) and PPAPI (for Chrome) browsers are all pretty different.  This is definitely not the normal pattern.
    Does *any* Flash content work?  Maybe something old like http://www.homestarrunner.com?  My guess is that it doesn't.
    I definitely need some more clues:
    - Operating System and Version
    - Browsers and Versions
    - Any anti-virus/anti-malware/firewall/save-flash-video-to-disk kind of stuff installed?
    - Any JavaScript blockers or privacy plug-ins that might block JavaScript from executing?
    My gut feel says reboot, Uninstall Flash Player | Windows, then download a fresh copy of Flash Player for Firefox and Internet Explorer by using each browser to go to http://get.adobe.com/flashplayer. 
    Hopefully that helps.

  • I have 4s iPhone , I download the iOS 7. Now the front receiver microphone is not working , please help me that how to fix the problem.

    I have 4s iPhone , I download the iOS 7. Now the front receiver microphone is not working , please help me that how to fix the problem.

    I live in South Africa, and I had the same problem with my iPhone 4.
    After weeks of frustration and swearing, I was in the process of restoring my phone to a previous iOS. To do that you need to turn the "Find my iPhone" option off, since i turned it off, my problem was solved. No need to repair anything or revert back to old iOS.
    ***** that i cant use Find my iPhone, but atleast i can use my phone.

Maybe you are looking for

  • Time Machine won't back up after system restore

    I just restored my system after a failure, and now Time Machine won't back up my hard drive. It gets about 40 out of 90 Gigabytes done, and then gives me an error message that just says that there was an error while backing up, and doesn't give any o

  • Can a report use the same session as a calling form?

    Hi, I am using Oracle Forms and Reports 6i. I am wanting to call a report from a form and open it in the same session. The form will insert information into a number of global temporary tables that the report will use to display the query information

  • Composite Application with a Task Flow and form created manually

    Hi, I'm using Oracle SOA Suite 11G and i'm trying to create a task form for a human task without using the auto generate wizards and i'm having trouble getting the form to show in BPM worklist. I have followed instructions in the developers guide to

  • I cannot quit iPhoto, shut down or restart my computer.

    I'm reluctant to force quite because I don't want to lose any photos. Can I do this without losing data? Or is there another solution?

  • Itunes 7.7 not recognizing iphone

    Hi everybody, it seems a common problem today, after upgrading. I've downloaded the 7.7, and when I tried to install, it was saying, that there was another installing process at the time, which was not true, after clicking few times, it worked. Then,