7 Replies Latest reply: Jan 25, 2011 4:56 AM by 834010 RSS

    Unable to upload sql scripts in oracle database express edition 10g

    745597
      Hi!

      To start, I inform you that I am beginner with Oracle. I installed Oracle 10g Express Edition on my Ubuntu 9.10 like this:

      :~$ dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb
      :~$ /etc/init.d/oracle-xe configure

      and I keep default value. Then I go on http://127.0.01:8080/apex, I login with system account, I create another dba account etc ... all looks very well ! Then I follow this tutorial: http://st-curriculum.oracle.com/tutorial/DBXETutorial/index.htm
      and I am unable to load sql script which is given in this tutorial: load_sample.sql (page:What to do first> Loading Data). I try with a little sql script and same result. I use gedit with UTF-8 and load in UTF-8, my browser is Firefox (I try with Epiphany also).

      The result is: when I upload a script, The browser returns "script uploaded." Then I can click on my script but the file is empty ! Nothing is done when i click on "run". Also I can' create a script; With Epiphany browser, the frame to write is all red. To import a script I have to copy one by one request in sql commands. I try also to change the owner of load_sample.sql:

      -rw-r--r-- 1 oracle dba 49969 2010-01-10 12:05 load_sample.sql

      But it doesn't work. If someone has an idea ? Thanks for your help.

      regards

      Alex.

      load_sample.sql:

      CREATE TABLE regions
      ( region_id NUMBER
      CONSTRAINT region_id_nn NOT NULL
      , region_name VARCHAR2(25)
      );

      CREATE UNIQUE INDEX reg_id_pk
      ON regions (region_id);

      ALTER TABLE regions
      ADD ( CONSTRAINT reg_id_pk
      PRIMARY KEY (region_id)
      ) ;
        • 1. Re: Unable to upload sql scripts in oracle database express edition 10g
          Toni Lazarin
          user8969962 wrote:
          Hi!
          But it doesn't work. If someone has an idea ? Thanks for your help.


          load_sample.sql:

          CREATE TABLE regions
          ( region_id NUMBER
          CONSTRAINT region_id_nn NOT NULL
          , region_name VARCHAR2(25)
          );

          CREATE UNIQUE INDEX reg_id_pk
          ON regions (region_id);

          ALTER TABLE regions
          ADD ( CONSTRAINT reg_id_pk
          PRIMARY KEY (region_id)
          ) ;
          As i am not aware how exactly the load process is done in the XE database web interface,
          my advice would be to load that sql script from the shell, as the result by this kind of load would be the same as it would be if it was done through the web interface. The goal is to create table regions, index on region_id and add constraint , right ?
          So, go to shell ,position yourself in the path where load_sample.sql is, login to the XE as the user with whom you need to run load_sample.sql , and execute
          @load_sample.sql.
          I think that should do it.
          • 2. Re: Unable to upload sql scripts in oracle database express edition 10g
            745597
            Yes it works with sqlplus, thanks ! But if someone has a solution to do the same job with the web interface, I am still interested.
            • 3. Re: Unable to upload sql scripts in oracle database express edition 10g
              767338
              I encountered the same problem, but when I used IE and it worked fine. (When I used Firefox, the screen were all red and sql scripts were not lined up properly)
              • 4. Re: Unable to upload sql scripts in oracle database express edition 10g
                TheOtherGuy
                I would post this question in iSQL forum or even better Oracle Database 10g Express Edition Forum instead of here.

                I ran the script on XE (runs on Win2003 server) in IE with no issues, I had identical issues you have in FireFox 3.6, I also tried Google Chrome and ran into similar issues as Firefox and I was not able to run the script.


                Here is IE, Firefox and Chrome side by side on exactly same page, as you can see only IE renders it correctly (sample.sql was first uploaded to the site, then opened in all three browsers)

                http://i41.tinypic.com/wspuli.jpg
                • 5. Re: Unable to upload sql scripts in oracle database express edition 10g
                  778991
                  I get those same results I thought it was something to do with browser javascript settings but still not able to figure it out..have any of you guys managed to identify the cause of this? If so please let me know. Thanks
                  • 6. Re: Unable to upload sql scripts in oracle database express edition 10g
                    763900
                    Hi,

                    So, go to shell ,position yourself in the path where load_sample.sql is, login to the XE as the user with whom you need to run load_sample.sql , and execute
                    +@load_sample.sql.+

                    Sorry to hijack this thread but I am having exactly the same problem in Ubuntu, it seems as if IE is the only browser that allows you to do this, but installing that in Ubuntu looks like a whole other world of pain I do not really want to get involved in at the moment.

                    I like the sound of just shortcutting the sql upload through the shell but I'm a beginner and I do not understand your comment well enough to implement it myself.

                    Could you please explain these in more granular layman's terms for someone who is unfamiliar with Linux syntax?

                    By 'Shell' do you mean the Terminal or the SQL Command Line? What exactly should I be typing in there to execute the sql?

                    I have saved the SQL file on my desktop (jon@jon-pc, it's a virtual Ubuntu machine on a Windows Vista host).

                    Thanks in advance

                    Jon
                    • 7. Re: Unable to upload sql scripts in oracle database express edition 10g
                      834010
                      Yes it works in IE but wanna know why it is not working in Firefox , and how can i run the same script in Firefox.