.ora-code.com

Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
exec immediate

exec immediate

2006-01-24       - By raja rao
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

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 (See ORA-06550.ora-code.com): 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@(protected)> 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@(protected) [mailto:oracle-l-bounce@(protected)] 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 (See ORA-06550.ora-code.com): 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.
<DIV>declare<BR>x varchar2(100);</DIV>  <DIV>begin<BR>execute immediate 'select
hospital_id||to_char(||trnx_date,'mmddyyyy')||patient_case_type from SJHS_ADT
_ACT_TRXMST_BAK ;' into x;<BR>dbms_output.put_line(x);</DIV>  <DIV>end;</DIV>  
<DIV>&nbsp;</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *<BR>ERROR at
line 5:<BR>ORA-06550 (See ORA-06550.ora-code.com): line 5, column 61:<BR>PLS-00103: Encountered the symbol
"MMDDYYYY" when expecting one of the<BR>following:<BR>. ( * @ % &amp; = - + ;
&lt; / &gt; at in is mod not rem return<BR>returning &lt;an exponent (**)&gt;
&lt;&gt; or != or ~= &gt;= &lt;= &lt;&gt; and or<BR>like between into using ||
bulk<BR>The symbol ". was inserted before "MMDDY
YYY" to
continue.</DIV>  <DIV><BR>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>Here i am
missing something with the MMDDYYYY format and its string. Somany trials. but
did not work.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Can u please help me how to
convert the date to_char in exec immediate.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Raj
<BR><BR><B><I>Igor Neyman &lt;ineyman@(protected)&gt;</I></B> wrote:</DIV>  
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT
: #1010ff 2px solid">  <META content="MSHTML 6.00.2900.2802" name=GENERATOR>  
<DIV dir=ltr align=left><SPAN class=373152713-24012006><FONT face=Arial color=
#0000ff size=2>Multiple errors in your code.</FONT></SPAN></DIV>  <DIV dir=ltr
align=left><SPAN class=373152713-24012006><FONT face=Arial color=#0000ff size=2
>This will work:</FONT></SPAN></DIV>  <DIV dir=ltr align=left><SPAN class
=373152713-24012006><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;<
/DIV>  <DIV dir=ltr align=left><SPAN class=373152713-24012006
><FONT
face=Arial color=#0000ff size=2>set serveroutput on<BR>declare lDate DATE;<BR
>begin<BR>execute immediate 'select sysdate&nbsp; from dual' into lDate;<BR>dbms
_output.put_line(lDate);<BR>end ;<BR>/</FONT></SPAN></DIV>  <DIV dir=ltr align
=left><SPAN class=373152713-24012006></SPAN>&nbsp;</DIV>  <DIV dir=ltr align
=left><SPAN class=373152713-24012006><FONT face=Arial color=#0000ff size=2>Read
Oracle docs.</FONT></SPAN></DIV>  <DIV dir=ltr align=left><SPAN class=373152713
-24012006></SPAN>&nbsp;</DIV><BR>  <DIV class=OutlookMessageHeader lang=en-us
dir=ltr align=left>  <HR tabIndex=-1>  <FONT face=Tahoma size=2><B>From:</B>
oracle-l-bounce@(protected) [mailto:oracle-l-bounce@(protected)] <B>On
Behalf Of </B>raja rao<BR><B>Sent:</B> Tuesday, January 24, 2006 8:22 AM<BR><B
>To:</B> oracle list<BR><B>Subject:</B> exec immediate<BR></FONT><BR></DIV>  
<DIV></DIV>  <DIV id=RTEContent>Hi Team,</DIV>  <DIV>&nbsp;</DIV>  <DIV>when the
below is run i am getting the error. can someone help
 me
:</DIV>  <DIV>&nbsp;</DIV>  <DIV>begin<BR>execute immediate ' select sysdate
&nbsp; from dual ;'<BR>end ;</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>
&nbsp;</DIV>  <DIV>*<BR>ERROR at line 3:<BR>ORA-06550 (See ORA-06550.ora-code.com): line 3, column 1:<BR>PLS
-00103: Encountered the symbol "END" when expecting one of the following:<BR>. (
* @ % &amp; = - + ; &lt; / &gt; at in is mod not rem return<BR>returning &lt;an
exponent (**)&gt; &lt;&gt; or != or ~= &gt;= &lt;= &lt;&gt; and or<BR>like
between into using || bulk<BR>The symbol ";" was substituted for "END" to
continue.</DIV>  <DIV>&nbsp;</DIV>  <div>  <HR SIZE=1>  <BR>What are the most
popular cars? Find out at <A href="http://us.rd.yahoo.com/evt=38382/_ylc
=X3oDMTEzNWFva2Y2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMmF1dG9z/*http://autos
.yahoo.com/newcars/popular/thisweek.html">Yahoo! Autos</A> </BLOCKQUOTE>  <DIV>
<BR></DIV><p>
 
    <hr size=1>Yahoo! Photos<br>
Got holiday prints? <a href="http://us.rd.yahoo.com/mail_us/taglines
/holidayprints/*http://pa.yahoo.com/*http://us.rd.yahoo.com/mail_us/taglines
/photos/evt=38089/*http://pg.photos.yahoo.com/ph//print_splash">See all the ways
</a> to get quality prints in your hands ASAP.