How to insert in a table column

Hi all

How can I insert in a table column


create table test (det varchar2 (2));

In this table, I want to insert & symbol.

How can I insert & inthi symbol table.


Thank you

Franck wrote:

SQL>set scan off;
SQL>insert into test values ('Add&Symbol');

Sqlplus ORACLE asked not to enter the value.

SET SCAN OFF is obsolete...

http://download.Oracle.com/docs/CD/B19306_01/server.102/b14357/APC.htm

Tags: Database

Similar Questions

  • How to perform an addition of column values in an insert query that would insert in the 3rd column, and the values how to insert into another table.

    I have two tables (2) RESULT TAB (1)

    CREATE TABLE TAB

    (

    NUMBER OF SNO

    A NUMBER,

    B THE NUMBER.

    NUMBER OF THE SUM

    );

    CREATE AN ARRAY OF RESULT

    (

    NUMBER OF SNO

    NUMBER OF THE SUM

    )

    my doubt is:

    (1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.

    SNO   A  SUM           

    1 100 150 250

    2 300 100 400

    I want to like this, it is possible with single insert query?


    (2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?

    in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem

    First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.

    Second, you might solve your problems with bind variable:

    Insert tab

    (sno, a, b, sum)

    values

    (: SNO,: A: B: A + B :))

    You should not use sum as column name because it is a reserved word.

    More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:

    Start

    insert into tab values (: SNO,: A: B: A + B :);)

    insert into result values (: SNO,: A + B :);)

    end;

    If you meet sno from a sequence, you could do something like this:

    Start

    insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.

    insert into result values (: SNO,: A + B :);)

    end;

    Hope that helps,

    dhalek

  • [11g] ORA-31061/ORA-19202 - how to insert data xmltype table/validation of the schema (just well formed)

    Hello

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Here's the demo program:

    ==============================

    create a global temporary table GTT_Test(data xmltype) validation delete rows;

    - and run this

    declare

    v_data xmltype.

    Start

    -It does not work

    /*

    v_data: = xmltype ("< itf:meta > < node / > < / itf:meta > '");

    */

    - but it works

    v_data: = xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1);

    - but try to insert into the table in the same way fails again:

    insert into GTT_Test (data)

    values (xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1));

    end;

    ==============================


    It translates errors ORA above and suspicion: "prefix 'my' is not declared".


    I need to create the TWG somehow different to accept without diagram validation?


    -Thanks!


    Kind regards

    Frank

    Hello.

    Try to declare to your XML namespace.

    for examplehttp://youaddress">

    "If you don't have a schema, try xmlns: my =" "(espace en blanc)."

  • How to insert in the table, the description of the table of the table

    Dear all,

    I need to take the description of the table of the table and I need to insert this description in a new column in the table, please help me how to write the query for the latter.
    Thanks in advance

    Louison P

    Looking for a way to extract the DDL and stored in another table?

    SQL> drop table dt;
    
    Table dropped.
    
    SQL> create table dt(x clob);
    
    Table created.
    
    SQL> insert into dt select dbms_metadata.get_ddl('TABLE', 'T') from dual;
    
    1 row created.
    
    SQL> select * from dt;
    
    X
    --------------------------------------------------------------------------------
    
      CREATE TABLE "TEST"."T"
       (    "X" NUMBER(*,0)
       ) PCTFREE 10 PCTUSED 4
    
    SQL>
    
  • How to insert data into tables using sql loops

    Oracle 10.2 g

    using Oracle sql * more

    Table amounts is
    create table student(id)
    as
    select distinct student_id
    from students_table;
    now
    desc student; will retrieve 
    
    student
    ======
    Name         Null?    Type
    ===========================
    ID                  VARCHAR2(10)
    Now create a sequence
    create sequence st_seq;
    alter table student add column no;
    select * from student
    
    no       id
    =========
            234
            298
    ..........
    This is the main part

    There are 100 student in the table

    now, I want to fill the table with sequences using seq.next_val

    How to use a loop to insert 100 auto generated numbers in the table.

    Thank you.

    Expected result
    Select * from student
    
    no     id
    =========
    1     234
    2     298
    .........
    Why I'm doing this instead of
    create table student(no,id)
    as
    select st_se.nextval,student_id
    from students;
    This will cause the duplication of the upn

    using separate throws an error.
    create table student(st_id,id)
    as select distinct st_seq.nextval,academicyear
    from student
    as select distinct st_seq.nextval,academicyear
    *
    ERROR at line 2:
    ORA-02287: sequence number not allowed here
    Thank you.

    Hello

    As you discovered, you cannot use SELECT DISTINCT and sequence. NEXTVAL in the same query.

    You can SELECT DISTINCT in a subquery, like this:

    CREATE TABLE     student
    AS
    WITH     distinct_ids     AS
    (
         SELECT DISTINCT     student_id     AS id
         FROM     students_table
    )
    SELECT     st_seq.NEXTVAL     AS st_id
    ,     id
    FROM     distinct_ids;
    
  • How to insert into DB tables of bean

    I want to insert in some custom tables of bean. How

    (1) get the connection?

    (2) can someone please give me the code?

    (3) how to engage? or the transaction AM will assign commit?

    (4) I intend to do so in the following manner, but I am getting error "getDBTransaction method not found" even if I imported all needed packages

     

      DBTransaction trans = getDBTransaction();

          CallableStatement statement = null;

          int rows = 0;   

          String plsql =

                " BEGIN "

              + " INSERT INTO EMPLOYEES "

              + " VALUES (?,?,?);"

              + " END; ";

           

          statement = trans.createCallableStatement(plsql, 3);

          try{

              statement.setInt(1, empName);

              statement.setInt(2, empId);

    statement.setInt(3, deptId); 

             rows = statement.executeUpdate();

    (5) I'm doing right thing by inserting Backing Beans? Ideally, I know we do h, but how I read AM screen values?

    All the world done this before? any help?

    Thank you

    Rahul

    Do not like that!

    I would do the following:

    -Create an entity object, then a view based on this object to insert lines.

    -Write an Application Module method that gets values that must be inserted as parameters. Get the VO, create a new line, set the values and insert the line.

    -To make this method available in the interface of the AM AM.

    -Create the binding of the method in the user interface.

    -Use this method within managed bean and run the validation using binding validation operation.

    I hope this helps.

    Kind regards

    Linda

  • How to capture value of table column-level changes using oracle 11g steamed

    How to capture the value of the column of table changes using oracle 11g steamed. (similar to the audit).
    Oracle made the steam would be the best way to do the same.
    Please notify. Please give me a code example.

    user4485803 wrote:
    How to capture the value of the column of table changes using oracle 11g steamed. (similar to the audit).
    Oracle made the steam would be the best way to do the same.
    Please notify. Please give me a code example.

    Look at the change data Capture

  • How to insert data with &amp; table...

    Hello

    I want to insert following data to the table

    SQL > insert into emp values ("company & co");

    Enter the value for co:
    How to avoid this?
    set define  off
    sql>insert into emp values('company & co');
    

    It will work

  • How to create a multiline table/column comment

    Can someone tell me how to create a multi-line table or a column comment?

    Apparently, the concatenation operator (|) does not work with the COMMENT statement.

    I tried to find the Oracle manuals and couldn't find an answer.
     
    COMMENT ON TABLE sometbl IS 'i would like to break up this comment into several lines in order to improve readability'; 
    Indeed, that's what I would do (but it does not work):
     
    COMMENT ON TABLE sometbl IS 
      'i would like to break up ' || CHAR(10) || 
      'this comment into several lines ' || CHAR(10) || 
      'in order to improve readability' || CHAR(10); 
    Oracle version is 10.2.0.4
    COMMENT ON TABLE sometbl IS
    'i would like to break up
    this comment into several lines
    in order to improve readability';
    
  • How can I retrieve the Table columns

    Dear everybody

    List the texts listed both necessary and recommended to ICT218 in semester 2 2010. The first should have required with a way to make the distinction between necessary and recommended. Thank you


    Select Mt10, RequiredText, RecommendedReading, name
    Book TEACHINGPERIOD, UNITOffering U
    Where (Mt10 = "ICT218") and (name = "Semester2");


    It did not work because it was not successfully completed. I think he needs a join somewhere.

    UnitOffering Table

    UnitOfID UnitTitle the period Mt10
    Vet006 Intro to Vet Vet432 20/01/10
    Fundamental mathematics MA004 20/01/10 MA164
    LEA011 Intro to legal studies 20/08/10 LEA765
    ICT001 Databses 20/08/10 ICT218
    Hu002 Introduction to the history of 20/01/10 HI154
    Phy003 Introduction to the physical Phy005 20/02/10
    LAW154 Intro to law 20/08/10 Law001
    PSY154 Introduction to psychology 20/08/10 PSY001
    ICT009 Principles of Computer Science 20/08/10 ICT104
    Bio007 Introduction to biology 20/08/10 BIO457
    Intro to Met008 to Met432 of Metalogy 20/08/10

    TeachingPeriod Table
    Name year StartDate teaching period
    S1 2010 17/02/10 S12010
    Q1 2010 T12010 23/03/10
    S2 2010 08/08/10 S22010
    Su1 2010 08/01/10 Su12010
    Su2 10/08/10 2010, Su22010
    Q2 2010 10/08/10 T22010
    S1 2011 S12011 20/02/11
    S2 2011 07/20/11 S22011
    T1 2011 03/20/11 T12011
    Q2 2011 08/20/11 T22011
    SU1 2011 SU12011 20/02/11
    SU2 2011 08/20/11 SU22011

    The Book table

    Number ISBN BookTitle author survey recommended
    9780321523068 database systems Connolly and Begg Yes No 2009 BBN345
    Malloy and history of Australia 8734512367845 Martin Yes No ABD265 2005
    4589565321987 great minds like Sheena Smith Yes No 2003 CAR789
    7653457609825 biggest atoms Kevin Smith Yes No 2004 ADE498
    3178765145789 Anatomy animal Linda Pearce Yes No 2008 EAT543
    5234569012345 math great don't Ken Morgon No Yes 2006 FET987
    6124537890124 what metals can do Brian Deed No Yes 2007 GAT621
    1543278954326 weird biology Shaun don't diet No Yes 2002 ABC123
    2567458906276 largest technology Fran day Yes 2001 ACN456
    0125678432167 worldwide system clear legal no dawn No Yes 2000 ANB367
    0003456789079 not best databases Ken Murray No Yes 2002 BBN345

    Published by: user9164240 on 10/29/2010 02:05

    Hello

    That's why you need the actual table scripts, as we do not know what are the types of columns

    Try something like this

    SELECT U.UNITCODE, B.BOOKTITLE,BO.RECOMMENDEDTEXTNO, BO.REQUIREDBOOKNO, TP.NAME
    FROM BOOK B, TEACHINGPERIOD TP, UNITOFFERING U, BOOKORDER BO
    WHERE U.UNITCODE ='ICT218' AND TP.TEACHINGPERIODID = 'S22010' AND BO.UNITOFFERINGID = U.UNITOFFERINGID AND B.ISBNNUMBER = BO.ISBNNUMBER
    

    see you soon

    VT

  • How to insert data in table form fields

    Hai

    My problem is

    Consider this as an example

    This is a table contains fields of teas

    empcode empname, barcode, timein, timeout...

    and I created a form and retrieve data from text file, that the fields are

    barcode, bardate, bartime

    so now, I need to write code to move my data in the table. Is that my form should be moved to this table if the table is empty, then we need to insert and if it is not null then update

    I tried a logic and give me some solutions and measures to solve


    declare
    pin_no varchar2 (25);
    pin_date varchar2 (25);
    date of pin_time;



    Start
    Select * from dailyattend1 where emplcode =: bar code;


    loop


    If timein not null then
    "Update dailyattend1 set = timein: bartime where emplcode = ': bar code."
    else timein is null then
    insert into dailyattend1 (timein) values(:bartime);



    end if;
    end loop;


    commit_form();


    What are the corrections to do tell me Pls...

    Concerning

    srikkanth. M

    srikkanth,

    Check your post previous order by clause

    Kind regards

    Manu.

  • How to insert collection, no table lines?

    I need to insert rows in a table to a collection, that are not in the table. For example, if the table has lines (1,1) and collection of the rows (1,1) and (2.1), then I need to insert (2.1) in the table. Here is the configuration.
    create table dt 
    ( id1 number not null
    , id2 number not null
    , constraint dt_pk primary key ( id1, id2 )
    );
    
    create or replace type dt_ot as object
    ( id1 number
    , id2 number
    );
    /
    create or replace type dt_ntt is table of dt_ot;
    /
    
    declare
      l_dt dt_ntt := dt_ntt();
    begin
      l_dt.extend(1);
      l_dt(1) := dt_ot(1,1);
      insert into dt
      select * from table( l_dt );
    end;
    /
    declare
      l_dt dt_ntt := dt_ntt();
    begin
      l_dt.extend(2);
      l_dt(1) := dt_ot(1,1);
      l_dt(2) := dt_ot(2,1);
      insert into dt
      select * from table( l_dt );
    end;
    /
    Here, the second insert fails due to violation of primary key.

    Thank you

    Sanjeev,

    What is your version of oracle, if its 10g, you can use following example as is.

    exec dbms_errlog.create_error_log('dt');
    
    DECLARE
       l_dt   dt_ntt := dt_ntt ();
    BEGIN
       l_dt.EXTEND (2);
       l_dt (1)   := dt_ot (1, 1);
       l_dt (2)   := dt_ot (2, 1);
    
       BEGIN
          INSERT INTO dt
             SELECT *
             FROM table (l_dt)
          LOG ERRORS INTO err$_dt ('error') REJECT LIMIT UNLIMITED;
       EXCEPTION
          WHEN OTHERS
          THEN
             DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 200));
       END;
    
       COMMIT;
    END;
    

    Concerning

  • How to insert a pdf or jpeg image into a column of type blob of a table

    How to insert a pdf or jpeg image into a column of type blob of a table

    Hello
    Try this

    Loading an image into a BLOB column and showing through OAS
    -------------------------------------------------------------

    The steps are:

    Step 1.
    -------

    Create a table to store BLOBs:

    create BLOB table objects
    (id VARCHAR2 (255),)
    blob_col blob
    );

    Step 2.
    -------

    Create a logical directory in the database to the physical file system:

    create or replace the MY_FILES directory as "c:\images";

    Step 3.
    -------

    Create a procedure to load the BLOB from the file system by using the logic
    Directory. Gif 'aria.gif' must exist in c:\images.

    create or replace procedure insert_img as
    f_lob bfile.
    b_lob blob.
    Start
    insert into BLOB ("MyGif", empty_blob()) values
    return blob_col in b_lob;

    f_lob: = bfilename ("MY_FILES', 'aria.gif');
    DBMS_LOB. FileOpen (f_lob, dbms_lob.file_readonly);
    DBMS_LOB. LoadFromFile (b_lob, f_lob, dbms_lob.getlength (f_lob));
    DBMS_LOB. FileClose (f_lob);
    commit;
    end;
    /

    Step 4.
    -------

    Create a procedure that is called via Oracle Application Server to display the
    image.

    create or replace procedure get_img as
    vblob blob.
    raw buffer (32000);
    buffer_size integer: = 32000;
    offset of an integer: = 1;
    length of number;
    Start
    owa_util.mime_header('image/gif');
    Select blob_col from vblob of blobs where id = 'MyGif. "
    Length: = dbms_lob.getlength (vblob);
    While offset< length="">
    DBMS_LOB. Read (vblob, buffer_size, offset, buffer);
    HTP. PRN (utl_raw.cast_to_varchar2 (buffer));
    offset: = offset + buffer_size;
    end loop;
    exception
    while others then
    HTP.p (SQLERRM);
    end;
    /

    Step 5.
    -------

    Use the PL/SQL cartridge to call the get_img procedure

    OR

    Create this procedure in function and call it your PL/SQL code for
    correctly place the images on your HTML page through the PL/SQL Toolbox.

    from a html form

    1. create an HTML form where the image will be. You too
    need the file MIME type.
    2. create a procedure receives the form parameters. The file field will be a Varchar2
    parameter, because you receive the path of the image is not the image itself.
    3 insert the image file into the table by using 'Create a directory NAME as chemin_image' and
    Then use ' insert into the TABLE (row, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval, '.
    EMPTY_BLOB() 'GIF' or 'JPEG') BLOB_OBJECT, in the variable_blob, back
    variable_consecutive.
    4 load the file into the table using:
    DBMS_LOB. LoadFromFile (variable_blob, variable_file_name, dbms_lob.getlength (variable_file_name));
    DBMS_LOB. FileClose (variable_file_name);
    engage.

    Kind regards
    Simma...

  • How can I get the chart inserted with "Senior officer" at the center inside a table column?

    I'm trying to insert graphics into the columns of the table using 'Frame' above, but the inserted chart, don't Center not within the column, such as the text of paragraph. Horizontal alignment settings seems to be ignored for the chart.

    I can solve this problem by changing the image containing the graph in the reference page, alternatively by changing the margins of cell parameter in the paragraph designer but neiter of these solutions is really good. I would like a solution that really centers the chart in the column of table not only simulates, as I like it to be compatible with the design of future changes in master pages, etc. of lika.

    Is there a nice way to fix this?

    It seems rather as if senior / lower frame is always aligned to the left. This isn't just a problem of Table. It does the same thing in ordinary text blocks.

    I worked in a store, at home, we knew as our column width (which was constant) and controlled the placement of art in affecting the graphic block of reference Page at the address named full column width, then precisely position the art to the breast.

    Were I faced with columns or cells of variable thickness, I had probably not use FA/FB, but rather a framework anchored in graphic design, anchored at the point of Insertion, to a specific tag para (say CellAnchor), which is centered. The NextPgfTag would be CellBody.

  • How to insert a BLOB column to a schema to another schema using proc of PL/SQL.

    Hello

    I want to know is there a simpler method to insert data of BLOB column in a table would like to insert into another table that is in a different schema.

    Table: TARGET (col1 number, varchar2 (100) col2, col3 BLOB) (SCHEME A)

    Table: SOURCE (col1 number, col2 varchar2 (100), col3 BLOB) (SCHEME B)

    I tried with the logic of following insertion.

    INSERT INTO < TAB2 > AS SELECT * FROM < TAB1 >;

    But the inset above has not copied the BLOB data, which are shwoing empty blob in the column in the target.

    Concerning

    Suresh

    Ask Tom how to reproduce one BLOB field to another

Maybe you are looking for

  • How to make Conference calls using FaceTime

    I want to video chat with my two brothers... in New York, another in MY. Is this possible?  We all iPhones, but I'm the only one with a Mac. I'm used to be able to do this using iChat (the predecessor of iMessage).

  • Save the data of acoustic pressure 8 hours

    Hi all I want to save a 8 hour of a pcb micro signal. with the audio assistant(signal express) and vibrations. I want to get to 50 kHz, but I think that there are wi will be too much data. Is there a WAY to reduce these data? Thank you

  • InsertTextBoxLine with different text colors

    Hi all I am upgrading an application using CVI2009 and I would like to use the InsertTextBoxLine function. InsertTextBoxLine (int panelHandle, int controlID, int lineIndex, char text []); I must say clearly two types of lines for the user, the lines

  • Rearrangement of the desktop icon

    How can I get my computer constantly rearrange my icons on the desktop by name, when I take the time to arrange them in a special, convenient order? They don't reorganize until my computer is restarted in an update or stop. Because I put in sleep mod

  • How to interrupt the parental control feature?

    How to take the function of parental control of my computer?