Click here to Skip to main content
15,886,825 members
Home / Discussions / Database
   

Database

 
QuestionNeed Oracle Column Names Pin
PDTUM27-Aug-11 11:46
PDTUM27-Aug-11 11:46 
AnswerRe: Need Oracle Column Names Pin
Luc Pattyn27-Aug-11 12:28
sitebuilderLuc Pattyn27-Aug-11 12:28 
GeneralRe: Need Oracle Column Names Pin
PDTUM27-Aug-11 14:56
PDTUM27-Aug-11 14:56 
AnswerRe: Need Oracle Column Names Pin
Luc Pattyn27-Aug-11 15:09
sitebuilderLuc Pattyn27-Aug-11 15:09 
GeneralRe: Need Oracle Column Names Pin
PDTUM28-Aug-11 4:53
PDTUM28-Aug-11 4:53 
AnswerRe: Need Oracle Column Names Pin
Mycroft Holmes27-Aug-11 13:11
professionalMycroft Holmes27-Aug-11 13:11 
GeneralRe: Need Oracle Column Names Pin
PDTUM27-Aug-11 14:54
PDTUM27-Aug-11 14:54 
GeneralRe: Need Oracle Column Names Pin
Mycroft Holmes28-Aug-11 14:43
professionalMycroft Holmes28-Aug-11 14:43 
Not sure if this is relevant anymore but here is the code that gets the tables and views from an oracle database. DBOpsO creates a valid oracle connection and executes a sql string to return a datatable.

C#
StringBuilder sSQL = new StringBuilder();
TableDB oTableDB;
sSQL.AppendLine("select T.owner,T.table_name, NVL (V.HasView, 0)HasView");
sSQL.AppendLine("From SYS.ALL_TABLES T ");
sSQL.AppendLine("left join (select owner,view_name, 1 HasView from SYS.ALL_VIEWS where owner in ('SchemaName1','SchemaName2')) V on upper(V.View_Name) = 'VW' || T.table_name ");
sSQL.AppendFormat("and V.owner = T.owner").AppendLine();
sSQL.AppendFormat("where T.owner in ({0})", sSchema.ToString()).AppendLine();
sSQL.AppendLine("order by table_name");

if (oDBOpsO == null || oDBOpsO.Creds.Database != oDB.DatabaseName)
{
    oDBOpsO = clsMain.GetDBOpsO(oDB.Server.ServerName, oDB.DatabaseName);
}

DataTable dtData = oDBOpsO.GetTableSQL(sSQL.ToString());

TableDB oTable = new TableDB();
List<TableDB> lTbl = new List<TableDB>();
foreach (DataRow orow in dtData.Rows)


Note I have a convention that all views are prefixed with 'vw'
Never underestimate the power of human stupidity
RAH

AnswerRe: Need Oracle Column Names Pin
A.J.Wegierski27-Aug-11 21:34
A.J.Wegierski27-Aug-11 21:34 
AnswerRe: Need Oracle Column Names [modified] Pin
Shameel27-Aug-11 23:28
professionalShameel27-Aug-11 23:28 
GeneralRe: Need Oracle Column Names Pin
PDTUM28-Aug-11 4:48
PDTUM28-Aug-11 4:48 
AnswerRe: Need Oracle Column Names Pin
PIEBALDconsult28-Aug-11 4:44
mvePIEBALDconsult28-Aug-11 4:44 
GeneralRe: Need Oracle Column Names Pin
PDTUM28-Aug-11 4:56
PDTUM28-Aug-11 4:56 
GeneralRe: Need Oracle Column Names Pin
Shameel28-Aug-11 8:33
professionalShameel28-Aug-11 8:33 
GeneralRe: Need Oracle Column Names Pin
PDTUM28-Aug-11 11:39
PDTUM28-Aug-11 11:39 
GeneralRe: Need Oracle Column Names Pin
Shameel28-Aug-11 22:30
professionalShameel28-Aug-11 22:30 
GeneralRe: Need Oracle Column Names Pin
PIEBALDconsult28-Aug-11 11:56
mvePIEBALDconsult28-Aug-11 11:56 
Questionselect statement group by Pin
salmonraju25-Aug-11 8:42
salmonraju25-Aug-11 8:42 
AnswerRe: select statement group by Pin
Chris Meech25-Aug-11 9:15
Chris Meech25-Aug-11 9:15 
AnswerRe: select statement group by Pin
Corporal Agarn25-Aug-11 9:51
professionalCorporal Agarn25-Aug-11 9:51 
QuestionSQL Nominal Date Conversion [modified] Pin
Member 408789025-Aug-11 3:41
Member 408789025-Aug-11 3:41 
SuggestionRe: SQL Nominal Date Conversion Pin
Shameel25-Aug-11 5:39
professionalShameel25-Aug-11 5:39 
GeneralRe: SQL Nominal Date Conversion Pin
Simon_Whale25-Aug-11 5:48
Simon_Whale25-Aug-11 5:48 
GeneralRe: SQL Nominal Date Conversion Pin
Shameel25-Aug-11 9:10
professionalShameel25-Aug-11 9:10 
QuestionSQL database Pin
Emejulu JVT25-Aug-11 2:25
Emejulu JVT25-Aug-11 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.