How to create an object using sql*plus?

Hi,
I have tried to create an object , but after pressing enter key I could not get SQL command prompt or errors. How to come out from this? Could you help me to find what's wrong.
SQL> create type course as object(
2 course_no number(4),
3 title varchar(35),
4 credits number(1));
5
6
7
8
Thanks.

Put a slash "/" at the end of the command:
CREATE TYPE course AS OBJECT (
   course_no   NUMBER (4),
   title       VARCHAR (35),
   credits     NUMBER (1)
/

Similar Messages

  • How to create Entity objects using xml as a datasource

    Hi All,
    How to create EO(ADF Business components) using XML as a datasource instead of database tables..Pls do reply..Its an urgent requirement
    Thanks in Advance
    Edited by: 1000899 on Apr 25, 2013 12:01 AM
    Edited by: 1000899 on Apr 25, 2013 12:02 AM

    There is nothing 'urgent' in this forum. We are all volunteers spending our spare time helping out other users. If you have an urgent matter, you have to open an SR with sopport.oracle.com
    If it's urgent, then why don't you provide information needed to answer the question.
    Which jdev version do you use?
    What is the use case?
    To answer your question: A look into the docs http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcadvvo.htm#sm0341 and http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcadvvo.htm#sm0338 holds the answer to it.
    Timo

  • How to see Chinese data using SQL Plus?

    Hi,
    Is it possible to see the Chinese character string saved in the database by using English version Sql Plus? The following data is set up in the table NLS_DATABASE_PARAMETERS in my oracle database. I'm really appreciated if anybody could help me.
    Thanks,
    Suwei Ma
    [email protected]
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    PARAMETER VALUE
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_NCHAR_CHARACTERSET UTF8
    NLS_RDBMS_VERSION 8.1.7.4.1

    Thanks for your repley. I don't think I need to change NLS_CHARACTERSET setup because I can load Chinese data into the database and also can see the data by running Chinese tool like NJStar Communicator. Therefore, I probably need to change the session level parameters, but not sure.

  • How to pass value by using SQL*PLUS

    Dear all,
    I have a file (e.g. test.sql) and run in SQL*PLUS. The code like the following:
    set serveroutput on
    variable v_a number;
    variable v_b number;
    variable v_x number;
    :v_x := 12345;
    execute packagename.procedure(:v_x, :v_a, :v_b);
    print v_a;
    print v_b;
    Why it does not work??
    Thanks for any advice.
    Regrads.

    Test it:
    set ver off;
    set serveroutput on
    variable v_a number;
    variable v_b number;
    variable v_x number;
    accept v_a prompt 'Input value for v_a: '
    accept v_b prompt 'Input value for v_b: '
    accept v_x prompt 'Input value for v_x: '
    begin
      :v_a := &v_a;
      :v_b := &v_b;
      :v_x := &v_x;
    end;
    print v_a;
    print v_b;
    print v_x;

  • How to create updateable resultset using sql with "order by"

    Dear all,
    I'm using the Derby database to hold a table of stock prices. After the table is populated, I want to do some calculations and store the result in a column.
    I get the resultset using the following code
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery(select history_id, value, days from history where ticker = '" + ticker + "' order by value_date"); {code} When I then try to update the "days" field, I get an SQLException telling me that the resultset is not updatable. However, if I remove the "order by" clause, I am able to update the data, but then my algorithm does not work as I need to traverse the data in a specific order. The quesion is: how do I create an updatable resultset using a sql-statement with an order by clause? Kind regards Karl Martin Lund                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    jschell wrote:
    Seems rather obvious to me that the exception specifically tells you that you can't do that.OP: I would guess it's because ORDER BY forces the database to read all the result rows into a temporary area, sort them, and then return them from this temporary area, as opposed to streaming the results. The extra step probably makes updateable result sets more difficult (or maybe not possible), so they opted not to do it.

  • How to create a database using SQL Developer

    Hallo,
    I am a user of OpenSUSE 11.4 and have Oracle database install in my system. I was reading this page regarding on creating a database. But I don't know how to launch DBCA in my system. May I know how can I launch DBCA in OpenSUSE 11.4?
    THanks @!

    user4994079 wrote:
    Hallo,
    I am a user of OpenSUSE 11.4 and have Oracle database install in my system. I was reading this page regarding on creating a database. But I don't know how to launch DBCA in my system. May I know how can I launch DBCA in OpenSUSE 11.4?
    THanks @!You'd launch it in exactly the manner in which your cited reference says:
    --- begin quote ---
    by entering the following on the UNIX command line:
    dbca
    --- end quote ---
    Of course the documentation assumes you've completed the first five minutes of Computer Admin 101 and so realize you should include the directory that has the executabale file. In this case, your PATH should include $ORACLE_HOME/bin
    So, what have you tried? What result did you get?
    And why are you citing a reference for a old, unsupported version of Oracle?
    And why the reference to SQL Developer in your subject line? This has nothing to do with SQL Developer.
    Edited by: EdStevens on Apr 16, 2011 9:15 PM

  • Debugging procedure or packages using sql*plus reg

    Dear all,
    I am new to oracle, can any body provide me some information related to this below issues.
    a) suppose i have created a procedure using sql*plus tool then next day i wanted to debug or modify my stored procedure.
    Then what could approach using sql*plus
    b) same case if we consider for packages then for any specific stored procedure or functions what would be the approach to debug or modify using sql*plus
    yours cordination will be highly appreciate
    Thanks n regards
    Laxman

    Using SQL*Plus you can debug your stored pl/sql code only adding some "prints" in your code:
    SQL> create or replace procedure test is
      2  begin
      3  dbms_output.put_line('starting...');
      4  --do something here
      5  dbms_output.put_line('done step 1');
      6  --do something else here
      7  dbms_output.put_line('end procedure...');
      8  end;
      9  /
    Procedura creata.
    SQL> set serverout on
    SQL> exec test
    starting...
    done step 1
    end procedure...
    Procedura PL/SQL completata correttamente.Or writing logs in a log table:
    SQL> create table logtab(ts timestamp(9),mess varchar2(4000));
    Tabella creata.
    SQL> create or replace procedure test is
      2  begin
      3  insert into logtab values(systimestamp,'starting...');
      4  --do something here
      5  insert into logtab values(systimestamp,'done step 1');
      6  --do something else here
      7  insert into logtab values(systimestamp,'end procedure...');
      8  end;
      9  /
    Procedura creata.
    SQL> exec test
    Procedura PL/SQL completata correttamente.
    SQL> col ts for a40
    SQL> col mess for a40
    SQL> select * from logtab;
    TS                                       MESS
    25-DIC-09 15:33:13,656000000             starting...
    25-DIC-09 15:33:13,656000000             done step 1
    25-DIC-09 15:33:13,656000000             end procedure...Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com]

  • How to create an object of our own class by using Class.forName()??

    how to create an object of our own class by using Class.forName()??
    plzz anser my qustion soon..

    Class.forName does not create an object. It returns a reference to the Class object that describes the metadata for the class in question--what methods and fields it has, etc.
    To create an object--regardless of whether it's your class or some other class--you could call newInstance on the Class object returned from Class.forName, BUT only if that class has a no-arg constructor that you want to call.
    Class<MyClass> clazz = Class.forName("com.mycompany.MyClass");
    MyClass mine = clazz.newInstance();If you want to use a constructor that takes parameters, you'll have to use java.lang.reflect.Constructor.
    Google for java reflection tutorial for more details.
    BUT reflection is often abused, and often employe when not needed. Why is it that you think you need this?

  • Create database table using Forms Developer 6/6i without using SQL*Plus

    hello there,
    I need help in creating tables in Oracle using Forms Developer 6/6i without using SQL*Plus interface.
    your help is appreciated
    email: [email protected]

    please use Forms_ddl package to create a table dynamically
    from the Developer6/6i.
    you can check the success or failure by using the
    form_success builtin.
    if u want to avoid using the Forms_ddl package
    use stored procedure or create a sql querry record group.
    regards
    sriram.

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

  • How to Create Resource Object in OIM through SQL queries or OIM APIs

    Hello,
    I have to create few (100) resource Objects in OIM. I was creating manually through Design console one by one. In future we might need to create many more Resource Objects .It takes lot of time if we do it through Manually.
    Is there any possiblity we can create Resource Objects through SQL query or OIM APIs ???
    Thanks!!

    Yes. I do it all the time.
    If you are using 11G 11.1.1.3
    Go here
    http://fredforester.org/code/xmlstarters/
    Download the files.
    RESCFORM.xml is an example resource built from the template
    buildtemplate.sh is a shell script that creates a resource from the template
    index.php - you dont need this
    templateresource.xml - this is the template resource. it was created by building a simple resource with all its basic tasks and components then editing it and renaming things so I can find them with sed
    to create Resource C you would
    ./buildtemplate.sh RESCFORM "Resc Resource" "Resc Process"
    you would end up with a file called RESCFORM.xml where when imported would have
    UD_RESCFORM
    Resc Resource Resouce Defintion
    Resc Process Process Defition with basic tasks pointing to a dummy adapter.
    You can optionally create your own prepop so it will get assigned to the form when you import.
    Good luck

  • How to retreive this file in SQL*Plus

    If I upload files which name is KOREAN, name of files is invisible.
    I dont't know cause of this problem.
    How is keeping korean name of file from breaking?
    Also, answer how to retreive this file in SQL*Plus
    Thanks
    silverbell

    To access ifs data from SQL, you need to (officially) setup a 'user view'. Refer to the Java API documentation on how to do this. Once you have created the user view, then you may access this view using any SQL tool.

  • Reg: How to create shipment by using delivery...

    HI all,
    How to create shipment by using delivery...
    Thanks

    Hi Jamie:
    Thank you for your help.
    Could you please tell me what is "SQL*Plus session"?
    I modified the code into:
    Statement Stmt = Conn.createStatement();
    Stmt.executeUpdate("CREATE VIEW csclass AS SELECT * FROM CSGRADE10");
    The error message is the same:
    SQLException: Error during query: Unexpected Exception: java.sql.SQLException message given: Syntax error or access violation: You have an error in your SQL syntax near 'VIEW csclass AS SELECT * FROM CSGRADE10' at line 1
    SQLState: S1000
    VendorError: 0
    I am using MySQL.
    Jack

  • How to create CATALOG with MS SQL Server?

    Connection class has getCatalog(strCatalog) method. In order to use it, we must create CATALOG in Database?
    How to create CATALOG with MS SQL Server?
    Help me, please!!!

    You do not create these for any database, this is part of the Connection metadata.
    The Catalog is the third level of table-like database object qualification as in "Catalog.Schema.Table". For SQLServer the qualification scheme is "Database.Owner.Table" and I would be surprised if they reported anything for the current connections getCatalog() method call.
    What many people do is avoid table qualification altogether by setting the connection's context in a database proprietary manner and then keeping the SQL as clean as possible. For many ODBC and JDBC drivers this can be set in the configuration. For MS SQLServer you can also execute a "USE dbname" statement on the connection to avoid table qualification.

  • How to create good object model?

    Does anybody know how to create good object model?
    Again and again I have to create different object models in various projects. I have to solve a lot of problems.
    - Define all entities
    - Create objects for it
    - Define relations (ususlly i use SQL Databases)
    - Define methods to load/edit/save/delete entities.
    - Define methods to search and featch set of entities
    - Define events for entities (fired when it change)
    - the biggest problem is the events for collections. If i got the collection of entities for filter [FirstName = 'Sam'] i want to recieve event NewEntityAdded(), when new entity with FirstName='Sam' is created. But i want not to recieve event when that new entity's FirstName = 'Jack'.
    Do anybody know good book or set of articles for such a questions?

    Hi Facedown12,
    Does the issue resolved based on the Tatynan's suggestion? If the issue persists, please post the detail information about
    your issue, so that we can make further analysis.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • E72 IMAP email sent items sync broken - Tech Suppo...

    After a frustrating 30 mins on the phone with a level 2 tech support and being fobbed off with an unnecessary patch for MfE I emailed tech support "i have an imap email account with GMX set up on my e72 using nokia messaging.  it sends and receives e

  • NullPointer thrown with Applet.getParameter()?

    Alright, I've got this error that's been driving me crazy, and knowing me, it's something small that I'm overlooking, so I'd like to apologize in advance for the fact that this is probably something very basic that I'm neglecting. I'm writing an Appl

  • Speech bubbles in Muse

    Hi, I'm designing my site in Muse. A main feature will be interviews. I'll be designing a jpeg background, with name of interviewee seperately designed at the top - do I need to merge these as 1 in PS or can I layer in Muse? But my main question, is

  • How do I disable auto-smooth in CS6?

    Whenever I make a stroke, it autosmooths is, HELP!!

  • Open suse 11.2 or 11.3 on G530 ?

    Hi, Has anyone tried Open suse 11.2 or 11.3 on G530 ?. Any suggestions ? Many thanks Moderator edit: Added detail to subject.