SQL file not working in Oracle

I cannot get all my tables to work in Oracle, can anyone see where i'm going wrong?
CREATE TABLE Property
(Property_Num CHAR (4) PRIMARY KEY,
Property_Address CHAR (25),
Property_City CHAR (15),
Property_State CHAR (2),
Property_Zip CHAR (5),
Property_Price DECIMAL (15,2),
Property_Type CHAR (15));
CREATE TABLE Owner
(Owner_Num CHAR (3) PRIMARY KEY,
Property_Num CHAR (4),
Owner_Name CHAR (15),
Owner_Telephone CHAR (15));
CREATE TABLE Inspection
(Inspection_Code CHAR (4) PRIMARY KEY,
Inspection_Type CHAR (20),
Inspection_Description CHAR (30),
Owner_Num CHAR (3),
Inspection_Date DATE (15));
CREATE TABLE Realtor
(Realtor_Num CHAR (2) PRIMARY KEY,
Inspection_Code CHAR (4),
Realtor_Name CHAR (30),
Realtor_Telephone CHAR (15));
INSERT INTO Property
VALUES ('0001', '245 Benner St', 'Philadelphia', 'PA', '19111', '152.000.00', 'Townhome');
INSERT INTO Property
VALUES ('0002', '327 Silver Ave', 'Willow Grove', 'PA', '19090', '260.000.00', 'Duplex');     
INSERT INTO Property
VALUES ('0003', '9243 Treaty Rd', 'Philadelphia', 'PA', '19114', '190.000.00', 'Single Family');
INSERT INTO Property
VALUES ('0004', '225 Chestnut St', 'Philadelphia', 'PA', '19103', '245.000.00', 'Condo');
INSERT INTO Property
VALUES ('0005', '511 Franklin Ave', 'Cherry Hill', 'NJ', '08002', '225.000.00'', 'Single Family');
INSERT INTO Owner
VALUES ('101', '0001', 'John Smith', '267-333-4667');
INSERT INTO Owner
VALUES ('102', '0002', 'Joe Taylor', '215-657-2200');
INSERT INTO Owner
VALUES ('103', '0003', 'Debra Jones', '215-745-9087');
INSERT INTO Owner
VALUES ('104', '0004', 'Frank Martin', '267-457-9300');
INSERT INTO Owner
VALUES ('105', '0005', 'Drew Hunt', '856-908-3200');
INSERT INTO Inspection
VALUES ('1001', 'Pre-Listing Check', 'Passed all eight tests', '101', '2/16/10');
INSERT INTO Inspection
VALUES ('1002', 'Walk-In', 'Property up to date on requirements', '102', '3/11/10');
INSERT INTO Inspection
VALUES ('1003', 'Appointment', 'All checks upo to date', '103', '1/15/10');
INSERT INTO Inspection
VALUES ('1004', 'General Check', 'Property is in good shape to sell', '104', '3/14/10');
INSERT INTO Inspection
VALUES ('1005', 'Request', 'Everything requested is up to date', '105', '2/22/10');
INSERT INTO Realtor
VALUES ('01', '1001', 'Tim Simpson', '267-543-2267');
INSERT INTO Realtor
VALUES ('02', '1002', 'Bill Bradley', '215-754-2330');
INSERT INTO Realtor
VALUES ('03', '1003', 'Phil Harris', '215-742-6687');
INSERT INTO Realtor
VALUES ('04', '1004', 'Sam Brown', '267-277-5500');
INSERT INTO Realtor
VALUES ('05', '1005', 'April Young', '856-228-3550');

I changed everything, can someone please check these tables in Oracle. I am in school with no access to Oracle.
CREATE TABLE Property
(Property_Num CHAR (4) PRIMARY KEY,
Property_Address CHAR (25),
Property_City CHAR (15),
Property_State CHAR (2),
Property_Zip CHAR (5),
Property_Price DECIMAL (15,2),
Property_Type CHAR (15));
CREATE TABLE Owner
(Owner_Num CHAR (3) PRIMARY KEY,
Property_Num CHAR (4),
Owner_Name CHAR (15),
Owner_Telephone CHAR (15));
CREATE TABLE Inspection
(Inspection_Code CHAR (4) PRIMARY KEY,
Inspection_Type CHAR (20),
Inspection_Description CHAR (40),
Owner_Num CHAR (3),
Inspection_Date DATE );
CREATE TABLE Realtor
(Realtor_Num CHAR (2) PRIMARY KEY,
Inspection_Code CHAR (4),
Realtor_Name CHAR (30),
Realtor_Telephone CHAR (15));
INSERT INTO Property
VALUES ('0001', '245 Benner St', 'Philadelphia', 'PA', '19111', 152.00, 'Townhome');
INSERT INTO Property
VALUES ('0002', '327 Silver Ave', 'Willow Grove', 'PA', '19090', 260.00, 'Duplex');
INSERT INTO Property
VALUES ('0003', '9243 Treaty Rd', 'Philadelphia', 'PA', '19114', 190.00, 'Single Family');
INSERT INTO Property
VALUES ('0004', '225 Chestnut St', 'Philadelphia', 'PA', '19103', 245.00, 'Condo');
INSERT INTO Property
VALUES ('0005', '511 Franklin Ave', 'Cherry Hill', 'NJ', '08002', 225.00, 'Single Family');
INSERT INTO Owner
VALUES ('101', '0001', 'John Smith', '267-333-4667');
INSERT INTO Owner
VALUES ('102', '0002', 'Joe Taylor', '215-657-2200');
INSERT INTO Owner
VALUES ('103', '0003', 'Debra Jones', '215-745-9087');
INSERT INTO Owner
VALUES ('104', '0004', 'Frank Martin', '267-457-9300');
INSERT INTO Owner
VALUES ('105', '0005', 'Drew Hunt', '856-908-3200');
INSERT INTO Inspection
VALUES ('1001', 'Pre-Listing Check', 'Passed all eight tests', '101', to_Date('2/16/10','mm/dd/yyyy'));
INSERT INTO Inspection
VALUES ('1002', 'Walk-In', 'Property up to date on requirements', '102', to_Date('3/11/10','mm/dd/yyyy'));
INSERT INTO Inspection
VALUES ('1003', 'Appointment', 'All checks upo to date', '103', to_Date('1/15/10','mm/dd/yyyy'));
INSERT INTO Inspection
VALUES ('1004', 'General Check', 'Property is in good shape to sell', '104', to_date('3/14/10','mm/dd/yyyy'));
INSERT INTO Inspection
VALUES ('1005', 'Request', 'Everything requested is up to date', '105', to_date('2/22/10','mm/dd/yyyy'));
INSERT INTO Realtor
VALUES ('01', '1001', 'Tim Simpson', '267-543-2267');
INSERT INTO Realtor
VALUES ('02', '1002', 'Bill Bradley', '215-754-2330');
INSERT INTO Realtor
VALUES ('03', '1003', 'Phil Harris', '215-742-6687');
INSERT INTO Realtor
VALUES ('04', '1004', 'Sam Brown', '267-277-5500');
INSERT INTO Realtor
VALUES ('05', '1005', 'April Young', '856-228-3550');

Similar Messages

  • What will you do if any SQL is not working.in oracle 10g...apps 11.5.10.2

    What will you do if any SQL is not working. in oracle 10g....apps 11.5.10.2

    928714 wrote:
    yes sir.If you help me in answering my questions i wll be very thankful to you sir.
    tnx,I haven't a clue.
    As you have been advised in many of your posts, go study the documentation for whichever specific topic you are interested in.
    For me to answer your questions, I would need to go get that documentation.
    Then I would need to read that documentation.
    Then I would need to write a forum post that interprets what I think I learned from that documentation.
    It is so very much faster if YOU go do that instead of posting to a forum and expecting others to do it. You will remember what you study for a lot longer time if you teach yourself.

  • Downcasting In Object PL/SQL Does not Work in Oracle 10g 10.1.0.2

    create type one_t as object (
    x number, y date ) not final
    create type two_t under one_t()
    set serverout on
    declare
    super one_t;
    sub two_t := two_t(1, sysdate);
    begin
    super := one_t(1, sysdate);
    sub := new two_t(1, sysdate);
    dbms_output.put_line('sub ' || sub.x || ' ' || sub.y );
    select treat(super as two_t) into sub from dual;
    dbms_output.put_line('super ' || super.x || ' ' || super.y );
    if sub is null then
    dbms_output.put_line('stupid');
    end if;
    if sub is of (two_t) then
    dbms_output.put_line('stupid');
    end if;
    end;
    The Other Piece Does not Even Compile
    declare
    super one_t;
    sub two_t := two_t(1, sysdate);
    begin
    super := one_t(1, sysdate);
    sub := treat(super as two_t);
    dbms_output.put_line('sub ' || sub.x || ' ' || sub.y );
    select treat(super as two_t) into sub from dual;
    dbms_output.put_line('super ' || super.x || ' ' || super.y );
    if sub is null then
    dbms_output.put_line('stupid');
    end if;
    if sub is of (two_t) then
    dbms_output.put_line('stupid');
    end if;
    end;
    ORA-06502: PL/SQL: numeric or value error: cannot assign supertype instance to
    subtype
    ORA-06512: at line 6

    You need use correct type when you create object.
    Don't forget object in reality is a memory pointer,
    so what if you don't allocate correct memory in creation,
    you can't treat object as subtype.
    And meanwhile, it doesn't depend on Oracle version -
    your example doesn't work in 9.2.0.1 for example.
    SQL> declare
      2  super one_t;
      3  sub two_t := two_t(1, sysdate);
      4  begin
      5  super := two_t(1, sysdate);
      6  sub := treat(super as two_t);
      7  dbms_output.put_line('sub ' || sub.x || ' ' || sub.y );
      8  select treat(super as two_t) into sub from dual;
      9  dbms_output.put_line('super ' || super.x || ' ' || super.y );
    10  if sub is null then
    11  dbms_output.put_line('stupid');
    12  end if;
    13  if sub is of (two_t) then
    14  dbms_output.put_line('stupid');
    15  end if;
    16  end;
    17  /
    sub 1 08.06.05
    super 1 08.06.05
    stupid
    &nbsp
    PL/SQL procedure successfully completed.Rgds.

  • Downcasting in Object PL/SQL Does not Work in Oracle 10g Enterprise Edition

    create type one_t as object (
    x number, y date ) not final
    create type two_t under one_t()
    set serverout on
    declare
    super one_t;
    sub two_t := two_t(1, sysdate);
    begin
    super := one_t(1, sysdate);
    sub := new two_t(1, sysdate);
    dbms_output.put_line('sub ' || sub.x || ' ' || sub.y );
    select treat(super as two_t) into sub from dual;
    dbms_output.put_line('super ' || super.x || ' ' || super.y );
    if sub is null then
    dbms_output.put_line('stupid');
    end if;
    if sub is of (two_t) then
    dbms_output.put_line('stupid');
    end if;
    end;
    The Other Piece Does not Even Compile
    declare
    super one_t;
    sub two_t := two_t(1, sysdate);
    begin
    super := one_t(1, sysdate);
    sub := treat(super as two_t);
    dbms_output.put_line('sub ' || sub.x || ' ' || sub.y );
    select treat(super as two_t) into sub from dual;
    dbms_output.put_line('super ' || super.x || ' ' || super.y );
    if sub is null then
    dbms_output.put_line('stupid');
    end if;
    if sub is of (two_t) then
    dbms_output.put_line('stupid');
    end if;
    end;
    ORA-06502: PL/SQL: numeric or value error: cannot assign supertype instance to
    subtype
    ORA-06512: at line 6

    You need use correct type when you create object.
    Don't forget object in reality is a memory pointer,
    so what if you don't allocate correct memory in creation,
    you can't treat object as subtype.
    And meanwhile, it doesn't depend on Oracle version -
    your example doesn't work in 9.2.0.1 for example.
    SQL> declare
      2  super one_t;
      3  sub two_t := two_t(1, sysdate);
      4  begin
      5  super := two_t(1, sysdate);
      6  sub := treat(super as two_t);
      7  dbms_output.put_line('sub ' || sub.x || ' ' || sub.y );
      8  select treat(super as two_t) into sub from dual;
      9  dbms_output.put_line('super ' || super.x || ' ' || super.y );
    10  if sub is null then
    11  dbms_output.put_line('stupid');
    12  end if;
    13  if sub is of (two_t) then
    14  dbms_output.put_line('stupid');
    15  end if;
    16  end;
    17  /
    sub 1 08.06.05
    super 1 08.06.05
    stupid
    &nbsp
    PL/SQL procedure successfully completed.Rgds.

  • PL/SQL does not work in Oracle 8i Personal Edition

    I just installed Oracle 8i Personal Edition for Win 98. Everything works perfectly, except the PL/SQL.
    Then I tried to install Oracle 8i EM, but I always get the listener or adapter error. Even when I tried to start the listener from lsnrctl prompt, it gives me those errors. Anyone can help?

    You need use correct type when you create object.
    Don't forget object in reality is a memory pointer,
    so what if you don't allocate correct memory in creation,
    you can't treat object as subtype.
    And meanwhile, it doesn't depend on Oracle version -
    your example doesn't work in 9.2.0.1 for example.
    SQL> declare
      2  super one_t;
      3  sub two_t := two_t(1, sysdate);
      4  begin
      5  super := two_t(1, sysdate);
      6  sub := treat(super as two_t);
      7  dbms_output.put_line('sub ' || sub.x || ' ' || sub.y );
      8  select treat(super as two_t) into sub from dual;
      9  dbms_output.put_line('super ' || super.x || ' ' || super.y );
    10  if sub is null then
    11  dbms_output.put_line('stupid');
    12  end if;
    13  if sub is of (two_t) then
    14  dbms_output.put_line('stupid');
    15  end if;
    16  end;
    17  /
    sub 1 08.06.05
    super 1 08.06.05
    stupid
    &nbsp
    PL/SQL procedure successfully completed.Rgds.

  • SQL Plus not working in Oracle 8i personal edition

    I just installed Oracle 8i personal edition, went through all the steps. When I start SQL* Plus, I give it the SCOTT/TIGER combo, but when it tries to start up the database, it asks for another password, which I can't figurew out.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John Meyer ([email protected]):
    I just installed Oracle 8i personal edition, went through all the steps. When I start SQL* Plus, I give it the SCOTT/TIGER combo, but when it tries to start up the database, it asks for another password, which I can't figurew out.<HR></BLOCKQUOTE>
    Fixed the problem yesterday.
    null

  • Runtime.exec()  in Java not working in Oracle 10 Application Server

    Hi ,
    I am trying to call a .exe file which is in the Web Application folder .
    I am Using Process p = Runtime.exec("path to .exe file ")
    This code is working fine when used with JBOSS , but not working with Oracle Application server .
    Please tell me whether i need to do any chnages to make it work
    Thanks in advance .

    I ran a quick test with your code, I just had to make some small changes, and things work for me...
    I'm testing with JDeveloper 10g 10.1.3.2.0 ...
    The only thing I wonder is DBUser DBPass DBHost, those are not the actual values, correct?, neither they are environment variables?...
    In the server hosting your OAS, you should try running the whole CMD line from the start/run dialog ... make sure it works in that server ...
    Here is the code used in my test:
    In JSP:
      <%@ page import="runexepkg.*" %>
      <% 
      String msg = "";
      try
      RunEXE p = new RunEXE();
      msg = p.main1();
      catch(Throwable t)
         System.out.println("Exception Raised");
         t.printStackTrace();
      %>
      <%= msg %>In Java Class:
    package runexepkg;
    import java.sql.*;
    public class RunEXE
        String ss="";
        public String main1()
        try
            Runtime rt=Runtime.getRuntime();
            Process p = rt.exec("CMD /C start C:\\oraappserver\\j2ee\\WebGis\\applications\\PowerGis\\web\\WEB-INF\\classes\\GisProject\\cust_data_1.exe DBUser DBPass DBHost");
            System.out.println("Command has been executed");
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection con = DriverManager.getConnection("jdbc:oracle:thin:@DBHost:DBPort:orcl","DBUser","DBPass");
            System.out.println("Test Connection ========== "+con);
            Statement st = con.createStatement();
            ResultSet rs = st.executeQuery("SELECT SYSDATE FROM DUAL");
            if(rs.next())
                ss="Command has been executed - Database has been accessed";
            else
                ss="Command has been executed - Database was not accessed";
        catch(Throwable t)
            System.out.println("Exception raised, command has NOT been executed");
            ss="Exception raised, command has NOT been executed";
            t.printStackTrace();
        return ss;
    }Edited by: Rodolfo Ferrari on Jul 23, 2009 10:40 PM

  • Select * from tab is not working in oracle 10g

    select * from tab is not working in oracle 10g. But at the same time,
    select * from <<table>> is working.
    Please advise me.

    This works for me in 10.2.0.2
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select * from tab;
    TNAME                          TABTYPE            CLUSTERID
    LOAN_DETAIL                    TABLE
    PLAN_TABLE                     TABLE
    ...

  • Triggers not working in Oracle 9iAS

    The form triggers are not working in oracle 9i AS.
    My Application server has Linux operating system with oracle form/report server installed. I am able to upload the form
    in the client machine (using Internet Explorer Win98 OS). Also i can feed in the data but none of my triggers are working (WHEN BUTTON PRESSED and other validation triggers).
    Can anyone suggest what to do pls.
    Tnks in advance
    Rgds
    Manoj Philip
    [email protected]

    Well we've tested on Linux and the trigger do work - I remember two other postings on this forumn from prople with the same problem:
    Re: SQL Developer Necessities
    Re: About  EXPLAIN PLAN table
    In one case the problem was not re-compiling using f90genm.sh, in the other it was something to do with the Machine setup but I don't know what the final resolution was.
    The only other thing is to make sure that you are on a certified linux release for using with iAS e.g. Redhat Server 2.1 and Suse Enterprise server 7 and Untited Linux
    You can check the current certifications on Metalink.oracle.com

  • Unable to find ODI_SAmple_DATA.zip file to work with oracle profiling.

    I am unable to find ODI_SAmple_DATA.zip file to work with oracle profiling.Any help regarding profiling???Do i need to
    copy it from sw installation folder.?How profiling is different or related to odi data quality???Do we take source data twice -
    1) For ODI target load
    2)For profiling into entities.

    Try:
    http://www.oracle.com/technology/products/oracle-data-quality/pdf/oracledq_sample_data.zip
    and
    http://download.oracle.com/otn/nt/ias/101340/oracledq_sample_directory.zip
    Hope this helps.
    G

  • Table_From_Block Build-in Package is not working in Oracle 10G

    Hi
    Table_From_Block Build-in Package is not working in Oracle 10G
    Kindly advice..

    user648759 wrote:
    Hi
    Table_From_Block Build-in Package is not working in Oracle 10G
    Kindly advice..Provide a little more information. Forms version OS version, more information about your problem and question.
    --and explain what on earth Table_From_Block* mean's--
    Tony
    PS: TABLE_FORM_BLOCK is a built-in for internal use, usually auto generated by forms. For a moment I didn't get what that meant, need more coffee.
    Edited by: Tony Garabedian on Aug 29, 2008 12:39 PM

  • Force encryption on SQL Server not working?

    Hello Everyone,
    I'm running SQL Server 2008 64-bit. I've installed a self-signed cert on the box and set  "Force Encryption"  and restarted SQL server. 
    I setup a client machine to trust the authority of the cert installed on the server. When I connect to that SQL server from SSMS from a client machine and select the "encrypt connection" option in the client Connection properties, SSMS correctly complains
    that the cert on the server does not match the computer name I asked to log into . This is because, although the cert is trusted, the dns name dos not match the CN in the cert <- Perfect, exactly what I am expecting.
    When I connect to the same SQL server from the same client but  UNCHECK "encrypt connection" on the client, I'm able to login. Considering I've checked the "Force Encryption" on the server, the server should have rejected the connection. Why not?
    Ameer Deen

    Hi all,
    We are implementing a Merge Synchronization solution which involves three SQL Servers located on three Azure locations worldwide and one on-premises location. We need to secure communications between all servers. We are evaluating the encryption of all server
    communications through SSL:
    http://technet.microsoft.com/en-us/library/ms191192.aspx
    When we configure one server (let’s call it server A) to accept only encrypted connections (with Force Encryption=Yes) we still can connect from other server (let’s call it server B) that do not have the certificate installed. We would expect the server
    B to fail in the attempt of connect as server A should only accept encrypted communications and those should need the certificated to encrypt/decrypt everything (commands and data).
    We have also review the following forum post that is very similar to this one:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bde679d9-ff83-4fa7-b402-42e336a97106/force-encryption-on-sql-server-not-working
    In all cases the Microsoft answer is:
    “When the
    Force Encryption option for the Database Engine is set to YES, all communications between client and server is encrypted no matter whether the “Encrypt
    connection” option (such as from SSMS) is checked or not. You can check it using the following DMV statement”
    When we run the provided DMV statement to check if encryption is enabled:
    -- To check whether connections are encrypted between server and clients
    SELECT encrypt_option
    FROM sys.dm_exec_connections
    We get “TRUE”. So theoretically encryption is enabled.
    Then:
    Why can we run SQL statements against server A from server B (with SSMS) without any certificate?
    Are we wrong when we expect server A to refuse any client that do not have the right certificate?
    How can server B, without any certificate, decrypt the data encrypted by server A?
    Our intention is to encrypt all server in the same way so all of them will accept only encrypted communications. We are assuming that the Merge Agent will be able to communicate with the Publisher and the Subscriber through this encrypted environment. May
    anyone please confirm ti?
    Thanks for your help.
    Best Regards
    Benjamin Moles

  • Sql is not working after changing from MsAccess into sql server

    Following Sql  is not working after changing from MsAccess into sql server. 
    sum(trn.sales) as sales,
    sum(trn.cost) as cost,
    sales - cost as profit // Here is not working . can we not use sales a column. Please advise
    from trn
    Kind Regards
    pol
    polachan

    It will not work if use two different column from the table or column  from two  different table
    Example
    sum(trn.sales * trn.rate) as salesAmount,
    sum(trn.cost) as cost,
    sum(trn.salesAmount)-sum(trn.cost) as profit ----- Here is not working . can we not use sales a column. Please advise
    from trn
    Regards
    polachan

  • Sql developer not working which i got when i installed oracle 11g on win7

    Hi i successfully instaled my oracle 11g on windows 7,but when iam trying to use my sql developer chich i got by default with 11g is not working ..when i open it its asking me for "select the path of java.exe file" when i browse and given the right path .iits again giving me the same pop and not throughing any error msg at least.
    Could u pls help me out on this??

    Well, not supported does not necessarly mean does not work, but if you have problem, then your only way is to find a solution on your own or through other fellows who are doing the same.
    Anyway, you could ask your question in the SQL Developer dedicated forum, but again, you could have some unexpected issues by working on non-supported config :
    SQL Developer
    Nicolas.

  • Oracle 10g RAC SQL profiles not working for both the nodes

    We have identified a long running sql.
    Used Advisor to tune the sql
    Applied the suggested sql_profile as per the recommendation.
    when we re-run the sql from application, due to RAC setup the sql hit the other node, used the sql profile as indicated by v$sql but was long running.
    it generated a new sql_id due to which we think it was not working.
    Could you please advice how to apply sql_profile for both nodes?

    HI Arun
    Would you please post that in the GRID RAC section of this forum please ?
    Please consult the following documents to get support on your question:
    http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/votocr.htm#sthref211
    http://download.oracle.com/docs/cd/B19306_01/install.102/b14205/undrstnd.htm#RISOL2610
    Thanks

Maybe you are looking for