Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: exec immediate

RE: exec immediate

From: raja rao <raja4list_at_yahoo.com>
Date: Tue, 24 Jan 2006 05:33:20 -0800 (PST)
Message-ID: <20060124133320.94353.qmail@web31402.mail.mud.yahoo.com>


declare
x varchar2(100);
  begin
execute immediate 'select hospital_id||to_char(||trnx_date,'mmddyyyy')||patient_case_type from SJHS_ADT_ACT_TRXMST_BAK ;' into x; dbms_output.put_line(x);
  end;    

                                                              *
ERROR at line 5:
ORA-06550: line 5, column 61:
PLS-00103: Encountered the symbol "MMDDYYYY" when expecting one of the
following:

. ( * @ % & = - + ; < / > at in is mod not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or like between into using || bulk
The symbol ". was inserted before "MMDDYYYY" to continue.         

  Here i am missing something with the MMDDYYYY format and its string. Somany trials. but did not work.    

  Can u please help me how to convert the date to_char in exec immediate.    

  Raj

Igor Neyman <ineyman_at_perceptron.com> wrote:

      Multiple errors in your code.
  This will work:    

  set serveroutput on
declare lDate DATE;
begin
execute immediate 'select sysdate from dual' into lDate; dbms_output.put_line(lDate);
end ;
/    

  Read Oracle docs.         



  From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of raja rao Sent: Tuesday, January 24, 2006 8:22 AM
To: oracle list
Subject: exec immediate   

  Hi Team,    

  when the below is run i am getting the error. can someone help me :    

  begin
execute immediate ' select sysdate from dual ;' end ;            

  *
ERROR at line 3:
ORA-06550: line 3, column 1:
PLS-00103: Encountered the symbol "END" when expecting one of the following:
. ( * @ % & = - + ; < / > at in is mod not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or like between into using || bulk
The symbol ";" was substituted for "END" to continue.         


  

What are the most popular cars? Find out at Yahoo! Autos                         



Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 24 2006 - 07:33:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US