Print the name of the column by using the query
HelloI need to print the column name and the number of number of columns i.e. columns in the query below. Please suggest me how to print
SELECT
E.EMPNO,
E.ENAME,
D.DEPTNO
FROM EMP E,.
D DEP.
WHERE
E.DEPTNO = D.DEPTNO
Please suggest
Thank you
Sudhir
Re: get the title of column
http://saubbane.blogspot.com/2011/01/how-to-find-column-count-of-query.html
Re: writing data from table to file
Published by: Johan July 5, 2011 16:28
Tags: Database
Similar Questions
-
Hello
Kindly let me know how to print the query, and the parameters passed to it? I tried with the params parameter in super.executeQueryForCollection (qc, params, noUserParams); but could not succeed.
I need save the query and the parameters passed to it. Kindly help.
Thanks in advance,
Kalpana.
Here you go
Coding with Passion: Oracle ADF - Debug Mode object query with parameters
-
Best way to get different counts on the same column by using a query.
Hello
I try to get three different counts of the values for a specific ID on a table. In other words, I have an Id if 1-123 and 20 records with that ID in this table, which have a value of 'Y' or 'n'. I'm looking for the number of each of these values for every 20 rows, but also a number of total values of tag values using the function count in a single query.
In this spirit, I would like to see a result set as follows.
Example of result set:
1-123 5 15 20
I thought that I would be able to do this by using the following query below, but it didn't work and I get a ' error absent expression. If anyone can provide guidance on my query below or any other way to reach my goal I would really appreciate it.
Query:
Select a.par_row_id,
countOfTagsNo.TagsNo as 'Tags not selected. "
countofTagsYes.TagsYes as 'Tags selected. "
countOfTagsTotal.TotalTags as 'Total Tags'
of siebel.s_src_xm.
(select par_row_id, count (attrib_08)
of siebel.s_src_xm
where type = 'AOI Tags' and attrib_08 = 'n')
countOfTagsNo,
(select par_row_id, count (attrib_08)
of siebel.s_src_xm
When type = "AOI Tags' and attrib_08 = 'Y')
countofTagsYes,
(select par_row_id, count (attrib_08)
of siebel.s_src_xm
When type = 'AOI Tags' and (attrib_08 = 'Y' or attrib_08 = 'n'))
countOfTagsTotal
where a.par_row_id = countOfTagsNo.par_row_id and
a.par_row_id = countofTagsYes.par_row_id and
a.par_row_id = countOfTagsTotal.par_row_id
A.par_row_id group;
Thanks in advance.
Chris
Hi Chris,
I'm not sure that's what you want but you had probably better counting with nested decode (or case):
Select a.par_row_id,
Count (case when type = 'AOI Tags' and attrib_08 = ' don't then 1 end) as "Tags not selected."
Count (case when type = 'AOI Tags' and attrib_08 = 'Y' then 1 end) as "Tags selected."
Count (case when type = 'AOI Tags' and (attrib_08 = 'Y' or attrib_08 = 'n') then 1 end) as 'Total Tags.
of siebel.s_src_xm
A.par_row_id group;
-
How can I print the www.lesormes.com view
I use jdeveloper 11.1.2
I have search form build by setting "variable bind" in my display object
I did drag the fields of research of the "executeWithParams" tree in my data controller
and the search button is the button "executeWithParams".
I have a strange behavior, so I need to print the query run when I press the button "executeWithParams".
How can I docheck http://codingwithpassion.blogspot.com/2010/11/oracle-adf-write-view-object-query-with.html
-
Y at - it an option to print the names of columns?
Hi developers out there!
Problem:
When I try to print the data in the table, the names of columns like "COL01', 'COL02' and so on.
But initially, they have other names.
Am I missing something?
Best regards
Ruslan.If you go to your report and click on the 'Report Attributes' tab. You will see all the names of your column headers. and a group of radio buttons at the top of the page. Select custom, and then change the names of your column headers.
In addition, it seems that on your 'Definition of the region' tab in the Source box, you checked the option button "use generic column names (analysis of query runtime only). Try to select the other radio button "use query column names-specific query and validate.
Good luck.
-
How to print the name of the .sql file in the same file using sqlplus
Oracle 10g on Linux platform.
I am trying to print the name of the .sql script file in this file, but could not. Here is the file:
test. SQL
But instead of print, it is asked for the entry:select '&0' from dual;
Can any body give me a clue as how can I print the name of the file.SQL> @test.sql Enter value for 0:
A quick Google search and I found this...
http://blog.tanelpoder.com/2007/12/26/sqlplus-is-my-second-home-part-5-reading-the-name-of-currently-executing-script/
Content of a1.sql
appinfo set to
Select sys_context (' USERENV', 'MODULE' ') of double;He'll be back...
SQL > @a1SYS_CONTEXT ('USERENV', 'MODULE')
-------------------------------
01 @ a1.sqlJames.
-
new to 4.02, no grid or column names in the query results
It is a bit strange, I have SQL Developer 4.02 just installed, and I don't see grid or column names in the query results. Don't see anything useful in tools > Preferences, what don't get me?
The worksheet gives you a couple of different ways to run a query...
1. instruction execute sheet icon toolbar (large green arrow, or Ctrl + Enter).
This produces a results tab of the query with the data displayed in a grid.
2. worksheet icon toolbar Execute the Script (the small tip of the green arrow on lined paper, or F5).
This produces a tab out of the Script with the data displayed on the printer.
If execution of the statement to Execute the Script, using some SQL * most orders will remove the column headers:
1. set the position
2. set the pagesize 0 (or 1 or 2).
Pagesize and linesize default is - 1. By default, the spreadsheet is free for formatting output script as he wishes. If you have not changed these settings in the spreadsheet, then see if you point to a startup script in Tools > Preferences > Database > name of the connection startup script file
Kind regards
Gary
SQL DeveloperTeam
-
How can I print my lists of distribution for later use if the drive breaks down?
Had a problem with the hard drive on the new computer. Company reloaded hard drive. Lost all email addresses. Had to manually type in THE addresses again. Is there a way I can save my addresses to disk or print it out on paper for later use if I lose them again?
Open the address book window.
Select tools-export
Select the type of file.
The name of the file.
Choose where to save it. -
is it possible to print the name and the location on the page documents
I would like to print the file names and locations of my documents Pages, as well as the text of the documents. used to do in Word all the time. can't find this print option across Pages.
Apple has intentionally excluded any iota of features of Microsoft Word of Pages. Thus, it is not a clone of Word and does not use a Microsoft Print panel. You have no ability to assign printing header or footer fields in the print output from the OS X Print Panel.
-
y at - it an option to print the ip address or the name of pc at the bottom of each page printed, sent by this pc.
I don't think that there is no easy way to do it.
Alternatives can be:
- Maybe insert the data required in the document source (before printing), using features (such as headers/trailers) supporrted by application of document source (for example, Word); drawbacks to this are not all applications supporting these inserts and (once inserted) what happens if the source document is copied to another work station?
- Rather than insert "pc name" or "ip address", you can maybe automatically insert 'document name' on each page ( watermark) If you are using one of the latest HP Universal Printer Drivers - see http://h30434.www3.hp.com/t5/LaserJet-Printing/Print-current-date-on-each-document/m-p/5734909 for a brief discussion of something similar ('date/time' rather than 'username').
-
Print the computer name on each page using a network printing
Dear all,
Help on this issue. I want to print the username in each page using the network printer. To identify which print this page.As much as I know that you can't do this with every printed page, but you can use the separation pages (* .sep) and have this printed on a single page at the beginning of each print job.
Tip: Put the separator page in the folder % WINDIR%\System32.
See here: http://support.microsoft.com/kb/102712
.Sep file is just a text document, the following prints only the user name:
Name $LUser $N
$EJohn
-
HP LaserJet P2050 Series PCL6: How to print the mark using PCL commands
Our old system is printing of document using PCL commands, previously, only contanins text and barcode (using BARDimm), but we need now to print the mark registered with the name of the company, that the police should I use which has this symbol? Thank you.
Assuming that your old system uses PCL5. You must first issue a set of symbol code that has a mapping to the registered symbol. The Windows Latin 5 symbol set has the R symbol maps to chr (174) or (0xAE) said in
Hex. The first publication of the code for the symbol set...
(5 T and then the character itself
0xAE
Now that the characters cannot be entered directly on the keyboard, then you will need to find a way to integrate the character in your print workflow.
Before the character himself is printed, you should choose a font. For most, if not all, printer fonts probably supports this defined symbol. For the test I used the arial font and it printed fine. The code for arial 12 pt would be...
(s1p12v0s0b16602T Specify police, symbol set and finally the character. When you printed the character that you'll want to come back to the police in the use and the previous symbol set OR you can print the symbol as a secondary font. If you don't know how, ask here.
I now have the idea how you would do this with PCL6. @dansdaduk can give you good (or bad) news on that.
-
How to print the name of the folder and its subfolder names
I have a folder with miltiple sbu-records. I need to print the name of the folder and related subfolders. How can I do this?
If you need it in a tree hierarchy, use this command:
1 hold down the SHIFT key and right-click on the folder.2. click on command window open here.3. type the following command:TREE | Clip4. open your word processor, and then press CTRL + VThis glue entries to the directory tree. -
request to retrieve the value of the column and use in the other rows of the table
Hi all
I have a table where I maintain pairs name / value of a particular job. Now, I would like to see some of the values of the rows passed to other rows in a table for example
create job_name_value
(
VARCHAR2 (100) job_name,.
name varchar2 (100),
value varchar2 (100)
);
job_name name value TRGJOB % FPATH / USR/LOCAL/TRGJOB TRGJOB % FDATE CALDATE + 1 TRGJOB $FNAME1% %FPATH.mywatchfile1.%FDATE TRGJOB FNAME2% %FPATH.mywathcfile2.%FDATE TRGJOB % FNAME3 %FPATH.mywatchfile3.%FDATE can we write a sql query to produce output as below the objective is to use the value of fdate and fpath in the remaining lines. If there is no fdate and fpath then value should return such what or we need to use the stored procedure to achieve
/ usr/local/trgjob/mywatchfile1. CALDATE + 1
/ usr/local/trgjob/mywatchfile2. CALDATE + 1
/ usr/local/trgjob/mywatchfile3. CALDATE + 1
Hello
Since it cannot be '% FDATTE' or '% FPATH' (or both) then you need to replace each of them separately. If the other does not, there 'replacement' will do nothing, but this will not affect the result of the other.
Here's a way to do it:
SELECT REPLACE (REPLACE (n.value
'% FPATH.'
p.value | '/'
)
, '% FDATE '.
d.value
) AS output_value
OF job_name_value n
LEFT OUTER JOIN job_name_value p ON p.name = '% f '.
LEFT OUTER JOIN job_name_value d ON p.name = '% FDATE '.
WHERE n.name AS '\%FNAME%' ESCAPE ' \'
;
I hope that answers your question.
If this isn't the case, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
Report when the above query is to give erroneous results and explain, using specific examples, how to get the correct results of data provided in these places. If you change the query at all, your postal code.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum: https://forums.oracle.com/message/9362002#9362002
-
How to view the line of columns without using the pivot keyword
Hello
could someone help me how to display lines in columns without using the keyword pivot and actuall is my scenario, iam having two tables with names and examples of data is shown below
MIDDLE MINAME TASKID TASKNAME IDENTIFICATION PROJECT
1 PROJ1 1 AA 100 PR1_TASK1
1 PROJ1 3 CC PR1_TASK3 102
1 PROJ1 DD 4 103 PR1_TASK4
1 PROJ1 EE 5 104 PR1_TASK5
1 PROJ1 6 105 FF PR1_TASK6
2 PROJ2 EE 5 114 PR2_TASK1
2 PROJ2 6 115 FF PR2_TASK2
2 PROJ2 GG 7 116 PR2_TASK3
2 PROJ2 HH 8 117 PR2_TASK4
2 PROJ2 9 118 PR2_TASK5 JJ
2 PROJ2 KK 10 119 PR2_TASK6
2 PROJ2 1 AA PR2_TASK7 120
The output should show the project and County of tasks at a given stage as shown below
project AA BB CC DD EE FF GG HH JJ KK
1 2 0 1 5 3 2 0 2 1 0
2 1 2 0 2 1 0 2 4 3 1
Thanks in advance,
VVRCREATE TABLE pivot_test ( ID NUMBER, PROJECT VARCHAR2(10), MID NUMBER, MINAME VARCHAR2(5), TASKID NUMBER, TASKNAME VARCHAR2(10) ); INSERT INTO pivot_test VALUES (1, 'PROJ1', 1, 'AA', 100, 'PR1_TASK1'); INSERT INTO pivot_test VALUES (1, 'PROJ1', 3, 'CC', 102, 'PR1_TASK3'); INSERT INTO pivot_test VALUES (1, 'PROJ1', 4, 'DD', 103, 'PR1_TASK4'); INSERT INTO pivot_test VALUES (1, 'PROJ1', 5, 'EE', 104, 'PR1_TASK5'); INSERT INTO pivot_test VALUES (1, 'PROJ1', 6, 'FF', 105, 'PR1_TASK6'); INSERT INTO pivot_test VALUES (2, 'PROJ2', 5, 'EE', 114, 'PR2_TASK1'); INSERT INTO pivot_test VALUES (2, 'PROJ2', 6, 'FF', 115, 'PR2_TASK2'); INSERT INTO pivot_test VALUES (2, 'PROJ2', 7, 'GG', 116, 'PR2_TASK3'); INSERT INTO pivot_test VALUES (2, 'PROJ2', 8, 'HH', 117, 'PR2_TASK4'); INSERT INTO pivot_test VALUES (2, 'PROJ2', 9, 'JJ', 118, 'PR2_TASK5'); INSERT INTO pivot_test VALUES (2, 'PROJ2', 10, 'KK', 119, 'PR2_TASK6'); INSERT INTO pivot_test VALUES (2, 'PROJ2', 1, 'AA', 120, 'PR2_TASK7'); SELECT ID as PROJECT, SUM(DECODE(miname, 'AA', 1, 0)) AS AA, SUM(DECODE(miname, 'BB', 1, 0)) AS BB, SUM(DECODE(miname, 'CC', 1, 0)) AS CC, SUM(DECODE(miname, 'DD', 1, 0)) AS DD, SUM(DECODE(miname, 'EE', 1, 0)) AS EE, SUM(DECODE(miname, 'FF', 1, 0)) AS FF, SUM(DECODE(miname, 'GG', 1, 0)) AS GG, SUM(DECODE(miname, 'HH', 1, 0)) AS HH, SUM(DECODE(miname, 'JJ', 1, 0)) AS JJ, SUM(DECODE(miname, 'KK', 1, 0)) AS KK FROM pivot_test GROUP BY ID; PROJECT AA BB CC DD EE FF GG HH JJ KK ------- -- -- -- -- -- -- -- -- -- -- 1 1 0 1 1 1 1 0 0 0 0 2 1 0 0 0 1 1 1 1 1 1
Maybe you are looking for
-
New wifi router installed. Because then I can usually connect sites OK but when getting around a site or to another, I lose connection even though Windows said signal is excellent. Toggle heals the problem temporarily. Two tablets under the same roof
-
On the Portege M800-11J SD card reader problems
Hi all I hope that someone here will be able to help me with a problem. I have a new laptop Portege M800-11J and I try to use a 4 GB SD card in the embedded player. The laptop crashes and allow me to format the card or read. If I use a USB drive, it
-
the cutting tool - what is it and what is used?
I open, that needs to be done or what is used for = explain it please '
-
Hello A few days I got laptop from my uncle to copy some files, I plugged my USB without knowing he had a virus in there. Later, I plugged USB on my pc (which has windows xp inside) and copied the files. I noticed in my USB a folder named 'My documen
-
Windows 7 do not send documents to Hp Officejet Pro 8625
Someone had a problem with Windows 7 release do not with the HP Officejet Pro 8625 all in one. I can print wireless from my Mac Book Pro, but not from my Acer laptop with Windows 7. When I send a document to print from my Windows 7, I would like to