Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • ORA-01220 Oracle
  • Oracle Material from OTN Oracle
  • Oracle 11g Training on 29JAN1010 Oracle
  • V$INSTANCE of Oracle in MYSQL MYSQL
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • how to find OS block size Oracle
  • 284785.1 How to check RAC Option is currently linked into the Oracle Binary Oracle
  • database trigger failing Oracle
  • Formatter Explain plan Output 1 Oracle
  • sql_plan9i.sql Oracle
  • How does one SELECT a value from a table into a Unix variable? From SQL to Shell Linux/Unix
  • Database logon trigger issue Oracle
  • Shuffle an array PHP/MYSQL/Wordpress
  • create trigger syntax Oracle
  • 751131.1 New Article Error 2819 While Requesting a Systemstate Dump Oracle

DBMS_SQL for alter session.

Posted on 07-Jan-2009 By Admin No Comments on DBMS_SQL for alter session.

SQL>

SQL> CREATE OR REPLACE PROCEDURE AlterSession(

2 p_SessionString IN VARCHAR2) AS

3

4 v_CursorID INTEGER;

5 v_Dummy INTEGER;

6 BEGIN

7 v_CursorID := DBMS_SQL.OPEN_CURSOR;

8

9 DBMS_SQL.PARSE(v_CursorID, p_SessionString, DBMS_SQL.NATIVE);

10 v_Dummy := DBMS_SQL.EXECUTE(v_CursorID);

11 END AlterSession;

12 /

Procedure created.

SQL>

SQL> column sysdate format a30

SQL> SELECT SYSDATE FROM dual;

SYSDATE

——————————

Jun 19, 2008 20:38:44

1 row selected.

SQL>

SQL> DECLARE

2 sqlString VARCHAR2(100);

3 BEGIN

4 sqlString := ‘ALTER SESSION SET NLS_DATE_FORMAT = ‘ ||

5 ”’Mon DD, YYYY HH24:MI:SS”’;

6 AlterSession(sqlString);

7 END;

8 /

PL/SQL procedure successfully completed.

SQL>

SQL> SELECT SYSDATE FROM dual;

SYSDATE

——————————

Jun 19, 2008 20:38:44

1 row selected.

SQL>

Oracle, SQL scripts

Post navigation

Previous Post: get_vmstat_linux
Next Post: Sequence Resetting

Related Posts

  • tblwopk.sql tablewopk.sql Oracle
  • All About oracle password and security from metalink Oracle
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • Jai Shree Ram Oracle
  • DBMS_STATS Metalinks Notes Oracle
  • RMAN : Consistent Backup, Restore and Recovery using RMAN Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Goog notes on X$ tables Oracle
  • Optimizer SORT Operations Oracle
  • Reading parameter file and printing Linux/Unix
  • Create type and Grant on it. Oracle
  • Windows based Command line mailing program like mailx (Sednmail for windows) PHP/MYSQL/Wordpress
  • JSON/XML Types in Oracle Oracle
  • Drop all SPM baselines for SQL handle Oracle
  • OEM-Commnds Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme