Sql *plus Update
Please look into this
How can I upgrade sql* plus release 10 for 10g
do i have to apply patch or install something on my machine
SQL*Plus: Release 9.2.0.1.0 - Production on Mon May 14 11:01:36 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Please help me
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining optionsThank you
Well, check the metalink note 207303.1.
Between client 10g and 9i database, only 9.2.0.4 and higher patchsets are supported.
Nicolas.
Similar Messages
-
Database not updating with changes from SQL*plus
Im having some issues with updating my database. I want to delete some rows in a table that has 323 records, so I run the SQL in SQL*Plus. It tells me that Ive deleted 222 rows. I then get a count of the number of rows in the table, and it tells me 101. But if I open another SQL*Plus window and get a row count, the original count (323) is what it says. The enterprise manager also tells me 323 records are in that table. Am I missing something here?
Aimee-
Until you 'commit' from the session you have issued the 'delete' statement, the other sessions will not be able to see the changes. In other words, the other sessions are getting you a read consistent view of the data. -
Hi
We have a big problem, We can't create internal orders, when I run the CREATE INTERNAL ORDER, it finish with ERROR:
Concurrent Manager encountered an error while running SQL*Plus for your concurrent request 134980682.
Review your concurrent request log and/or report output file for more detailed information.
this is the log:
+---------------------------------------------------------------------------+
Purchasing: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
POCISO module: Create Internal Orders
+---------------------------------------------------------------------------+
Current system time is 26-JUL-2013 09:21:09
+---------------------------------------------------------------------------+
+-----------------------------
| Starting concurrent program execution...
+-----------------------------
+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
Begin create internal sales order
Updating Req Headers
14 Reqs selected for processing
Top of Fetch Loop
Source Operating Unit: 82
Selecting Currency Code
Currency Code : MXP
Selecting Order Type
Order Type ID:1001
Selecting Price List from Order Type
Deliver To Location Id: 196
Inserting Header : 3908784
Getting the customer id
Getting the customer id: 15334
Unhandled Exception : ORA-01403: no data found
+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+
Concurrent Manager encountered an error while running SQL*Plus for your concurrent request 134980682.
Review your concurrent request log and/or report output file for more detailed information.
+---------------------------------------------------------------------------+
Executing request completion options...
Output file size:
78
Output is not being printed because:
The print option has been disabled for this report.
Finished executing request completion options.
+---------------------------------------------------------------------------+
Concurrent request completed
Current system time is 26-JUL-2013 09:21:14
+---------------------------------------------------------------------------+
Some suggestion for resolve it??
Thanks & Regards.In the document 294932.1 Section 4 there are no pre-installation patches or update for OS RedHat LinuxAS4.
When I type echo $LD_ASSUME_KERNEL it doesn't display any value so do I need to set the LD_Assume_Kernal value manually.
If yes, please let me know the path and command to set the kernel value.
Thanks
Amith -
Need help in SQL Query: Update a row in a table & insert the same row into another table
I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its working with this scenario. (Note: I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0).
Thanks in Advance.Using Sven's code as an example, you could save the updated row in a sql plus variable. (also untested):
SQL> var v_id number
update tableA
set colB='ABC'
where colC='XYZ'
returning id into :v_id;
insert into table A_History (ID, colA, colB, ColC)
select id, ColA, ColB, ColC
from tableA
where id = :v_id; -
Maximum length of SQL*Plus Command?
I'm typing a long query into SQL*Plus (Linux, version 9.2.0.1... yes, I know it's ancient).
If I run this query, all works fine:
select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$')
else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
'UPDATEMYAUDITING_TABLESETTEST_DETAILS='''||GRANTEE||'''WHEREMYAUDIT_REFNO=''A.F
update myauditing_table set test_details='AUDIT_TRAIL is set to: DB' where myaud
it_refno='A.FE';(In other words, is SQL that generates other SQL: if AUDIT_TRAIL is set to something interesting, tell me who has access to the AUD$ table. And it's working fine... the agg_concat function mentioned is simply Tom Kyte's stragg function under another name, as lifted word-for-word from http://www.sqlsnippets.com/en/topic-11591.html)
Now this is what happens if I take out the linebreak after the mention of AUD$, so that the command is submitted as one single line of code:
SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.The error message indicates that the text has been 'split' at the 'AUDIT_TRAIL is set to...' bit, so that "s set to" is being treated as a new command, which is of course syntactically invalid. There is definitely no other change in text between the two versions, apart from the removal of a carriage return before the "else" statement.
Possibly a coincidence, but the first "s" in "s set to" appears at position 258 in the entire text... close to a possible 255 or 256 character limit, perhaps?
The same problem happens whether I run the command as a script (@mysql.sql) or typed in directly into a client SQL*Plus session. Is there some inherent limit to the length of commands that SQL*Plus can process in this version? My code runs fine on 10g and 11g databases/clients, whether it's on one line or two. Anyone know of a bug in 9i regarding this? And if there's a workaround (other than the obvious one of upgrading, of course!)As mentioned, it's choking at the 258th character, not the 240th. Also, it's a SELECT statement, not a COPY command (one relates to the database, the other is an internal SQL*Plus feature). And someone else also kindly pointed out that SQL*Plus has a command limit length (i.e., database-related commands) of 2500 characters. So I don't think that's the issue.
I can be a bit more specific about this one now, though. I've a sequence of Solaris boxes running 9.2.0.1 up, and the results are that 9.2.0.1 is affected; and it's a problem for 9.2.0.7:
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for Solaris: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.And...
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
PL/SQL Release 9.2.0.7.0 - Production
CORE 9.2.0.7.0 Production
TNS for Solaris: Version 9.2.0.7.0 - Production
NLSRTL Version 9.2.0.7.0 - Production
SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE') then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.But in 10.2.0.1, the problem disappears.
I am not sure, but it is perhaps related to metalink note 285913.1, since we did get some ORA-00600: internal error code, arguments: [qernsRowP], [1] errors in the alert log with a slightly different version of the above query. Changing the query obviously alters the test, though, so it may be completely unrelated.
Either way, I think it's definitely a version-specific SQL*Plus bug (though it would be nice if any other 9i owners out there could try it and report back!)
Anyway, the workaround is simply to submit the command on two separate lines, wherever possible. And of course... to upgrade. -
SQL PLUS acitvity in process flow
I looked at other threads and did exactly the same but I am getting a error. Any ideas.
I created a variable as counter.
In sqlplus activity Paramter List I did not do anything. for result code I did the binding as counter which is my variable.In script I put in the below code.
VARIABLE COUNTER_PPAL NUMBER;
DECLARE
BEGIN
SELECT COUNT(*) INTO :COUNTER_PPAL FROM TEMP_TABLE
END;
EXIT :COUNTER_PPAL
The error I am getting is
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 25 08:30:15 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Session altered.
END;
ERROR at line 4:
ORA-06550: line 4, column 4:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
SP2-0670: Internal number conversion failed
Usage: { EXIT | QUIT } [ SUCCESS | FAILURE | WARNING | n |
<variable> | :<bindvariable> ] [ COMMIT | ROLLBACK ]
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining optionsI was missign a semi colon after my select statement.
-
Not able to connect Oracle DBXE from sql*plus client
Hi,
I have installed Oracle 10gXE from oracle site. i have updated the tnsnames.ora also
but when i try to connect the db through sql*plus client, i am redirected to .net debugger.
Pls help me in this,
Thanks in advance.
-- RajaHello,
Can you clarify what you are trying to connect from? If it's B1 ( one ) then post to the [B1 forum|http://forums.sdn.sap.com/index.jspa#44].
Otherwise need more info on the product you are using?
Typically the Oracle Path must be in the PATH statement as well it requires the correct platform ( 32 or 64 ) bit client installed.
Most BOE/CR products are 32 bit so you need to install the 32 bit client.
Don -
How to run multiple scripts in sql*plus?
I would like to run 2 scripts in sql*plus, how do I do this? I tried the following, but it won't run.
create table student_new
AS
select *
from student
insert into student_new
(last_name, first_name
values
(Crop, Jenny)
The above are the two scripts I want to run, what am I doing wrong.
ThanksDo you have a solution to run multiple scripts continuosly, one after the other as one script.
Say I have file1.sql file2.sql, file3.sql.
I want to create a script run.sql, where this will run file1.sql,file2.sql,file3.sql one after other without any one running one after the other like follows:
run.sql should have
begin
@file1.sql
@file2.sql
@file3.sql
dbms_output.put_line(select sysdate from dual);
end;
If I run run.sql all the three scripts should be executed successfully and then display the current time . All these files have update statements(50,000 updates each file).
Very urgetn. Can some one hlpe, please.
Thanks in advance. -
The subject sums it up pretty well... I have a query that works fine from SQL*Plus, but throws a JDBC exception with "ORA-00904 invalid column name" if I create a PreparedStatement from it and call executeQuery().
The query itself is substantially similar to:
SELECT foo, t.bar.getStringVal() from some_table t
where "Some table" is an oracle 9i table, "foo" is a varchar2 column, and "bar" is a column that used to be varchar2 before I dropped and re-created the table with an xmltype column instead. "t" is an alias for the table that I didn't used to need (since it's only one table), but apparently is required for getStringVal() to work.
... And, of course, .getStringVal() is being used as a convenient way to treat technically LOB-like xmltype columns as big ersatz varchar2 columns so I won't have to screw around with stream i/o just to read a 4,001-byte value into a String ;-)
I'm using the ojdbc14.jar thin driver and a fairly recent j2sdk (1.4.1_02, I think). I made a point of anihilating every copy of classes12.zip on my PC just to make sure it wasn't lurking in a classpath somewhere to screw things up.
Strangely enough, it DOES work from within Netbeans' database explorer (itself connecting to the same Oracle database using the ojdbc14.jar thin driver).
For the sake of being comprehensive, here's an example of the actual JDBC code that won't work:
public ResultSet doQuery(Connection conn, int val) throws SQLException {
String sql = "SELECT foo, t.bar.getStringVal() from some_table t where anothercolumn = ?";
PreparedStatement sth = conn.prepareStatement(sql);
sth.setInt(1, val);
ResultSet rs = sth.executeQuery();
// everything past this point is moot,
// because sth.executeQuery throws an exception...
// however, the ResultSet would ultimately be
// returned to the method's caller, and
// its values read using getString(fieldname)
// including 'bar', the xmltype field...OK, this particular problem was my fault. The original table was on a server running 8i. To spare myself the grief of having to deal with CLOBs on 8i's terms and take advantage of 9i's new conveniences for handling them, I created a new table on our other server that's running 9i and updated the app's config settings to reflect the new server. Unfortunately, I forgot that the debugging/testing main() method had the URL of the old database hardcoded (it was written before the rest of the class). Ergo... it was still looking at the old database. Oops. (*blush*).
-
Execution of Immediate SQL in compiled package in two versions of SQL*PLUS
A peculiar problem has risen in our database.
Execution of Immediate SQL in compiled package in two versions of SQLPLUS gives different results
We have a compiled package with two procedures that contain immediate SQL statements, and these are:
+PROC_DELETE_ROWS+
+ -- This immediate sql deletes unreferenced Document Types from the DOC_REF_TYPE table+
+ delete from doc_ref_type t where exists (select 1 from PROARC_DOC_REF_TYPE_VW d where d.doc_ref_type = t.doc_ref_type)+
+ and not exists (select 1 from doc_ref d where d.doc_ref_type = t.doc_ref_type)+
+ and doc_ref_type not in (select doc_ref_type from eis_doc_ref_type)+
+ and doc_ref_type not in (select eis_doc_ref_type from eis_doc_ref_type)+
+PROC_ADD_NEW_ROWS+
+ -- Drop the temporary table+
+ drop table TMP_PROARC_DOC_REF_TYPE+
+ -- Create a temporary table+
+ create table tmp_PROARC_DOC_REF_TYPE as+
+ select DOC_REF_TYPE, substr(DOC_REF_TYPE_DESC,1,100) as DOC_REF_TYPE_DESC+
+ from PROARC_DOC_REF_TYPE_VW+
+ -- Insert document types that do not exist in the DOC_REF_TYPE table+
+ insert into doc_ref_type t (DOC_REF_TYPE, DOC_REF_TYPE_DESC)+
+ select distinct DOC_REF_TYPE, DOC_REF_TYPE_DESC from tmp_PROARC_DOC_REF_TYPE s+
+ where not exists (select 1 from doc_ref_type t where t.doc_ref_type = s.doc_ref_type)+
I am using the following test script:
+Exec mypackage.proc_delete_rows;+
+Commit;+
+Select count(*) from DOC_REF_TYPES;+
+Exec mypackage.proc_add_new_rows;+
+Commit;+
+Select count(*) from DOC_REF_TYPES;+We have a Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
I am using SQL*Plus: Release 8.1.7.0.0
The test script is working as expected.
Count after delete =155
Count after insert = 511
but when I use another computer with SQL*Plus: Release 10.x
The Test script returns the following
Count after delete =155
Count after insert =155
The same is happening when I am running the scripts as a scheduled job.
QUESTION:
I believe I have found a fix for the problem though. By changing tmp_PROARC_DOC_REF_TYPE in the insert statement to all upper case, the script is running in both environments apparently. But how is this possible? I am executing a compiled package in the database. The session shell should have no impact on the behaveour of the procedure I am calling. What causes this?
Edited by: Reon on Jun 16, 2011 4:44 AM1) I am using the same user (PANDORA)
2) (PANDORA) for both
3) I am actually not handling any errors. Just skipping any error altogether. I'll check to see what exceptions are raised, and come back.
I have also noticed that SQL/PLUS is not the culprit here. If I use SQLTools 1.5 to run the script, the same thing happens. So it has to do something with the connection or session environment that is inheritet to both clients.
The CODEZ:_
procedure add_doc_types IS
sqlstr VARCHAR2(2000);
begin
BEGIN
sqlstr := 'drop table TMP_PROARC_DOC_REF_TYPE';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
END;
BEGIN
sqlstr := 'create table tmp_PROARC_DOC_REF_TYPE as select DOC_REF_TYPE, substr(DOC_REF_TYPE_DESC,1,100) as DOC_REF_TYPE_DESC from PROARC_DOC_REF_TYPE_VW';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
END;
BEGIN
sqlstr := 'insert into doc_ref_type t (DOC_REF_TYPE, DOC_REF_TYPE_DESC)
select distinct DOC_REF_TYPE, DOC_REF_TYPE_DESC from TMP_PROARC_DOC_REF_TYPE s
where not exists (select 1 from doc_ref_type t where t.doc_ref_type = s.doc_ref_type)';
EXECUTE IMMEDIATE sqlstr;
sqlstr := 'update doc_ref_type t set DOC_REF_TYPE_DESC = (
select DOC_REF_TYPE_DESC from tmp_PROARC_DOC_REF_TYPE s
where t.doc_ref_type = s.doc_ref_type)
where exists (select 1 from tmp_PROARC_DOC_REF_TYPE s where t.doc_ref_type = s.doc_ref_type)';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
END;
end add_doc_types;
procedure delete_doc_types IS
sqlstr VARCHAR2(2000);
BEGIN
sqlstr := 'delete from doc_ref_type t where exists (select 1 from PROARC_DOC_REF_TYPE_VW d where d.doc_ref_type = t.doc_ref_type)
and not exists (select 1 from doc_ref d where d.doc_ref_type = t.doc_ref_type)
and doc_ref_type not in (select doc_ref_type from eis_doc_ref_type)
and doc_ref_type not in (select eis_doc_ref_type from eis_doc_ref_type)';
EXECUTE IMMEDIATE sqlstr;
EXCEPTION
WHEN OTHERS THEN
null;
end delete_doc_types;Edited by: Reon on Jun 16, 2011 2:01 AM -
SQL Devloper working fine but not SQL Plus
Hi,
I am facing a problem that I can connect to oracle server via SQL Developer but cannot connect to the same using SQL*Plus.
ORA-12154: TNS:could not resolve service name
I checked many forums and followed each advices but in vein. To make sure that I have got only one instance of tnsnames.ora file, I removed oracle completely from my system and did the fresh installation of the same.Again, SQL Developer worked but not SQL*Plus.
Also, I updated dummy value in the tnsnames.ora file to check if SQLDeveloper is pointing to correct ora file, it failed means that its pointing to correct one only.
Also, this is not the problem with single machine rather my colleague is also facing the same problem while connecting to the same oracle. It suggest me that its rather problem with server side then client one but what do you people think the actual problem can be.
Kindly advice
I am using oracle 10.2 and OS window server 2003 standard edition.
Cheers,
D
Edited by: user9022426 on 20-Jan-2010 14:25The problem is client side.
The error message means that you're not getting
Are you using a TNS connection for SQL Developer?
If so, this error suggests that SQL Developer and SQL*Plus are not going through the same ORACLE_HOME and/or TNSNAMES.ORA.
For example, do you have the environment variable TNS_ADMIN set?
If you have metalink access, then there is a troubleshooting guide for ORA-12154 in Metalink note 114085.1 -
SQL*Plus sysdba remote connection
Hello all,
I'm attempting to connect to a remote database via splplus as the sys as sysdba user and am unable to do so. However, I am able to connect as a non-sysdba user. When I attempt to connect as sysdba, I receive no error but only the sqlplus Usage message. Here is some initial information:
Client
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
U:\>sqlplus regular_user/password@mySID
SQL*Plus: Release 9.2.0.1.0 - Production on Thu Jul 2 10:05:29 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
U:\>sqlplus sys/password@mySID as sysdba
Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
<logon> ::= <username>[/<password>][@<connect_string>] | / | /NOLOG
<start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
"-H" displays the SQL*Plus version banner and usage syntax
"-V" displays the SQL*Plus version banner
"-L" attempts log on just once
"-M <o>" uses HTML markup options <o>
"-R <n>" uses restricted mode <n>
"-S" uses silent modeServer
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
U:\>sqlplus sys/password@mySID as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 2 10:21:01 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>Based upon what I read here: I've found that the server has a PWDmySID.ora file in %ORACLE_HOME%\database. I've updated the %ORACLE_HOME%\database\initmySID.ora file to include the REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE line and have restarted the database.
Any thoughts? Apparently I'm making some sort of syntax error logging in but I don't know what it is? :) Thanks.
Edited by: nmd on Jul 2, 2009 9:43 AMHI,
can you please try it like first entrying into the sqlplus and then enter the username and password..
Also it should be sqlplus "sys/password as sysdba"
Regards -
SQL*Plus and NLS_DATE_FORMAT
So, I haven't visited this topic in a long time, so I'm trying to refresh my memory on how everything works ...
We set our NLS_DATE_FORMAT at the system level ... what ... 4 years ago to 'MM/DD/RR'. Despite the fact that I set this to something more commonly-used than the default of 'DD-Mon-RR', we've adopted the standard of always using TO_DATE() with an explicit format, just in case it's ever changed.
There were some applications that missed the standard, and now that a driver (for ColdFusion) has been updated, these SQL statements are now failing.
When I started looking into it, I realized that the system-level default of 'MM/DD/RR' should work fine. But, after experimenting in SQL*Plus and TOAD, I am thinking that either:
1) the system-level format is not being used
2) and/or there are login scripts which are setting these to something else
Coincidentally, both SQL*Plus and TOAD return the exact same query results:
SQL> select *
from NLS_INSTANCE_PARAMETERS
where parameter = 'NLS_DATE_FORMAT';
PARAMETER VALUE
NLS_DATE_FORMAT MM/DD/RR
SQL> select *
from NLS_SESSION_PARAMETERS
where parameter = 'NLS_DATE_FORMAT';
PARAMETER VALUE
NLS_DATE_FORMAT DD-MON-RRSo I looked into the glogin.sql script (which both tools share), and there's nothing mentioned about the NLS_DATE_FORMAT
-- Copyright (c) 1988, 2003, Oracle Corporation.
-- All Rights Reserved.
-- NAME
-- glogin.sql
-- DESCRIPTION
-- SQL*Plus global login "site profile" file
-- Add any SQL*Plus commands here that are to
-- be executed when a user starts SQL*Plus, or
-- uses the SQL*Plus CONNECT command
-- USAGE
-- This script is automatically run
-- Used by Trusted Oracle
COLUMN ROWLABEL FORMAT A15
-- Used for the SHOW ERRORS command
COLUMN LINE/COL FORMAT A8
COLUMN ERROR FORMAT A65 WORD_WRAPPED
-- Used for the SHOW SGA command
COLUMN name_col_plus_show_sga FORMAT a24
COLUMN units_col_plus_show_sga FORMAT a15
-- Defaults for SHOW PARAMETERS
COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
-- Defaults for SHOW RECYCLEBIN
COLUMN origname_plus_show_recyc FORMAT a16 HEADING 'ORIGINAL NAME'
COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
COLUMN objtype_plus_show_recyc FORMAT a12 HEADING 'OBJECT TYPE'
COLUMN droptime_plus_show_recyc FORMAT a19 HEADING 'DROP TIME'
-- Defaults for SET AUTOTRACE EXPLAIN report
COLUMN id_plus_exp FORMAT 990 HEADING i
COLUMN parent_id_plus_exp FORMAT 990 HEADING p
COLUMN plan_plus_exp FORMAT a60
COLUMN object_node_plus_exp FORMAT a8
COLUMN other_tag_plus_exp FORMAT a29
COLUMN other_plus_exp FORMAT a44
-- Used to alter the TOAD environment so that users do not have to
-- use the SET DEFINE OFF command prior to compiling code
-- Charles Forbes 10.17.2005
SET scan offIf I expressly go into either tool and execute, the following, setting the format to that already delcared at the system-level:
alter session set nls_date_format = 'MM/DD/RR'Then these SQL statements start running just fine again.
There's something that I'm missing in my basic understanding of how this works. I assumed that the driver update for ColdFusion perhaps enabled a different "glogin.sql"-type script equivalent for that tool ... until ... I started checking into how the NLS_DATE_FORMAT is supposed to work ... but isn't. Could someone help me clarify where the hole is in my understanding?
Thanks,
Chuckchuckers wrote:
What's the difference, then, between NLS_SESSION_PARAMETERS and NLS_INSTANCE_PARAMETERS in my initial post? The glogin.sql script isn't altering the NLS_DATE_FORMAT for the desktop version of SQL*Plus, so I'm perplexed that the SESSION format differs from the INSTANCE format.NLS_SESSION_PARAMETERS are the NLS parameters that are in force for your particular session (i.e. the particular connection you have). Most client applications cause things like NLS_DATE_FORMAT to be set, overriding the NLS_INSTANCE_PARAMETERS. Instance-level NLS settings are most commonly used only for purely back-end processing (i.e. background jobs scheduled via DBMS_JOB or DBMS_SCHEDULER, etc.) 9 times out of 10, the client application is going to override the instance-level paramters.
I even opened SQL Developer, and got
select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
PARAMETER VALUE
NLS_DATE_FORMAT DD-MON-RR
1 rows selected
select * from nls_instance_parameters where parameter = 'NLS_DATE_FORMAT'
PARAMETER VALUE
NLS_DATE_FORMAT MM/DD/RR
1 rows selected
That's not unexpected. Java applications are going to use the Java regional properties at least to specify a date format. SQL Developer has a config option for the date format, so it may well be specifying a different format.
They're all 3 (Toad, SQL*Plus, TOAD) so suspiciously consistent, that I'm questioning some of the fundamentals of the NLS setup.
I went ahead and looked via SQL*Plus from the server-side, & things are looking more consistently in-line with my expectations:
[oracle@dvsrvr13 ~]$ sqlplus forbesc@d13
SQL*Plus: Release 10.1.0.4.0 - Production on Thu Mar 19 12:44:57 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
PARAMETER VALUE
NLS_DATE_FORMAT MM/DD/RR
SQL> select * from nls_instance_parameters where parameter = 'NLS_DATE_FORMAT';
PARAMETER VALUE
NLS_DATE_FORMAT MM/DD/RR
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@dvsrvr13 ~]$ locate glogin.sql
/u01/app/oracle/product/10.1.0/db_1/sqlplus/admin/glogin.sql
[oracle@dvsrvr13 ~]$ more /u01/app/oracle/product/10.1.0/db_1/sqlplus/admin/glogin.sql
-- Copyright (c) 1988, 2003, Oracle Corporation. All Rights Reserved.
-- NAME
-- glogin.sql
-- DESCRIPTION
-- SQL*Plus global login "site profile" file
-- Add any SQL*Plus commands here that are to be executed when a
-- user starts SQL*Plus, or uses the SQL*Plus CONNECT command
-- USAGE
-- This script is automatically run
-- Used by Trusted Oracle
COLUMN ROWLABEL FORMAT A15
-- Used for the SHOW ERRORS command
COLUMN LINE/COL FORMAT A8
COLUMN ERROR FORMAT A65 WORD_WRAPPED
-- Used for the SHOW SGA command
COLUMN name_col_plus_show_sga FORMAT a24
COLUMN units_col_plus_show_sga FORMAT a15
-- Defaults for SHOW PARAMETERS
COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
-- Defaults for SHOW RECYCLEBIN
COLUMN origname_plus_show_recyc FORMAT a16 HEADING 'ORIGINAL NAME'
COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
COLUMN objtype_plus_show_recyc FORMAT a12 HEADING 'OBJECT TYPE'
COLUMN droptime_plus_show_recyc FORMAT a19 HEADING 'DROP TIME'
-- Defaults for SET AUTOTRACE EXPLAIN report
COLUMN id_plus_exp FORMAT 990 HEADING i
COLUMN parent_id_plus_exp FORMAT 990 HEADING p
COLUMN plan_plus_exp FORMAT a60
COLUMN object_node_plus_exp FORMAT a8
COLUMN other_tag_plus_exp FORMAT a29
COLUMN other_plus_exp FORMAT a44
[oracle@dvsrvr13 ~]$ So in all, I'm just perplexed by the differences.
--=cfI'm not surprised that SQL*Plus from the Unix database server is going to have session-level settings that match the instance-level settings because there is probably nothing set in the Unix environment that would override the instance-level settings. There is probably no NLS_LANG or NLS_DATE_FORMAT set as environment variables and probably no central place to look for regional settings. Most applications, particularly Windows and Java apps, are going to have multiple places to look for that sort of information.
Justin -
SQL statement works with SQL/Plus - but not with ODBC
Hi all,
I have a rather copmplex SQL statement:
BEGIN
UPDATE ContentDataTable
SET SYMBOLIC_PATH_PARENT = N'/Test',
SYMBOLIC_NAME = N'HAWK01.GIF',
VERSION_NUMBER = 1 +
SELECT MAX(VERSION)
FROM
(SELECT MAX(VERSION_NUMBER) AS VERSION
FROM ContentDataTable WHERE
SYMBOLIC_PATH_PARENT = N'/Test' AND
SYMBOLIC_NAME = N'HAWK01.GIF'
UNION
SELECT MAX(VERSION_NUMBER) AS VERSION
FROM RevisedContentDataTable WHERE
SYMBOLIC_PATH_PARENT = N'/Test' AND
SYMBOLIC_NAME = N'HAWK01.GIF'))
WHERE SYMBOLIC_PATH_PARENT = N'/Test' AND SYMBOLIC_NAME = N'HAWK02.GIF' AND VERSION_NUMBER = 1;
END;
It works fine in SQL/Plus or SQL Worksheet and does what it should do ;-)
But when using it via ADO (ODBC Driver) I get the following error:
PLS-00103 found 'string' but expected one of the following: 'string'"}
Any idaes?
Thanx,
Christian
nullPardon my ignorance, but what's the significance of the N'<string>' construction? That's not one I'm familar with.
Justin -
Code runs correctly when compiled by SQL developer but not SQL Plus
I have a rather large package body I need to deploy and compile ... It's big and complex (I inherited the project). Our it dept is huge and scripts are deployed by the dba team and they seem to only use sql plus. My code deploys and runs fine when compiled in sql developer. Once I compile it from SQL plus it stops working. It runs and using debug statements I can see the values are correct but it no longer inserts the data into the proper tables. I get ZERO errors or warnings when this is compiled in SQL Plus and no errors are generated from the code at run time. I've diffed the extracts of the code from the DB after each deployment and the only difference is the blank lines which SQL Plus strips out when you load the file. Has anyone run into anything remotely similar and if so how did you solve it? I've tried modifying the code to no avail, adding in comments to preserve the white space makes no difference. The thing that really kills me is that there is no error at all.
Ok this is the problem area.... vReplyMessage is a clob. I've replaced it in this section of processing with a varchar2(32000). And now it works. I still would like to know why though. Nothing is changed when I load it though sqlplus or sql developer but this line " update swn_recip_response_t set SWN_RECIP_RESPONSE = vTextReply where notification_id = v_notification_id; " would never execute with the clob. Logging showed that the clob had the correct value though. I am puzzled.
begin
call_SWNPost('http://www.sendwordnow.com/usps/getNotificationResults',vMessageText, vReplyMessage, v_status_code, v_status_phrase, '');
exception
when others then
raise eJavaException;
end;
vTextReply := dbms_lob.substr( vReplyMessage, 32000, 1 );
if (vDebug) then
update PEMS_PROD_2.SWN_POST_LOG set response = 'notif_id == '|| v_notification_id || 'status code == '|| v_status_code|| ' '||vTextReply where log_pk = vLogPK;
commit;
end if;
IF v_status_code = 200 then
v_has_error := 'N';
ELSE
v_has_error := 'Y';
END IF;
-- we handle all exceptions below in case something goes wrong here.
-- this area can die silently.
vTextReply := replace(vTextReply,'<getNotificationResultsResponse xmlns="http://www.sendwordnow.com/usps">', '<getNotificationResultsResponse xmlns:xyz="http://www.sendwordnow.com/usps">');
begin
insert into swn_recip_response_t(notification_id) values (v_notification_id);
exception
when others then
if (vDebug) then
err_num := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 100);
insert into PEMS_PROD_2.SWN_POST_LOG (LOG_PK, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
commit;
else
null;
end if;
end;
commit;
begin
update swn_recip_response_t
set SWN_RECIP_RESPONSE = vTextReply
where notification_id = v_notification_id;
exception
when others then
if (vDebug) then
err_num := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 100);
insert into PEMS_PROD_2.SWN_POST_LOG (log_pk, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
commit;
else
null;
end if;
end;
commit;
-- parse through the XML document and update the notification and recipient records
-- parse the clob into an xml dom object
begin
vReplyMessage := vTextReply;
...
Maybe you are looking for
-
Why did I have to buy Snow Leopard just to get my iPhone to work?
I received my new iPhone 4 this past week and when I plugged it in, it said my software was not up to date. At the time, I was running 10.4.11 and things were running great, which is why I continued to keep it there as it fulfilled the duties it need
-
Regd Integration of Domino.doc with Oracle 9i AS Portal
I want to know whether the integration of domino.doc with oracle 9i as portal is possible or not. Can anyone guide me whether the integration is possible or not and if it is possible which document should i refer for the same. and i dont know much ab
-
Create table statement in stored procedures
Hi, I am including the following statement in a stored procedure and receive the following error: STATEMENT: create table wrk_date (date date, qty smallint) tablespace temptabs; ERROR: PLS-00103: Encountered the symbol "CREATE" when expecting one of
-
Cockpit report-mapping of key figures in WAD
Hi, I'm working on a cockpit report wich consist of several different key figures combined together and shown for various months + some planning values. The key figures come from a multitude of infoproviders (and applications). So you would have a pl
-
i have a string such as 12/6/1988 {monday}.now i have the get value of date to create date object .how it can be possible to extract date.