Home » SQL & PL/SQL » SQL & PL/SQL » how to set the server time in sql prompt (sql)
how to set the server time in sql prompt [message #427668] Fri, 23 October 2009 21:47 Go to next message
sivaora
Messages: 119
Registered: October 2009
Location: Hyderabad
Senior Member
i want to know the command to set my pc time in sql prompt.
and also to the server,if i having privilage.
Re: how to set the server time in sql prompt [message #427669 is a reply to message #427668] Fri, 23 October 2009 21:58 Go to previous messageGo to next message
BlackSwan
Messages: 24908
Registered: January 2009
Senior Member
SQL> help set    

 SET
 ---

 Sets a system variable to alter the SQL*Plus environment settings
 for your current session. For example, to:
     -   set the display width for data
     -   customize HTML formatting
     -   enable or disable printing of column headings
     -   set the number of lines per page
 In iSQL*Plus, you can also use the Preferences screen to set
 system variables.

 SET system_variable value

 where system_variable and value represent one of the following clauses:

   APPI[NFO]{OFF|ON|text}                   NUM[WIDTH] {10|n}
   ARRAY[SIZE] {15|n}                       PAGES[IZE] {14|n}
   AUTO[COMMIT] {OFF|ON|IMM[EDIATE]|n}      PAU[SE] {OFF|ON|text}
   AUTOP[RINT] {OFF|ON}                     RECSEP {WR[APPED]|EA[CH]|OFF}
   AUTORECOVERY {OFF|ON}                    RECSEPCHAR {_|c}
   AUTOT[RACE] {OFF|ON|TRACE[ONLY]}         SERVEROUT[PUT] {ON|OFF}
     [EXP[LAIN]] [STAT[ISTICS]]               [SIZE {n | UNLIMITED}] [FOR[MAT]
   BLO[CKTERMINATOR] {.|c|ON|OFF}             {WRA[PPED] |
   CMDS[EP] {;|c|OFF|ON}                       WOR[D_WRAPPED] |
   COLSEP {_|text}                             TRU[NCATED]}]
   CON[CAT] {.|c|ON|OFF}                   *SHIFT[INOUT] {VIS[IBLE] |
   COPYC[OMMIT] {0|n}                         INV[ISIBLE]}
   COPYTYPECHECK {ON|OFF}                  *SHOW[MODE] {OFF|ON}
   DEF[INE] {&|c|ON|OFF}                   *SQLBL[ANKLINES] {OFF|ON}
   DESCRIBE [DEPTH {1|n|ALL}]               SQLC[ASE] {MIX[ED] |
     [LINENUM {OFF|ON}] [INDENT {OFF|ON}]     LO[WER] | UP[PER]}
   ECHO {OFF|ON}                           *SQLCO[NTINUE] {> | text}
  *EDITF[ILE] file_name[.ext]              *SQLN[UMBER] {ON|OFF}
   EMB[EDDED] {OFF|ON}                      SQLPLUSCOMPAT[IBILITY] {x.y[.z]}
   ESC[APE] {\|c|OFF|ON}                   *SQLPRE[FIX] {#|c}
   FEED[BACK] {6|n|ON|OFF}                 *SQLP[ROMPT] {SQL>|text}
   FLAGGER {OFF|ENTRY|INTERMED[IATE]|FULL}  SQLT[ERMINATOR] {;|c|ON|OFF}
  *FLU[SH] {ON|OFF}                        *SUF[FIX] {SQL|text}
   HEA[DING] {ON|OFF}                      *TAB {ON|OFF}
   HEADS[EP] {||c|ON|OFF}                  *TERM[OUT] {ON|OFF}
   INSTANCE [instance_path|LOCAL]          *TI[ME] {OFF|ON}
   LIN[ESIZE] {80|n} ({150|n} iSQL*Plus)    TIMI[NG] {OFF|ON}
   LOBOF[FSET] {1|n}                       *TRIM[OUT] {ON|OFF}
   LOGSOURCE [pathname]                    *TRIMS[POOL] {OFF|ON}
   LONG {80|n}                              UND[ERLINE] {-|c|ON|OFF}
   LONGC[HUNKSIZE] {80|n}                   VER[IFY] {ON|OFF}
   MARK[UP] HTML [OFF|ON]                   WRA[P] {ON|OFF}
     [HEAD text] [BODY text] [TABLE text]   XQUERY {BASEURI text|
     [ENTMAP {ON|OFF}]                        ORDERING{UNORDERED|
     [SPOOL {OFF|ON}]                                  ORDERED|DEFAULT}|
     [PRE[FORMAT] {OFF|ON}]                   NODE{BYVALUE|BYREFERENCE|
   NEWP[AGE] {1|n|NONE}                            DEFAULT}|
   NULL text                                  CONTEXT text}
   NUMF[ORMAT] format


 An asterisk (*) indicates the SET option is not supported in iSQL*Plus


One does what you desire.
So it is time for you to Read The Fine HELP information
Re: how to set the server time in sql prompt [message #427674 is a reply to message #427668] Fri, 23 October 2009 22:55 Go to previous messageGo to next message
balakrishnay
Messages: 54
Registered: September 2009
Location: Pune
Member

Hi,

You can customize GLOGIN.sql & LOGIN.sql however you want few of some examples you can through with this.

http://www.dbazine.com/blogs/blog-cf/chrisfoot/blogentry.2006-06-22.9332221251.

Regards

Bala
Re: how to set the server time in sql prompt [message #427678 is a reply to message #427674] Sat, 24 October 2009 01:05 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Your link is not valid and I wonder what is the relationa between the question and login.sql?

Regards
Michel
Re: how to set the server time in sql prompt [message #427679 is a reply to message #427668] Sat, 24 October 2009 01:08 Go to previous messageGo to next message
balakrishnay
Messages: 54
Registered: September 2009
Location: Pune
Member

Michel,

Yes i know that .. but he can set timing or what ever he want in glogin.sql script itself instead of setting manually every time when he login to DB. This was the reason behind this.

Regards

Bala
Re: how to set the server time in sql prompt [message #427681 is a reply to message #427679] Sat, 24 October 2009 01:11 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I don't know what he wants to do, and you?
Given the other questions, I don't think he wants to do anything but answering questions that have been asked to him.

Regards
Michel
Re: how to set the server time in sql prompt [message #427687 is a reply to message #427681] Sat, 24 October 2009 01:26 Go to previous messageGo to next message
balakrishnay
Messages: 54
Registered: September 2009
Location: Pune
Member
Michel,

I am sorry if you mistake me .. i am trying to help me him instead of setting set time on> every time when he logsin .. he can customize glogin.sql right according to his requirement.

Regards

Bala
Re: how to set the server time in sql prompt [message #427711 is a reply to message #427687] Sat, 24 October 2009 03:36 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Well, it seems I misunderstood as "at sqlprompt how to set pc time" when it should clearly be understood as "how to get pc time in sql prompt".

Regards
Michel
Re: how to set the server time in sql prompt [message #427712 is a reply to message #427668] Sat, 24 October 2009 03:40 Go to previous messageGo to next message
balakrishnay
Messages: 54
Registered: September 2009
Location: Pune
Member

Yes. May be !! Smile.

Michel i would like to know about you .. i think this is third time i am asking but you never responded to me at all.
Regards

Bala
Re: how to set the server time in sql prompt [message #427713 is a reply to message #427712] Sat, 24 October 2009 03:58 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

There is nothing interesting to know about me and it is not the place to discuss about it.

Regards
Michel
Re: how to set the server time in sql prompt [message #427749 is a reply to message #427713] Sat, 24 October 2009 23:24 Go to previous messageGo to next message
sivaora
Messages: 119
Registered: October 2009
Location: Hyderabad
Senior Member
Thanks for your reply.
i am sorry if you are get confused with my question,
actually my intension is that , i want to set my pc time in sql prompt like,

SQL> statement

i know to alter the session time by using this
SQL> alter session set nls_date_format = 'dd-mon-yy hh:mi:ss am'

but this is valid for only the session, i want to set the time permenently to my pc or server.
i.e simply typing a command in sql prompt i want to change my pc time.

Re: how to set the server time in sql prompt [message #427751 is a reply to message #427749] Sat, 24 October 2009 23:32 Go to previous messageGo to next message
BlackSwan
Messages: 24908
Registered: January 2009
Senior Member
>i.e simply typing a command in sql prompt i want to change my pc time.
SQL can only change contents of DB & does not change OS
If you want to change OS, then issue appropriate OS command


Re: how to set the server time in sql prompt [message #427756 is a reply to message #427749] Sun, 25 October 2009 01:12 Go to previous message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
i know to alter the session time by using this
SQL> alter session set nls_date_format = 'dd-mon-yy hh:mi:ss am'

You do not change the PC or session time, you change the way it is displayed.
You can do it for all sessions using ALTER SYSTEM if you are allowed to do it.

To change the PC time at SQL prompt you can use HOST command. To change server you must have root/administrator privilege and use a Java class but I don't see any good reaon to do this.

Regards
Michel
Previous Topic: how to know all system defined table names
Next Topic: sql query proposed for using case
Goto Forum:
  


Current Time: Tue Sep 27 16:06:32 CDT 2016

Total time taken to generate the page: 0.08498 seconds