How to select even the column names of a table?
Hello All,
Is there a way to select even the column names of a table in the select statement?
My select from a table (say X) is in a SQL* Plus script that gets invoked by application tier and displays data in the application tier window. User's can then copy the data into a spreadsheet and do their processing. However, I need to give them the column names too along with the data.
Thanks,
Chiru
If there is a middle tier that is selecting and
displaying the data, and that's what the users are
copying from, the middle tier would have to address
its presentation of the data to allow users to
include column names. If this is a common task, the
application should probably be modified to give users
the option of downloading the data in a spreadsheet
directly rather than forcing them to copy and paste
data.Thanks for the reply.
The users don't have to copy paste. The application tier has an options in the "Tools" menu item which allows them to copy the entire output to a file (in my case a txt file which is a pipe delimited). Then they have to do text to columns to get the data into each column of the spreadsheet. I could have directly called the stored procedures from the application tier and created ".csv" files and FTP'd them to the user's folders. However, I am having to go this round about because, I am not getting enough support from the LAN team in FTP'ing etc.
OK I'll think of another workaround.
Thanks,
Chiru
Similar Messages
-
How to read the column name of a table from sap system using C#?
Hi!!
I am using SAP .NET connector and creating a windows application.
Now I wanna read the column name when a table name is given....
Connection is done, but I don't know the code to read the column names alone...
Can anyone help me with the code??fine!!
So if i give the table name, which the RFC_READ_TABLE function module have, will it run properly? or i wanna change all the codes in order to support RFC_READ_TABLE function module?
Because from the beginning I was using BAPI_CUSTOMER_GETLIST function, but my client requirement is to use ERP function module RFC_READ_TABLE, he didn't give any table name also..
This is my code: What I have to change in this???
ECCDestinationConfig ECCDestination = new ECCDestinationConfig();
RfcDestinationManager.RegisterDestinationConfiguration(ECCDestination);
RfcDestination rfcDest = null;
rfcDest = RfcDestinationManager.GetDestination(a);
RfcRepository repo = rfcDest.Repository;
IRfcFunction customerList = repo.CreateFunction("BAPI_CUSTOMER_GETLIST");
IRfcTable addressData = customerList.GetTable("AddressTable"));
int j = addressData.Metadata.LineType.FieldCount;
for (int i = 0; i < j; i++)
RfcElementMetadata metadata = addressData.GetElementMetadata(i);
listallcolumn.Items.Add(metadata.Name);
Message was edited by: Jeswin Rebil -
How can i know the Column Position in a table
Dear all
How can i know the Column position in a table ..
For example :-
I have a table
Desc EMPLOYEES
Empid
Ename
Sal
I want to know the Empid is in 1st position , ename is in 2nd position and sal is in 3rd position .
is it possible ?Hi
SELECT * FROM ALL_TAB_COLUMNS WHERE
TABLE_NAME ='EMPLOYEES' AND owner=<OwNeR nAmE> ;) -
Set the column name of a table in a list box
is there any code to set the column name of a table in a list box at oracle devloper 6i?
pls help.I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
;) -
How to re-arrange the columns present in pivot table view in obiee 10?
Can you please tell me How to re-arrange the columns present in pivot table view in obiee 10?
I have columns as 1,2,3,4,6,7, in pivot table view.
I have calculated item (column 5 as summation of 1,2,3,4) and caluclated itme (column 9 as summation of 6,7)...now if i arrange ascending then calculated columns 5,9 don't get affected.
I need the order as 1,2,3,4,5,6,7,9 -
How can i get the column names in CSV file.
Hi,
After execution of infospoke i can not see the column names in that file.How can i get column of respective infoprovider?
Thanks,
Gananadha LenkaHello Gana,
Actually while exporting the data using Info Spoke, we have the possibility to modify the data that we send. This is possible using transformations.
In your Info Spoke, you have a tab called Transformations.
Here you need to create an implementation and then use BADi to populate data.
Check if you can write a start routine sort of thing here and insert a new record into the internal table by hardcoding with your field headings.
Let me know if you dont know how to create transformations.
Kris... -
How to display the column names of a table in the output
Hi,
I want to display the name of the columns of the table without using literals in a abap report.
EX: Consider the table KNA1
KUNNR NAME ADDRESS
I want to display the column names in the above fashion without using hardcoded write statements.
Thanking in anticipationYou can use this FM <b>DDIF_FIELDINFO_GET</b> It gives you all the names related to fields in a table -:)
Greetings,
Blag. -
How can I list all the column names of a table by programming?
Hi,
Now I want to write an function which has the following features:
Firstly, The function was given a parameter as table name.
Then, it will lists all the columns names of the table.
e.g
table: person
---firstName------lastName----+
Michale Jackson
We can get the columns 'firstname' and 'lastName' by calling the function with table name 'person'.
And I also wonder that where I can get reference book or any other materials?
Thanks.
Edited by: wenjing wang on Feb 15, 2008 6:42 AM
Edited by: wenjing wang on Feb 15, 2008 6:57 AMhi,
hope the below code helps u. Just take the headee which contains the field name and split it like below and compare it with the field name u want here 'last name'.
here,
'First name' will be in wt_filedata1 and remaining field names in wt_filedata2, so 'do' continues.
c_tab must be the separator, either , or + or tab etc..
CODE:
read table person into wl_header index 1.
do.
split wl_header at c_tab into: wt_filedata1 wt_filedata2.
if wt_filedata1 <> 'lastname'.
cnt1 = cnt1 + 1.
wl_header = wt_filedata2.
else.
exit.
endif.
enddo.
Please reward if it is useful.
regards,
sri -
Hi ,
I have a table so many constraints on so many columns. I need to know which column has which constraint plsql dev?? like below...
table_name -------- col_name ------ constraint_name_of_that_col
xxxxxx xxxxxxx xxxxxxxxxxxxxxxx
or else please let me know how can i get the corresponding col_name for a particular constraint name???My be this can give you a help:
[code]
SELECT *
FROM ALL_CONSTRAINTS
WHERE R_CONSTRAINT_NAME IN (SELECT CONSTRAINT_NAME
FROM ALL_CONSTRAINTS
WHERE TABLE_NAME = 'TABLE_NAME'
[/code] -
How can I keep the column names in view on long spreadsheets?
I want to be able to see the column header names on long spreadsheets. In Excel you can create multiple panes in the window so as to keep both column and row headers in view. Any way to do this in numbers?
In Numbers 09 there is a similar feature; Freeze Header Row, or Column. It's only available in the Sheet View mode. In Print View mode, you can choose to Repeat Header on each page.
The controls are included in the Format Bar and Table Inspector, Heaader and Footer controls.
Jerry -
How to know primary key column name form a table name in sql query
Suppose I only know the table name. How to get its primary key column name from the table name?
ThanksViews don't have primary keys though their underlying tables might. You'd need to pick apart the view to determine where it's columns are coming from.
You can select the text of the view in question from user_views. -
How do I know the Column number after shifting table columns?
I create a table with column name "a", "b", "c"
Then I shift those column around..
Is there a way Java can tell me the column number of heading "b"? (For example)
Thanks!As mentioned above you generally don't need to worry about columns being moved but, from the JTable API, this may be what you are looking for:
int convertColumnIndexToModel(int viewColumnIndex)
int convertColumnIndexToView(int modelColumnIndex) -
Changing the Column name of a table horizontally
Hi ,
I have a table named emp.
Empno Sal
10 1000
20 2000
30 3000
40 4000
I need the output like
Empno 10 20 30 40
sal 1000 2000 3000 4000
Note: It should work for any table. Also not the column & row mapping which should be synchronised like the original structure.I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
;) -
Finding the column names from a table.
I am on 10g
I would like to find out the columns of a table where there are null columns in a table.....this table contains about 300 + columns where i do not want to put where condition for all the columns
is there a way i can write a sql to find?
for a given table or the results set that i need to get, i will have same results for all the rows, so it
cant be like col1 is null on row1, but col2 is not null on row2 ...they are all identical....
example table, but it has 300 + cols
F_IND H_IND P_IND DMA_IND
N N
N N
N N
N N Thanksselect count(col1), count(col2), count(col3), ...
from your table;
The results with 0s are null throughout the table (or the table has no rows). -
Just new to this and unable to find answers
My solution
Public Function GetTableColumnNames() As Boolean
Form1.ListBox1.Items.Clear()
_MDFFileName = String.Format("{0}.mdf", _DatabaseName)
_sqlConnectionString = String.Format("Data Source=(LocalDB)\v11.0;AttachDBFileName={1};Initial Catalog={0};Integrated Security=True;", _DatabaseName, Path.Combine(_DatabaseDirectory, _MDFFileName))
Dim cn As New SqlConnection(_sqlConnectionString)
'put the table name in brackets in case it has spaces in it
Dim SQLString As String = "SELECT * FROM [" & _TableName & "]"
Try
cn.Open()
Dim cmd As New SqlCommand(SQLString, cn)
Dim rdr As SqlDataReader =
cmd.ExecuteReader(CommandBehavior.KeyInfo)
Dim tbl As DataTable = rdr.GetSchemaTable
'This shows all of the information you can access about each column.
For Each col As DataColumn In tbl.Columns
Form1.ListBox1.Items.Add(col.ColumnName)
Debug.Print("col name = " & col.ColumnName & ", type = " & col.DataType.ToString)
Next
'Get each column.
For Each row As DataRow In tbl.Rows
Form1.ListBox1.Items.Add(row("ColumnName"))
Next
rdr.Close()
Catch
MessageBox.Show("Error opening the connection to the database.")
Finally
cn.Close()
End Try
Return _Success
End Function
Maybe you are looking for
-
Recording From wave source in Sonar 4
I am trying to mix down several tracks of audio in Sonar 4 into one track. When I select "wave" as the recording source and try to record, nothing records. Upon further investigation, it seems that the output from Sonar is NOT wave, because when i mu
-
Published App-V package doesn´t show icon
Hey Pro´s, I got a problem with one of the applications that I´m publishing with App-V (5.0 SP2). The icon I have chosen doesn´t show up, it just shows a default icon. I´ve already taken a look into the AppXManifest.xml which says: <appv:Shortcut><ap
-
Installing Oracle 10g R2 on Debian Sarge - Undefined reference
Hi all, I'm installing Oracle 10g R2 on debina sarge. I know this is possibile. But I'm only a problem during compilation: INFO: mv -f /opt/oracle/oracle/product/10.2.0/db_1/bin/dgmgrl /opt/oracle/oracle/product/10.2.0/db_1/bin/dgmgrlO INFO: mv /opt/
-
File or picture upload in survey tool
Hi, we want to use survey tool for gathering some information from customer location. Here there is a need to to provide a facility to user to load a file or picture.First of all can i do this using survey tool if so can anybody pls provide the way o
-
Batman Arkham Knight Midnight Openings June 22nd
I received the email that some Best Buy stores will be opening at midnight for the Arkham Knight release on Monday June 22nd. However there isn't a clear list of participating stores, is it possible to provide a list of the participating stores?