Home » Developer & Programmer » Forms » Diff bet Rownum And Rowid (ORA-01445 using ROWID in Forms)
icon11.gif  Diff bet Rownum And Rowid (ORA-01445 using ROWID in Forms) [message #137447] Thu, 15 September 2005 04:52 Go to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
HI Experts,
Whats the difference between the follwing two queries:-
SELECT COUNT(ROWID) FROM EMP WHERE DEPTNO=10;
SELECT COUNT(ROWNUM) FROM EMP WHERE DEPTNO=10;

Whats the internal difference between these two as they are returning the same result.

Thanks And Regds
Dinesh Cool Laughing Mad Razz Embarassed


[MOD-EDIT: changed title, sorry Wink]

[Updated on: Thu, 15 September 2005 07:54] by Moderator

Report message to a moderator

Re: Diff bet Rownum And Rowid [message #137461 is a reply to message #137447] Thu, 15 September 2005 05:37 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
At the top of the page, there's a search button. It produces the following results:

What is diffrence between rowid and rownum
concept of rowid,rownum
diff btn rowid and rownum


MHE

[Updated on: Thu, 15 September 2005 06:21]

Report message to a moderator

Re: Diff bet Rownum And Rowid [message #137467 is a reply to message #137461] Thu, 15 September 2005 05:51 Go to previous messageGo to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
Great
Re: Diff bet Rownum And Rowid [message #137480 is a reply to message #137461] Thu, 15 September 2005 06:20 Go to previous messageGo to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
hi mhe,
the basic difference i got but whats the difference in the sql statement, as they are giving me the same result so can i use any one of them.
Or is there any restriction.

Thanks
regds
dinesh
Re: Diff bet Rownum And Rowid [message #137481 is a reply to message #137480] Thu, 15 September 2005 06:23 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
No restriction that I know of. You count records. It doesn't matter what (pseudo-)column you count. I personally use count(1) or count(*)

MHE
Re: Diff bet Rownum And Rowid [message #137485 is a reply to message #137481] Thu, 15 September 2005 06:31 Go to previous messageGo to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
hi Mhe,
One error ORA-01445 I got when i am using ROWID in one sql statement of one of my forms, but if i am replacing it with ROWNUM, the error does not occour.

Then there must be some difference between these two.

With regds
dinesh
Re: Diff bet Rownum And Rowid [message #137492 is a reply to message #137485] Thu, 15 September 2005 06:53 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
Dinesh, if you put a bit of effort in and search for the error message, either on google, or through the documentation (which I know you must have by now since you have been given dozens of links to it) the error message will tell you EXACTLY why that query is not working.
C'mon mate, you've been posting as long as I have and I know to at least put in a bit of effort to resolve my own problems.
Smile
Jim
Re: Diff bet Rownum And Rowid [message #137500 is a reply to message #137485] Thu, 15 September 2005 07:10 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
d.dineshkumar wrote on Thu, 15 September 2005 13:31

hi Mhe,
One error ORA-01445 I got when i am using ROWID in one sql statement of one of my forms, but if i am replacing it with ROWNUM, the error does not occour.


Huh? Forms? That's new information.

MHE
Re: Diff bet Rownum And Rowid [message #137522 is a reply to message #137500] Thu, 15 September 2005 07:44 Go to previous messageGo to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
Ok..Experts...
Thanks to all.

Let me search in Google( The Great God For A Programmer )


Thanks And Regards
Dinesh
Re: Diff bet Rownum And Rowid [message #137528 is a reply to message #137522] Thu, 15 September 2005 07:53 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Well, Forms has its own particular issues. You failed to mention that this was a Forms issue, I'm moving this thread to the Forms forum.

MHE
Re: Diff bet Rownum And Rowid [message #137639 is a reply to message #137528] Thu, 15 September 2005 18:09 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If you go to http://www.err-codes.com/oracle/ORA-01445.htmlyou will see the following
Quote:

ORA-01445 cannot select ROWID from a join view without a key-preserved table
Cause: A SELECT statement attempted to select ROWIDs from a view derived from a join operation. Because the rows selected in the view do not correspond to underlying physical records, no ROWIDs can be returned.
Action: Remove ROWID from the view selection clause, then re-execute the statement.

So I suppose it depends via what you do the select. Via a table - okay, from a non-updatable view - nope.

David
Re: Diff bet Rownum And Rowid [message #139003 is a reply to message #137639] Mon, 26 September 2005 05:09 Go to previous messageGo to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
Thanks.


Regds
Dinesh Idea
Re: Diff bet Rownum And Rowid (ORA-01445 using ROWID in Forms) [message #202426 is a reply to message #137447] Thu, 09 November 2006 13:52 Go to previous message
harleenflora
Messages: 44
Registered: June 2006
Member
rowid is an internal representation of a row in a table, it is effectively the primary key and can be used for fast access to the row (but can chance)

rownum is a function of a result set of your query, i.e select * from emp where rownum = 1 will get the first row of your result set.

So rowid is a function of the table. rownum is a function of the result set
Previous Topic: how to create calculated item in Forms Version 4.5.8.1.2
Next Topic: how to validate a record in oracle form?
Goto Forum:
  


Current Time: Fri Sep 20 12:27:32 CDT 2024