New answers tagged

1

Return is basically translated as: "End execution of this routine, and pass control back to the caller .. oh, and hand this value back to them on the way .." So that code will NEVER reach the "return b3" or "return b4" ... just won't happen. also, this might be more "robust" logic for checking for a leap year ;) if add_months(trunc(sysdate,'YEAR'),2)-1 ...


0

Your outer select is incomplete, it has no FROM clause. Once that's fixed your query may work, if not try putting each of the sub selects inside of a pair of parenthesis, and possibly the whole operation. Insert Into Production(A, B, C) SELECT A , B , ( (SELECT SUM(Month_Production) FROM Production) / (SELECT COUNT(Month_Production) ...


2

Thats is not what you should execute. sma is the procedure, c4 is simply a cursor in it. You do not execute the cursor local to a procedure, you can not even access it. Execute the below: set serveroutput on begin sma; end; /


1

You try to connect with / as sysdba, which normally connects locally, and you still get errors related to TNS and listener. Actually, there is a not well-known environment variable, called TWO_TASK, and if you set that, SQL*Plus will automatically try to connect using the value of the variable as a TNS entry. So if you use TWO_TASK, instead of this: ...


0

something is very "off" in that terminal session. You are not connecting with a net description, so you shouldn't even be hitting the listener at all. I cannot reproduce that error with that syntax. In any event, your syntax really should be sqlplus / as sysdba with a space between the slash and the 'as', and no quote marks.


3

The problem is in the NLS_NCHAR_CHARACTERSET = UTF8. I simulated the same table in a different database with NLS_NCHAR_CHARACTERSET = AL16UTF16. The describe statement shows the correct length as defined while creating table. UTF8 can be 1, 2, 3 or 6 bytes / character, any AL32UTF8 character that is 4 bytes will be stored as 2 time 3 bytes in UTF8. If you ...


2

I'm quite sure that this is a problem of SQL Developer... Retry to desc table after issuing: alter session set NLS_LENGTH_SEMANTICS='CHAR'; Is correct now? If not try to desc the table using sqlplus on the database server bypassing the Oracle Listener: >export NLS_LANG=AMERICAN_SWITZERLAND.AL32UTF8 >export ORACLE_SID=<YOURINSTANCESID> ...



Top 50 recent answers are included