Display tables in sqlplus
Hello guys,
What's the SQL command to display tables, views or the entire structure of a database?
Thank you.
Maybe the tables are not owned by the user you are logged in as. Try
ALL_TABLES, ALL_VIEWS etc. Check the manuals for all the other meta
views and tables you can try.
The topic is not specific to SQL*Plus. Followups are better posted to
the General Database forum General Database Discussions
-- CJ
Similar Messages
-
Trying to display tables reusing same code.
I'm probably being really naive but I just can't get this to work!
I have a display table class that will only display a one table when a button is pressed in a GUI. I want to use the same code again to display another table but pressing another button this time. ie: press "Table 1" button and the SQL query SELECT * FROM Customer should be used. Press "Table 2" Button and SQL query SELECT * FROM Order should be used. I have tried creating a constructor for this but it keeps coming up with errors. Please can you have a look at my code. The bits that don't work are commented out. I want to be able to just change the query that is used each time a different button is pressed.
Thanks in advance.
import java.sql.*;
import java.awt.*;
import javax.swing.*;
import java.util.*;
public class TableDisplay extends JFrame{
private Connection aConnection;
private JTable cusTable;
private String Query;
private String Title;
public TableDisplay() {
//public TableDisplay (String Query,String Title){
try {
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
aConnection = DriverManager.getConnection("jdbc:odbc:RelAlg", "", "");
catch (SQLException e) { System.exit(11);}
getTable();
setSize(450,150);
show();
private void getTable(){
Statement aStatement;
ResultSet aSet;
try{
aStatement = aConnection.createStatement();
aSet = aStatement.executeQuery("SELECT * FROM RelAlgCustomerTable");
//aSet = aStatement.executeQuery(Query);
displayResultSet(aSet);
aStatement.close();
catch (SQLException e) { System.exit(12);}
private void displayResultSet(ResultSet rs)
throws SQLException{
//position to first record
boolean moreRecords = rs.next();
//if there is no records display a message
if(!moreRecords){
JOptionPane.showMessageDialog(this, "ResultSet unable to find table");
setTitle("No table to display");
return;
setTitle("Customer Table");
// setTitle(Title);
Vector columnHeads = new Vector();
Vector rows = new Vector();
try{
//get column heads
ResultSetMetaData rsmd = rs.getMetaData();
for(int i = 1;i <= rsmd.getColumnCount();i++)
columnHeads.addElement(rsmd.getCatalogName(i));
//get row data
do{
rows.addElement(getNextRow(rs,rsmd));
while (rs.next());
//display tabel with ResultSet contents
cusTable = new JTable(rows, columnHeads);
JScrollPane scroller = new JScrollPane(cusTable);
getContentPane().add(scroller,BorderLayout.CENTER);
validate();
catch (SQLException e) { System.exit(13);}
private Vector getNextRow(ResultSet rs, ResultSetMetaData rsmd)
throws SQLException {
Vector currentRow = new Vector();
for (int i = 1; i<=rsmd.getColumnCount();++i)
switch(rsmd.getColumnType(i)){
case Types.VARCHAR:
currentRow.addElement(rs.getString(i));
break;
case Types.INTEGER:
currentRow.addElement(new Long(rs.getLong(i)));
break;
default:
System.out.println("Type was:" +rsmd.getColumnTypeName(i));
return currentRow;
public void shutDown(){
try{
aConnection.close();
catch (SQLException e) { System.exit(14);}
public static void main(String args []){
final TableDisplay app = new TableDisplay();
This is the code from the gui that displays the table on the press of the table button
void table1_mouseClicked(MouseEvent e) {
TableDisplay tDisp = new TableDisplay();
tDisp.show();
}what errors are you getting?
Where are you passing in the value for "Query" and assigning it to the class variable of the same name?
do this in the constructor:
public TableDisplay (String Query,String Title){
/////new line
this.Query = Query;
////end new line
try {
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
aConnection = DriverManager.getConnection("jdbc:odbc:RelAlg", "", "");
} -
How to move the data of a table from sqlplus to XML file
Hi,
Could you pls guide me how to move the data of a table from sqlplus to XML file.
i want to do it from sqlplus rather than toad.pls help
ThanksOh..I'm in 9i.
Try this out..and let me know.
DECLARE
CTX DBMS_XMLGEN.CTXHANDLE ;
XML CLOB ;
F UTL_FILE.FILE_TYPE;
XMLC VARCHAR2(32767);
BEGIN
CTX := DBMS_XMLGEN.NEWCONTEXT('SELECT * FROM department1 ') ;
XML := DBMS_XMLGEN.GETXML(CTX) ;
XMLC:=TO_CHAR(XML);
SHOW_ENVELOPE(XMLC);
F := UTL_FILE.FOPEN('ATTACH_FILES','DEPT.XML', 'W');
UTL_FILE.PUT_LINE(F,XML);
UTL_FILE.FCLOSE(F);
END ;
Good luck!!!
Bhagat
null -
How to display table range navigation bar at the bottom of the tr table i
Hello,
While I am using trinidad, I have to face a critical issue. Can I display table range navigation bar at the bottom of the <tr table> in Trinidad? and remove the range dropdown list, only show the "previous" and "next" link? The project is critical on the UI, this problem is very small but has to be fixed? Does anyone have any ideas?Difficult to do? No.
<ul id="bottom-nav"><li><a hef="whatever.php">whatever</a></li><li class="last"><a hef="whatever2.php">whatever2</a></li></ul>
With this CSS -
ul#bottom-nav {
list-style-type:none;
overflow:hidden;
width:70%;
margin:0 auto;
ul#bottom-nav li {
float:left;
padding-right:10px;
border-right:1px solid #FFF;
ul#bottom-nav li.last {
border:none;
ul#bottom-nav a {
/* your styles here */ -
Display Table contents using HTMLB...Urgent Help Plz...
Hello All,
Im working on EP SP14 and SQL Server 2000.
I have successfully established database connection.
I want to know <b>how can I display Table contents using TableViewModel in HTMLB</b>.
Please help.
Its urgent.
Awaiting Reply.
Thanks in advance,
Uday<b></b>See /thread/80270 [original link is broken]
(please stop crossposting every question into two forums; thanks in advance) -
How to hide this table if my record in display table =null?
i create a list to display record inside the table. If i wanna hide my table in case the list no any record. What statement should i add on? i may using <c:choose> ?
<tr>
<td colspan="3">
<fieldset>
<legend>CSC Listing</legend>
<table>
<tr>
<td colspan="4">
<display:table name="CSC" pagesize="10" id="csc" sort="list" defaultsort="3" requestURI="/csc.do?submit=SEARCH" class="model" >
<display:setProperty name="paging.banner.placement" value="both"/>
<display:setProperty name="paging.banner.some_items_found" value=""/>
<display:setProperty name="paging.banner.one_item_found" value=""/>
<display:setProperty name="paging.banner.all_items_found" value=""/>
<display:setProperty name="paging.banner.no_items_found" value=""/>
<display:setProperty name="paging.banner.onepage" value=""/>
<display:setProperty name="basic.msg.empty_list" ><center>No Record(s) was found.</center></display:setProperty>
<display:column ><html:radio property="cid" value="${csc.id}" /></display:column>
<display:column title="CSC ID" sortable="true"><cut value="${csc.merchantId}"/></display:column>
<display:column title="CSC Number" sortable="true"><cut value="${csc.merchantNo}"/></display:column>
<display:column title="CSC Name" sortable="true"><cut value="${csc.name}"/></display:column>
</display:table>
</td>
</tr>You need to use an IF statement. I dont use jstl so youll have to find the syntax yourself.
-
DB Connect after BI 7 Upgrade - can extract but not display table contents
Hi,
After an upgrade from 3.1 non-unicode to BI 7 unicode on Windows OS, SQL Server 2005 DB, the DB Connect connection to another SQL Server 2005 database is still established and passes all checks. We are also able to load data from the datasources previously established. However if we right-click the source system -> additional functions -> Select Database Tables (3.x), list the tables/views, double-click a view known to contain data, click 'Display Table Contents' and nothing happens. We can run a load from the datasource connected to the same view.
I have seen one unanswered post with the same issue. If anyone else has come across this problem and has some suggestions, it would be appreciated.
Note we have checked the normal issues on the SQL user having created the views and don't believe this is an authorisation issue. There is no authorization issue posted in SU53.
Support pack level is 16 on Basis and 18 on BW.
Thank you,
KenHi Ken,
The problem has happened in the past because fields in the table/view had lower case letters. This is not allowed. Please check the following documentation:
->http://help.sap.com/saphelp_bw320/helpdata/en/58/
54f9c1562d104c9465dabd816f3f24/frameset.htm
->Modeling ->Source System ->Transferring Data with DB Connect
->Requests to Database Tables and Database Views
->Naming conventions for fields
If the above is not the cause please check the note 512739 again to make sure everything is configured correctly:
Please make sure in particular that the section III (d) of the note entitled 'Authorizations and visible objects' has been correctly
followed.
Regards,
Des. -
Setting Two Headers in display Table
Hi,
I want to set 2 headers in display table like one is main header and one is sub header. Example is like following:
MAIN HEADER | MAIN HEADER |
SUB 1 | SUB 2 | SUB 3 | SUB 4 |
Data1 | Data 2 | Data 3| Data 4 |
I have to generate this type of table using <display:table> tag and also i
want this both headers to be fixed and the data to be scrolled in page.The data is to be scrollable both horizontally as well as vertically. The header and subheader would remain fixed when vertical scrolling and would scroll with data incase of horizontal scrolling.
Please help.
Thanks
Pranav.ParmarPanavar,
I presume <display:table> is http://displaytag.sourceforge.net/10/tagreference.html ... interesting.
1. have you tried <td colspan=2> ???
2. have you tried subtables for the subheadings ??? -
display:table.... /display:table export problem
HI,
when I wrote in the jsp:
<display:table pagesize="30" class="isis" name="contacts" export="true">
<display:column property="firstName"/>
<display:column property="lastName"/>
<display:column property="title"/>
<display:column property="gender"/>
<display:column property="phoneNumber"/>
<display:column property="email"/>
<display:column property="country.phonePrefix" title="Country"/>
<display:column property="birthdate"/>
</display:table>
There are Export | CSV | EXCL |xmL for users to export the table.
But when I click the CSV, there are nothing to do,
How can I do that?
thanks,Hi jcatino ,
Thank you very much.
But I also have another problem:
<display:table pagesize="20" class="isis" name="subscribers" id="subscriber" export="true" requestURI="manageContact.do">
<display:column sortable="true" >
<c:out value="${subscriber.UID}"/>
</display:column>
<logic:iterate id="group" name="groups" indexId="index2">
<logic:iterate id="extendedProfile" name="subscriber" property="extendedProfiles">
<logic:equal name="extendedProfile" property="source.id" value="${group.id}">
<display:column title="${group.name}">${extendedProfile.actualValue}</display:column>
</logic:equal>
</logic:iterate>
</logic:iterate>
</display:table>
The result that I got from clicking the "CSV" is that:
"<a href=\"manageContact.do?contactId=10&task=do_edit\">
10
</a>",VW Jetta owners,2005-3-2 00:00:00.000000000,aa,2233,2006-10-30 00:00:00.000000000,[email protected],12345
"<a href=\"manageContact.do?contactId=11&task=do_edit\">
11
</a>",VW Jetta owners,2004-2-28 00:00:00.000000000,aa,aacc,2006-11-30 00:00:00.000000000,[email protected],12345
How can I delete the <a..............> </a> ?
I have read information from the website : http://displaytag.sourceforge.net/configuration.html
However, I have no idea to solve it?
thanks you
happybaobao -
About the display:table.... /display:table problem
Hi,
<display:table name="contacts" export="true" >
<display:column property="firstName" />
<display:column property="lastName" />
<display:column property="title" />
<display:column property="gender" />
<display:column property="phoneNumber" />
<display:column property="email" />
<display:column property="country.phonePrefix" title="Country" />
<display:column property="birthdate" />
</display:table>
I wrote those codes,
But why the color is only gray? How can I get the color yellow?
Is it the reason I missed something?
thanks you very much,Hi,
I define a css file (bizCasterD.css) like that:
th { font-family: Verdana, Geneva, sans-serif; font-size: 12px; vertical-align: top; text-align: left; }
th.headerdisplay { color: #FFFFFF; background: #172972; font-family: Verdana, Geneva, sans-serif; font-size: 12px; border: 1px #FFFFFF solid; cell-padding : 0px; cell-spacing: 0px; display: table-header-group;}
td { color: #FFFFFF; font-color: #FFFFFF; font-family: Verdana, Geneva, sans-serif; font-size: 12px; vertical-align: top; }
td.itemlist { color: #3A6EA5; background-color: #FFFFFF; font-family: Verdana, Geneva, sans-serif; font-size: 12px; vertical-align: top; border: 1px #3A6EA5 solid; cell-padding : 0px; cell-spacing: 0px;}
then in the jsp:
<display:table name="contacts" export="true" >
<display:column headerClass="headerdisplay" property="firstName" />
<display:column headerClass="headerdisplay" property="lastName" />
<display:column headerClass="headerdisplay" property="title" />
<display:column headerClass="headerdisplay" property="gender" />
<display:column headerClass="headerdisplay" property="phoneNumber" />
<display:column headerClass="headerdisplay" property="email" />
<display:column headerClass="headerdisplay" property="country.phonePrefix" title="Country" />
<display:column headerClass="headerdisplay" property="birthdate" />
</display:table>
Unfortunately, the color is always grays, How can I do?
thank you very much, -
Hi all,
Is there any Fm that will display contents of transparent table. Right now i tried VIEW_MAINTENANCE_CALL but it is with tha maintemance menu I dont want that, i want to simply display table contents.
Regards
NileshHi
check the fun modules
CKML_F_GET_TABLECONTENTS
TRINT_DISPLAY_TABLE_CONTENTS
<b>Reward points for useful Answers</b>
Regards
Anji -
How to display table in editable mode
hi all,
I have displayed data using table wizard.Now i want to perform insert and delete row operations in table.but its displaying table in non-editable mode.
can anyone tell me, what should i do to display it in editable mode.
Thanks.Hi Swati,
Please refer the link,
How to display Table Control in Active mode
Regards,
Hema.
Reward points if it is useful. -
Cannot display table's data from an Excel File
Hi everyone,
I have uploaded my excel table to ODI but now i got an error message on a window that whenever I try to see the info and it says more o less the following:
Oracle Data Integrator Error
Cannot display table's data.
java.sql.SOLException: [Microsoft][ODBC Excel Driver) The Microsoft Jet database engine cannot open the tile '(unknow)', It is already opened exclusively by another user, or you need permission to view its data.
Has any one faced this issue before?
I assume that it is something with the ODBC, but as far as I know it was all right.
I would really appreacite any ideas on how to solve this issue.
Best regards.
JSomething is reading your file, have you got it open in Excel?
I've had similar issues reading Excel via ODBC with OBIEE - once a process opens it you might find you need to kill whatever it was and restart it.
So its either you or the ODI Agent / Console , try restarting it if its not you. -
How to display table data without using ALV and table element.
Hi,
Its possible to display table data without using ALV and table element.
Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
(every time i am fetching single row data ),
But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
settings and header data etc..things.
Give solution to display data part..
Regards,
Rakhi.Hi,
Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
* Standard Filter Function setting to FALSE
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
* Standard Filter Function setting to FALSE Ends
Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
Hope this answers your query.
Thanks.
Kumar Saurav. -
How to get an error icon with tool tip in a displaying table in a particu
How to get an error icon with tool tip in a displaying table in a particular field..
Thanks.Hi,
In the context create an attribute of type string .
Create the attribute in the node which you bind for table.
In the layout .
1.create a Table UI element.
2 create binding for UI element.
3Right click on the Table UI and select insert table column.
4.once the table column is inserted right click on table column and select insert cell editor.
5.create the cell editor of the type image.
6.Bind the source property of the image to the attribute in the node which you have created.
so depending on what image(type of icon) needs to be displayed set the attibute accordingly.
refer to the link for image :
[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d1/af8841349e1909e10000000a155106/frameset.htm]
Priya
Maybe you are looking for
-
how will i activate my iphone?and keep on asking link to an apple id that was used to set up this iphone
-
I downloaded Photoshop CS6 from the internet today onto my MacBook Pro and it is now on my desktop but when I double click on the icon, it only gives me a blank page and no options to complete the installation or to put in my serial number. Please he
-
ADF/JSF page loads when any command button is clicked
Hello All, I am lost in the ADF/JSF page flow (using Jdev 10.1.3). Following are the tags (in order) in my page; (WHEN THIS PAGE LOADS, IT GOES TO THE DATABASE TO GET VALUES (for the drop down lists that will appear on the page); THIS SHOULD HAPPEN J
-
High Speed Digital I/O using 6533
I would like to have a application sending out bit sequence through port0 of PCI 6533 card, and using port2 recieve those bits, then do a pattern matching. I set the output bit pattern changes at the 10th iteration of my control loop, however, I got
-
PS CS5 WONT UPDATE! NOTHING WORKS!
I am trying to update PS in CS5 as well as camera raw. The updates keep failing to install. I have tried what seems like everything and nothing seems to help. I am on a PC running Vista. Please help!