Dependent on the value of query column names
Hi guys, I don't think this is possible, but I thought I'd give it a go.I am wanting to values that are returned by my query as column headings. For example:
SELECT 1,2,3,4,5
OF trade_table
WHERE < 6
The table contains 10 records, "A1", "B1", "C1", "D1", "E1", "F1" etc... and my query returns 5 records of each with a rating of 1 to 5. The first record in the standings, lets say "D1" must be the column heading.
I'm extremely sorry for being vague, but my request first contains a lot of analytical functions and I try to simplify it.
Thanks in advance.
To do this with the reporting you tool use and not with SQL and PL/SQL.
Tags: Database
Similar Questions
-
How to get the value of a column in sql query?
Hi, anyone knows how to get the value of a column in sql query?
Here is my code, the value must be 1350079224397 in my PB, but I get 0
QString query ("SELECT version FROM db_version");
QVariant result = sda.execute (query);
QVariantMap versionMap = result.toList () such () .toMap ();
If (! versionMap.IsEmpty ())
{
qDebug()<"Version: "="">"Version:><>
}OK, I have the solution
QString query ("SELECT version as version FROM db_version");
-
SQL query to find the value of a column as well!
Hi all
I have to write a query that needs to retrieve the value of a column in table B if the column value is Null in the Table A. Please find below the sample table.
Table A:
*******
EmpNumber ID
------------------------------
1 12345
2
3 14789
4
5 74563
Table B:
*******
EmpNumber ID
-----------------------------
1 12345
2 78451
3 14789
4 12212
5 74563
In the table a second and third rows have value for EmpNumber. The query should look for table B for EmpNumber value. Please advise me to make this request.
Thank youThis?
select a.id, nvl(a.empnumber,b.empnumber) empnumber from tabA a, tabB b where a.id = b.id;
-
How to dynamically change the value of a column in a report
Hi, I'm new to APEX and I have a small requirement. I have a report in a page which I query. Report will always have only one record. I need to change a value of a column in this report of the value received from another page. I was able to send the value of another page on my page of reports to a hidden page element, but I don't know how I can configure this value received to this column in the report. Is this possible? If Yes, can anyone help with this?
970829 wrote:
Please update your forum profile with a real handle instead of '970829 '.
Hi, I'm new to APEX and I have a small requirement. I have a report in a page which I query. Report will always have only one record. I need to change a value of a column in this report of the value received from another page. I was able to send the value of another page on my page of reports to a hidden page element, but I don't know how I can configure this value received to this column in the report. Is this possible? If Yes, can anyone help with this?
Not really clear exactly what it is you are trying to reach. You want to replace the value of a column in the report with the value of a page element? If so, simply replace the column in the report with a reference to the required page elementquery:
select empno , ename , job , :p2_sal sal -- Replace value of sal column with value of P2_SAL item from emp
-
How to set the value of a column in a table according to another column?
Hello world!
I use Apex 4.1.
My question is how can I set the value of a column in a table according to another column?
I have a table and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).
I tried to use javascript as
for the development of the column note to test if the value typed in the content of the column is not 1, but this code assigns the value to all the lines and I need to set only the specified line.$('input[name=f02]').live('change', function(){ if($(this).val()!='1'){ $('input[name=f03]').val("test")} });
Can someone give me a hint in any way to do this if possible?
Kind regards
drama9346You will need create a process on your page type PLSQL and develop this process "we demand" of the page. In this process, you can run the PLSQL you need. That is to say to retrieve the note value as described in your PC:
and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).
In this process, you must provide a return value of the call, and you can do this by using htp.p. Example:
DECLARE --putting x01 in a var to simplify l_test_var VARCHAR2(200) := apex_application.g_x01; l_return VARCHAR2(200); BEGIN -- a simplistic test IF LENGTH(l_test_var) BETWEEN 10 AND 20 THEN l_return := 'String is between 10 and 20'; END IF; --this will write l_return to the buffer, and the ajax callback will receive this htp.p(l_return); END;
And the code that I wrote above, which is javascript, would need to go where your current code is that binds to the onchange event. The result should be that, when a change is made to this element, an ajax request is made on the server. When the call is finished, it will be the value returned in the item you want.
-
How to enable and disable a button depending on the value of a field
Hello experts,
I enable and disable a button depending on the value of a field.
I did the following:
in a trigger of on_new_form_instrance I put the following
the problem is that it works but does not change when my header_status value is changed.begin go_block('OE_HEADER'); execute_query; IF :oe_header.status = 'BOOKED' THEN SET_ITEM_PROPERTY('CONTROL.ACTION',ENABLED,PROPERTY_FALSE); else SET_ITEM_PROPERTY('CONTROL.ACTION',ENABLED,PROPERTY_TRUE); end if; end;
You have to put the same code in when-validate-item trigger of: oe_header.status...
and I think that this code should be trigger after query
IF: oe_header.status = 'RESERVED' THEN
SET_ITEM_PROPERTY('CONTROL.) ACTION', ENABLED, PROPERTY_FALSE);
on the other
SET_ITEM_PROPERTY('CONTROL.) ACTION', ENABLED, PROPERTY_TRUE);
end if; -
How to calculate the sum of the values of some columns in a table
Hello
I want to get the column just the average of the values of some columns not all columns of the table.what I have to change exactly in this block diagram.even if the table size is 25 average, I want the division as the number of values in each column (= number of lines)
just like that:
-
Two tables provided, how you retrieve the values in two columns using values in a column (the pass get values. If col. A is not null values and get the pass. B if col. A is null)?
Guessing
Select nvl (x.col_a, y.col_b) the_column
from table_1 x,.
table_2 y
where x.pk = y.pk
Concerning
Etbin
-
Error in the COLMAP clause. Column name not found
Hi guys,.
I must be missing something simple here, but I can't understand it. I have a very simple test, I am trying to make. Remap the 1 table column in the other on replicat.
I created the file defgens.
*
* Definitions created/modified 2013-02-12 13:08
*
* Description of the areas for each entry in the column:
*
* 1 name
* Data type 2
* 3 external length
* Fetch 4 Offset
* Level 5
* 6 level
* 7 null
* 8 so strange bump
* Inner length 9
* 10 binary length
* Length of the table 11
* 12 most significant DT
* 13 least significant DT
* 14 high precision
* 15 little specific
* 16 point elementary
* Occurs 17
* Column 18 key
* Data type of void 19
*
*
Definition of table of BILLING. B1
Length: 92
SYSKEY: 0
Columns: 2
B_ID 64 50 0 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2
B_F_NAME 64 30 56 0 0 1 0 30 30 0 0 0 0 0 1 0 0 0
End of definition
*
Definition of table of BILLING. B2
Length: 92
SYSKEY: 0
Columns: 2
B_ID 64 50 0 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2
B_L_NAME 64 30 56 0 0 1 0 30 30 0 0 0 0 0 1 0 1 0
End of definition
I installed the replicat read the sourcedefs and remap the columns
-Identify the Replicat group:
REPLICAT rxtest
-State that the source and target definitions are identical:
-ASSUMETARGETDEFS
SOURCEDEFS /u12/oracle/golden_gate_11_rep/dirsql/defgen_billing.sql
-Delete the installation program
DISCARDFILE u12/oracle/golden_gate_11_rep/dirout/rxtest.txt, SERVING
SETENV (NLS_LANG = 'AMERICAN_AMERICA. WE8MSWIN1252")
-Specify the database connection information as needed for the database:
GG username, password
-Specify the error handling rules:
REPERROR (BY DEFAULT, ABEND)
DDL EXCLUDE ALL THE
Billing.b1, billing.r1 of the TARGET CARD,
() COLMAP
B_ID = id,
b_f_name = what);
Now, when I try and start replicat rxtest I get this error in the report.
Resolved CARD (entry of BILLING. (B1):
THE CARD BILLING. B1, TARGET billing.r1, COLMAP (B_ID = id b_f_name = what);
... (B_ID = id b_f_name = what...)
^
Error in the COLMAP clause. Column name not found.
Any ideas? Thank youAnd the ranking of the column names in your clause of colmap? If that is not reversed?
-
How to select data using the same remote database column name 3
Hello
Can anyone help me on how to get the data with the same remote database column names 3 and a unique nickname.
E.g.
SELECT *.
B.SID, b.status, SUM (b.qty) qantity MAX (b.) date_as_of
Of
* ((table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3) has, *)
(* (table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3) b). *
WHERE b.dept = 'finance '.
AND a.position = "admin".
AND a.latest = 'Y' AND (b.status <>"MLT") AND b.qty > 0;
B.SID GROUP, b.status;
NOTE: the instructions "BOLD" is just an example of what I want to do but I always get an error beacause of ambiguous column.
Thanks to advnce. :)
Published by: user12994685 on 4 January 2011 21:42user12994685 wrote:
Can anyone help me on how to get the data with the same remote database column names 3 and a unique nickname.
Not valid. This makes no sense and breaks all the rules of scope-resolution. And if it is in a single database, or uses tables in databases, is not relevant.
Each object must be particularly well identified. If you cannot do this:
select * from (table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3) a
3 objects cannot share the same alias. Example:
SQL> select * from (dual, dual) d; select * from (dual, dual) d * ERROR at line 1: ORA-00907: missing right parenthesis
You need to combine objects - by using a join union or similar. He will have to be done as follows:
SQL> select * from (select * from dual d1, dual d2) d; select * from (select * from dual d1, dual d2) d * ERROR at line 1: ORA-00918: column ambiguously defined
However, we need to have unique column in a projection of SQL names - so the join of the need to project a unique set of columns. So:
SQL> select * from (select d1.dummy as dummy1, d2.dummy as dummy2 from dual d1, dual d2) d; DUM DUM --- --- X X SQL>
I suggest that you look carefully at what opportunities are and how it applies in SQL - and ignore if the referenced objects are local or remote, because it has no effect on the basic principles of scope-resolution.
-
Toggle button depends on the value of the selected row
Hello.
My problem is:
I have a Table "singleSelect" and a button Delete.
I´d want to toggle the button depends on the value of the selected row.
I mean:
C1: DepartmentId
C2: Yes/No
For each line: If c2 = "" then disable the rest button activates the button.
I hope you can help me.
I'm from Venezuela my English is not very good. :)Disabled = "#{row." C2 eq 'No'} '.
-
Single request for the display of all, but the values of 1 column for all tables
Hello
All tables have the column SYS_CREATION_DATE.
But I don't want to not display the value of this column
Can anyone suggest a way in which I could achieve this?
Oracle version: 11 GR 1 material
OS: SunOS
See you soon,.
Malika
Published by: user9131570 on July 6, 2010 19:57user9131570 wrote:
@TubbyI * table-wise display the values of all but 1 columns (SYS_CREATION_DATE) in my database.*
I need it to compare to another data base for all these values.
I would like to make a wild guess at what you are getting.
In view of these two tables
create table emp (empid number, empname varchar2(15), empaddr varchar2(15), sys_creation_date date); -- create table dept (deptid number, deptmgr varchar2(10), sys_creation_date date);
you want to combine somehow
select empid, empname, empaddr from emp;
with
select deptid, deptmgr from dept;
in a single sql statement?
-
How ItemRenderer change for DataGrid column based on the value of this column?
Hello! I am trying to create a DataGrid that has a component Button to register when the value of this column is 'Open', then a label saying full when the value of this column is "Full". But Im having a hell of a time he find.
Here's my MXML with 2 different inline installation of components for different rendering engines point 2:
<? XML version = "1.0" encoding = "utf-8"? >
"" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >
< mx:Component id = "RegFull" >
< mx:VBox horizontalAlign = "center" verticalAlign = "middle" >
< mx:Label id = 'Full text' text = "Full" / >
< / mx:VBox >
< / mx:Component >
< mx:Component id = "RegButton" >
< mx:VBox horizontalAlign = "center" verticalAlign = "middle" >
< mx:Button label = "Save" / >
< / mx:VBox >
< / mx:Component >
< mx:DataGrid id = "scGrid" width = "100%" height = "100%" number of lines = "4" >
< mx:dataProvider >
< mx:Object label = "Status" data = 'Open' / >
< mx:Object label = "Status" data = "Full" / >
< mx:Object label = "Status" data = 'Open' / >
< mx:Object label = "Status" data = "Full" / >
< mx:Object label = "Status" data = 'Open' / >
< mx:Object label = "Status" data = "Full" / >
< / mx:dataProvider >
< mx:columns >
< mx:DataGridColumn id = "RegCol" headerText = "Reg" dataField = "data" / >
< / mx:columns >
< / mx:DataGrid >
< / mx:Application >
How can I dynamically use the right of itemrenderer based on the value of the field? THANKS FOR ANY HELP PROVIDED!
The best
StephenYou can have more than 1 column renderer engine. There are two ways to do this. One way would be to use States. A State for each possible value in the data. Since you either want a button (data == 'open') or a label (data == 'Full') by using the States wouldn't be a bad choice.
Alternatively, you can use a canvas instead of a VBox. Make a label and a button with horizontalCenter = "0" "0" = red to make them each other. Make it visible according to the data value:
where dataField is the value of the property dataField on this converter DataGridColumn.
-
Trigger that fires on the value of a column
Hello everyone,
I'm willing to do a trigger working on the column value.
the requirement is that the column has the date and time I want to automatically update another table on the specified time. like for ex. leaves saying the value of this column is 26 October 2008 21:00 then date and time the trigger triggers, delete this value and update another table.
so is it not to write something like this, or any other way to do this.
Thank you
Rahullike for ex. leaves saying the value of this column is 26 October 2008 21:00 then date and time the trigger triggers, delete this value and update another table.
What you could try is:
1 create the procedure that makes some logic you want
2 create a trigger on the table (before integration), in which you can create a task (dbms_job/dbms_scheduler) who perform the previous procedure at the time defined by the value of the column.
3. a validation will validate your changes of data and validate the creation of jobs, cancel rollback job creation.That way, your work (aka trigger) fires exactly at the scheduled time.
Nicolas.
-
get the name of the update by query column
Hello
How can I get the name of the update by request column
I need to insert the name of the column changed in a query to update a history table by using a trigger created on the main table.
How can I get the update column name in this trigger
Thanks in advance
Sicardqueryguy wrote:
Thanks for the reply, but wouldn't be an additional burden to compare all values
what I was looking for was a direct request or variable system oracle for such useComparing the old and new values wud tell me which column is updated then how to get the anme of column
for example update test set emp_name = "Sicard' where emp_pos = 'President ';
now I want to insert 'emp_name' in the table test_hist as follows
==========================================
name colmn = old value = new value = update the = updated by
emp_test = notsapan = sapan = sysdate = syscontext_userPublished by: queryguy on June 22, 2009 04:06
Well, since you have a typical requirement (for which Oracle doesn't have a built-in support), you will need to compare the old and new values, and insert the name of the column "manually" in the logging table.
Little extra processing is indeed (CPU cycles) to find the modified column.
Maybe you are looking for
-
Why firefox opens with two tabs?
When I start Firefox it like to open with two tabs? I don't want it and I want to know how to stop it.I use windows 8.1 Pro for an operating system.
-
Cannot find the menu accessibility more under Tools
I'm trying to restore the ability of sites to redirect me to other sites. I think I made the mistake to remove this feature using the menu Tools, Options, general, accessibility, less "warn me when websites try to redirect or reload the page. Now, wh
-
Toshiba virtual Store account Reset - 12624
Hello I have a Toshiba JournE and I need help with Virtualstore, please make an account back to zero, the account number is 12624. Thank you!
-
How can Windows Update, error 2b2f - I solve this problem? __
How can I solve this problem?
-
Windows Photo Gallery crashes after that I have download the images.
The program stops and asks if I need help in diagnosing the problem, but there is no miracle in Microsoft. I ran a diagnosis of mats_run.pictures who said he solved the problem, but the same problem still exists. Any help would be gladly accepted.