Karatas, FERHAT
I would love to change the world, but they won't give me the source code!
ORA-01843: not a valid month
6.10.2006 15:35:50 - Filed under : Oracle
"ORA-01843: not a valid month" or
"ORA-01830: date format picture ends before converting entire input string"

This error means that a date was used in the SQL but that Oracle did not consider the month to be a valid month.

False ;
AUDIT_MODIFY_DATE >= to_date('9/19/2006 3:13:10 PM','DD/MM/YYYY HH24:MI:SS')

True ;
AUDIT_MODIFY_DATE >= to_date('19/9/2006 3:13:10 PM','DD/MM/YYYY HH24:MI:SS')

when you use casting operation at datetime data like this:

DateTime lastActionDate = DateTime.Now;
lastActionDate = (DateTime)ds.Tables[0].Rows[0]["CREATEDATE"];

you may set your regional settings for datetime pattern at codebehind.

DateTimeFormatInfo.ShortDatePattern Property gets or sets the format pattern for a short date value.
At this time you can use below statements at top of your method :

CultureInfo c = new CultureInfo("tr-TR") ;
System.Threading.Thread.CurrentThread.CurrentCulture = c;
System.Threading.Thread.CurrentThread.CurrentUICulture = c;
ShortDatePattern = "dd/MM/yyyy";

Related Terminology : Oracle datetime problem, CurrentCulture, CurrentUICulture
with 0 comments

4.9.2006 01:38:58 - Filed under : Oracle
SQL Server:
SELECT TOP 10 product, descr, email FROM products

SELECT product, descr, email FROM products WHERE ROWNUM <= 10
Actually the code for Oracle only works if you do not ORDER BY. Let's say you have lots of records and you want to sort them by "product" and getting just the top 10 records. You can't do it by just:
"SELECT product, descr, email FROM products WHERE ROWNUM <= 10 ORDER BY product" The result is not what you wanted.

What "ROWNUM <= 10" does is simply return you top 10 record in the table.. if you try the ORDER BY code, it will simply extract the top 10 records in the table then ORDER it instead of ORDERING them then select the top 10.

Doesnt work :
SELECT product, descr, email FROM products WHERE ROWNUM <= 10 ORDER BY product

It works :
SELECT product, descr, email FROM (select product, descr, email from products order by product )

Related Terminology : Select TOP and Order By statement in Oracle
with 0 comments

ORA-01000: maximum open cursors exceeded
28.8.2006 09:37:21 - Filed under : Oracle
ExecuteNonQuery does not return any row, but it can open a cursor for an output parameter of a stored procedure if the output parameter is defined as a ref cursor. In this case, you should cast the OracleParameter into an OracleDataReader and call Close on the OracleDataReader when you're done with the cursor.The following bits of SQL should help you track down which cursors are causing the problem :
select user_name, status, osuser, machine, a.sql_text from v$session b, v$open_cursor a where a.sid = b.sid
So, this error means that somewhere cursors aren't being closed when opened. They will stay open until the database user is disconnected, which is probably why you're being forced to close the objects (reader).

Related Terminology : ExecuteNonQuery, ExecuteScalar, Open Cursors in Oracle
with 0 comments

View Oracle GUID in .NET
23.8.2006 10:08:14 - Filed under : C# | Oracle
Oracle GUID appearance is different in .NET.  But in action this conversation implemented automatically. If you want to see oracle GUID (as you can see in oracle) regularly you should use a function like this.
public string ByteToRawString (byte [] byteArray)
            string str="" ;
            for (int i = 0; i < byteArray.Length   ; i++)
                str+=String.Format("{0:x2}", byteArray[i]);
            return str.ToUpper();
Related Terminology : GUID, Byte Array, Oracle, .NET
with 0 comments

Name is already used by an existing object
23.8.2006 09:57:09 - Filed under : Oracle
You tried to create a table, view, index, synonym or other object with a name that is already in use. For a listing of objects with a particular name, you can run the following query:
SELECT * FROM all_objects WHERE object_name = 'NAME';
Action: The options to resolve this Oracle error are:

1. Rename your object that you are trying to create so that it is unique.
2. Drop the existing object and create the new object.

Related Terminology : ORA-00955
with 0 comments

Previous | Next
Current Page: 1