Home » SQL & PL/SQL » SQL & PL/SQL » Issue in "connect by level" (merged 3)
Issue in "connect by level" (merged 3) [message #407912] Fri, 12 June 2009 05:58 Go to next message
carthyc
Messages: 20
Registered: April 2005
Location: chennai
Junior Member
Hi Experts,

I am trying to populate 20 days from today. I used the below query.

select sysdate +level -1
from dual
connect by level <=20;

Query is working fine in my SQL Developer, but Its not returning same (20 dates) number of rows in other machines or tools (such as squriel..etc). Is there any session parameter restricts the output result?

Thanks in advance,
Carthyc

[Updated on: Fri, 12 June 2009 06:06] by Moderator

Report message to a moderator

Re: Issue in "connect by level" (merged) [message #407916 is a reply to message #407912] Fri, 12 June 2009 06:04 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Quote:
but Its not returning same (20 dates) number of rows in other machines or tools (such as squriel..etc).

And what do they return?

Use SQL*Plus you will not have problem.
quoting BlackSwan:
Those who live by the GUI, die by the GUI.


Regards
Michel
Re: Issue in "connect by level" (merged) [message #407925 is a reply to message #407916] Fri, 12 June 2009 06:51 Go to previous messageGo to next message
carthyc
Messages: 20
Registered: April 2005
Location: chennai
Junior Member
Hi Michel,

Sorry, I was bit hurry...
Will follow hereafter.

Thanks,
Karthi
Re: Issue in "connect by level" (merged 3) [message #407926 is a reply to message #407912] Fri, 12 June 2009 06:55 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Are you by any chance on Oracle 9i?

The Connect by rowgenerator technique worked slightly differently there - you had to wrap the row generator query like this: 'SELECT * FROM (<row generator>)'
Re: Issue in "connect by level" (merged 3) [message #407928 is a reply to message #407926] Fri, 12 June 2009 07:16 Go to previous message
carthyc
Messages: 20
Registered: April 2005
Location: chennai
Junior Member
Hi JRowbottom,

Thank you so much...It's working now.

Thanks,
Karthi
Previous Topic: How to load image in Long Raw column
Next Topic: if condition for inserts
Goto Forum:
  


Current Time: Fri Dec 02 14:26:19 CST 2016

Total time taken to generate the page: 0.13932 seconds