Unless you coincidentally have a variable already call $session that coincidentally contains '$session', then you need to prevent the interpolation of the '$' that is being caused by use of 'qq', simply placing a '\' in front will achieve this.
Alternatively, as there is no real need for the interpolation in this case you could simple use 'q' instead of 'qq'
Example 1Example 2my $sql = qq { select SID,SERIAL,USERNAME,STATUS,SCHEMANAME,OSUSER, PROCESS,MACHINE,TERMINAL,PROGRAM,TYPE,MODULE, to_char(LOGON_TIME,'DD-MON-YY HH24:MI:SS')"LOGON_TIME", STATE,SERVICE_NAME from v\$session order by LOGON_TIME DESC};
my $sql = q { select SID,SERIAL,USERNAME,STATUS,SCHEMANAME,OSUSER, PROCESS,MACHINE,TERMINAL,PROGRAM,TYPE,MODULE, to_char(LOGON_TIME,'DD-MON-YY HH24:MI:SS')"LOGON_TIME", STATE,SERVICE_NAME from v$session order by LOGON_TIME DESC};
In reply to Re: Ignoring "$" sign in sql-statement to Oracle
by Anonymous Monk
in thread Ignoring "$" sign in sql-statement to Oracle
by gizmojunkee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |