| |

VerySource

 Forgot password?
 Register
Search
View: 1200|Reply: 6

How to use T-SQL statement to all fields of a view in Oracel?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-27 14:00:01
| Show all posts |Read mode
As the title; in SQLserver, as long as I know the name of the view, I can get all the fields of the view by querying two system tables. How can I achieve this in Oracle?
Reply

Use magic Report

0

Threads

10

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 Invalid IP Address

Post time: 2020-2-21 13:45:02
| Show all posts
select * from user_tab_column where table_name = 'xxx'
Reply

Use magic Report

0

Threads

71

Posts

50.00

Credits

Newbie

Rank: 1

Credits
50.00

 China

Post time: 2020-2-21 17:30:01
| Show all posts
select view_name, text from user_vies where view_name = upper ('yourname');
Reply

Use magic Report

0

Threads

71

Posts

50.00

Credits

Newbie

Rank: 1

Credits
50.00

 China

Post time: 2020-2-21 22:15:01
| Show all posts
The above statement gets the view creation statement

still alright

select * from user_tab_column where table_name = upper ('yourname');
Get field names and comments
Reply

Use magic Report

0

Threads

13

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-3-9 11:30:01
| Show all posts
sqlplus window:
SQL> desc view_name
This won't do
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-31 12:15:02
| Show all posts
The brother upstairs can indeed get the data I want, but I have to get it through ADO.NET, what should I do? I have just contacted Oracel, I hope you can elaborate a little bit, I am grateful and disrespectful
Reply

Use magic Report

0

Threads

13

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-4-14 10:15:02
| Show all posts
select * from view_name where rownum <2
Column information can be obtained by using the fields property of ADO.NET
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list