Friday, October 14, 2011

How to Insert a Image or Video into Oracle database?? 




11 comments:

  1. What is the difference between %TYPE and %ROWTYPE?

    %TYPE is used to declare a field with the same type as that of a specified table's column.

    %ROWTYPE is used to declare a record with the same types as found in the specified database table, view or cursor.

    ReplyDelete
  2. %type is associated with a variable which belong
    to the particular column of a table

    where as
    % rowtype is associated with a variable which belong to the particular record set of a table

    ReplyDelete
  3. how to find the first day of the current month of a given date

    ANS:
    declare
    i date :='16-dec-11';
    k varchar2(10);
    j number;
    begin
    select to_number(to_char(i,'dd'))into j from dual;
    if j<=15 then
    select to_char(round(i,'month'),'day')into k from dual;
    dbms_output.put_line(k);
    else
    select to_char(trunc(i,'month'),'day')into k from dual;
    dbms_output.put_line(k);
    end if;
    end;

    ReplyDelete
  4. For image we will use blob daata type
    For video we will use Bfile data type

    ReplyDelete
  5. Hi,

    Can anyone post an answer for the question? I googled it but was unable to find a clear solution. Any help would be appreciated. Thanks.

    ReplyDelete
  6. 1) what is meant by normalization?

    2) what is meant by composite primary key ?

    3) without ' group by ' can we have 'having' ?

    4) what is meant by pl/sql collections?

    5) what is oracle supplied packages?

    6) explain execute immediate :-

    7)will the base table gets affected in a view ?

    8) how to search character in a string with out using ' like ' keyword ?

    9) how many ' long ' data type allowed for a table ?

    10) can we set primary key constraint for a null value column? reason?

    11) how can we select only duplicates from a table ?

    12) what is the difference between in and exists?

    13) what is flash back database ?

    14) what are the keyword and function you know in orale to handle null values ?

    ReplyDelete
  7. how to create error log table??? write the query?

    ReplyDelete
    Replies
    1. Hi Arun, Error log table used to Trace the Error.

      for Eg,

      Insert into trace_tbl values('Module Name',SQLCODE,SQLERRM,SYSDATE);

      SQLCODE- Error No.
      SQLEERM - Error Message.

      Delete
  8. how to find the third letter of the name is an 'a'.

    how to find the name which ends with 'a' and 'e'.

    query to display employee name who do not have manager.

    Please write a query for the above mentioned scenarios.

    ReplyDelete
  9. select first_name from employees where first_name like '__a%';

    select first_name from employees where first_name like '%a' or first_name like '%e';

    select first_name from employees where manager_id is null;

    ReplyDelete
  10. A students table has a DOB column. Display the present age of the students. MONTHS_BETWEEN(SYSDATE,DOB)/12 gives the wrong value. How to calculate the age of the students?

    ReplyDelete