How to populate data in the same table based on different links/buttons
Hi
I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
Can anyone please suggest how can this be achieved.
Thanks
I have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
What format do you have the date in - table / form ?
Similar Messages
-
Comparing SQL data in the same table for two different dates
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
Hello,
We have a batch scheduling tool that automatically runs Oracle jobs and when it runs the jobs it stores a record from the instance in a table. I am trying to write a query that pulls up all of the jobs that ran today and compares them with what ran on the same day last week to find out what jobs didnt run today. So far I have the below but I can't get it to return anything. I am using Toad for this
select *
from xxcar_abat_instances
where trunc(to_date(start_datetime)) = trunc(sysdate-7)
and completion_status = 'Success'
AND NOT EXISTS
(select script_name
from xxcar_abat_instances
where trunc(to_date(start_datetime)) = trunc(sysdate)
and completion_status = 'Success')Thank youHi,
964188 wrote:
It is a date
Such as
10/31/2012 11:55:03 PMThen, as Hoek says, you don't want TO_DATE. For example:
WHERE TRUNC (start_datetime) = TRUNC (SYSDATE - 7) or the more efficient
WHERE start_datetime >= TRUNC (SYSDATE - 7)
AND start_datetime < TRUNC (SYSDATE - 6)Also, it doesn't look like the EXISTS sub-query is corelated to the main query. That's almost certainly a mistake.
If you're still having trouble, post your revised query, a little sample data (CREATE TABLE and INSERT statements). Point out where that query is givimg the wrong results, and explain how to get te right results.
See the forum FAQ {message:id=9360002} -
I had an interview question that is:
How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) From another server ex: Transaction server?
Set up steps so inset, update or delete operation takes place across the servers.
It would be great if someone please enlighten me in details about this process in MS SQL Server 2008 R2.
Also please describe would it be different for SQL Server 2012?
If so, then what are the steps?I had an interview question that is:
How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) from another server ex: Transaction server?
Set up steps so that inset, update or delete operation gets done correctly across servers.
I was not sure about the answer, it would be great if someone please put some light on this and explain in details about this process in MS SQL Server 2008 R2.
Also it would be very helpful if you please describe would it be different for SQL Server 2012? If so, then what are the steps? -
How to insert data into the mysql table by giving as a text file
Hi,
Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
Thanks:)At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).
-
How to populate data in the data table on combo box change event
hi
i am deepak .
i am very new to JSF.
my problem is i want to populate data in the datatable on the combo box change event.
for example ---
combo box has name of the city. when i will select a city
the details of the city should populate in the datatable. and if i will select another city then the datatable should change accordingly..
its urgent
reply as soon as possible
thanks in advancei am using Rational Application Developer to develop my application.
i am using a combo box and i am assigning cityName from the SDO.
and i am declaring a variable in the pageCode eg.
private String cityName;
public void setCityName(String cityName){
this.cityName = cityName;
public String getCityName(){
return cityName;
<h:selectOneMenu id="menu1" styleClass="selectOneMenu" value="#{pc_Test1.loginID}" valueChangeListener="#{pc_Test1.handleMenu1ValueChange}">
<f:selectItems
value="#{selectitems.pc_Test1.usercombo.LOGINID.LOGINID.toArray}" />
</h:selectOneMenu>
<hx:behavior event="onchange" target="menu1" behaviorAction="get"
targetAction="box1"></hx:behavior>
and also i am declaring a requestParam type variable named city;
and at the onChangeEvent i am writing the code
public void handleMenu1ValueChange(ValueChangeEvent valueChangedEvent) {
FacesContext context = FacesContext.getCurrentInstance();
Map requestScope = ext.getApplication().createValueBinding("#{requestScope}").getValue(context);
requestScope.put("login",(String)valueChangedEvent.getNewValue());
and also i am creating another SDO which is used to populate data in datatable and in this SDO in the where clause i am using that requestParam .
it is assigning value in the pageCode variable and in the requestParam but it is not populating the dataTable. i don't no why??
it is possible that i may not clear at this point.
please send me the way how my problem can be solved.
thanks in advance -
How to read the hierarchy data from the same table using loop in AMDP method
Hi All,
We have a requirement to get the top partner from BUT050 table.
Here the Top parent is nothing but the top most in the hierarchy of the partners from BUT050.
Example:
For partner 1234 (BUT050-PARTNER1) there is partner 3523(BUT050-PARTNER2) one level above
For partner 3523(BUT050-PARTNER1) there is partner 4544 (BUT050-PARTNER2) last level .
so in this case for the partner 1234 the Top parent is 4544 .
I have created AMDP Procedure method to get the top-parnet and below given is the logic implemented in AMDP method.
Here i have implemented a recursive logic with the WHILE loop to get the top most hierarchy partner from the same table BUT050
IV_Parent is the input partner and ev_top_parent is the output value.
AMDP Procedure Method:
DECLARE lv_date VARCHAR(8) := TO_VARCHAR (current_date, 'YYYYMMDD');
DECLARE found INT := 1;
iv_partner1 = SELECT partner1 FROM but050
WHERE partner2 = iv_partner
AND reltyp = :iv_hierarchy
AND date_to >= :lv_date
AND date_from <= :lv_date;
WHILE found <> 0 do
select partner1 into ev_top_parent from :iv_partner1;
iv_partner1 = SELECT partner1 FROM but050
WHERE partner2 in ( select partner1 from :iv_partner1 where partner1 is not null)
AND reltyp = 'ZBP004'
AND date_to >= :lv_date
AND date_from <= :lv_date;
select COUNT ( partner1 ) INTO found FROM :IV_PARTNER1;
END WHILE;
This method is working fine, but here it is only taking one single partner and getting the top parent as output.
Now i would like to convert this mehtod so as to accept n number of partners (not one single partner) as input and should process each partner to get the top parent.
Could anyone guide me how can i handle the given AMDP method further so as to work some how it is within another loop from other AMDP method.
Thanks.
Regards,
Laxman.PHi
Go to SE11 and enter the hierarchy table name.
/BIC/H....(infoobject name)...and execute the table and select table entry and delete all....
Thanks
TG -
How do I sum across the same table in multiple sheets?
So I'm trying to figure out an annoying problem.
I have a largish (100's) amount of data with each collection being a table in a sheet, one sheet per data collection. This means I have 100's of sheets, each with the same table name and layout. Each sheet has several hundred data points in it.
How do I do a sum across all of the same table in all the sheets?
For example I want to do Sum('Data Sheet Number *'::'Table 1'::A1) to get a sum of everything in all the A1 cells of all the sheets named 'Data Sheet Number ' followed by anything (I'm using the star in the same way one would do it in a shell...)
Thanks!
Message was edited by: unusedusername
Message was edited by: unusedusernameTo respond to WWJD: I was handed the data and I don't have any control over it's format...
I found the answer in the forums though, so I guess I'm answering my own question
http://discussions.apple.com/thread.jspa?messageID=6203991�
The auto-filling INDIRECT reference worked very well for me. -
How to display data with the same text and key in the drop down list?
Hi All,
Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
REPORT ZTESTING.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST,
c(20) type c.
* c = 'select any'.
data:begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
data:begin of jtab occurs 0,
kunnr like kna1-kunnr,
land1 like kna1-land1,
end of jtab.
PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
default 'SELECT'.
AT SELECTION-SCREEN OUTPUT.
NAME = 'p_list'.
VALUE-KEY = 'Name'. "---> Data for key is the same with text
VALUE-TEXT = 'Name'. "--> Data for text is the same with key
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
VALUE-TEXT = 'Country'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
start-of-selection.
select kunnr name1 up to 20 rows from kna1 into table itab.
select kunnr land1 up to 20 rows from kna1 into table jtab.
case p_list.
when '1'.
loop at itab.
write:/ itab-kunnr,itab-name1.
endloop.
when '2'.
loop at jtab.
write:/ jtab-kunnr,jtab-land1.
endloop.
endcase.
<Added code tags>
Moderator Message: Please use the "code" tags to format your code snippet.
Edited by: Suhas Saha on Nov 17, 2011 11:19 AMshawnTan wrote:
Hi All,
>
> Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
>
>
REPORT ZTESTING.
>
> TYPE-POOLS: VRM.
>
> DATA: NAME TYPE VRM_ID,
> LIST TYPE VRM_VALUES,
> VALUE LIKE LINE OF LIST,
> c(20) type c.
>
> * c = 'select any'.
>
> data:begin of itab occurs 0,
> kunnr like kna1-kunnr,
> name1 like kna1-name1,
> end of itab.
>
> data:begin of jtab occurs 0,
> kunnr like kna1-kunnr,
> land1 like kna1-land1,
> end of jtab.
>
> PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
> default 'SELECT'.
>
> AT SELECTION-SCREEN OUTPUT.
>
> NAME = 'p_list'.
>
> VALUE-KEY = 'Name'. "---> Data for key is the same with text
> VALUE-TEXT = 'Name'. "--> Data for text is the same with key
> APPEND VALUE TO LIST.
>
> VALUE-KEY = '2'.
> VALUE-TEXT = 'Country'.
> APPEND VALUE TO LIST.
>
> CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
>
> start-of-selection.
> select kunnr name1 up to 20 rows from kna1 into table itab.
> select kunnr land1 up to 20 rows from kna1 into table jtab.
>
> case p_list.
> when '1'.
> loop at itab.
> write:/ itab-kunnr,itab-name1.
> endloop.
>
> when '2'.
> loop at jtab.
> write:/ jtab-kunnr,jtab-land1.
> endloop.
> endcase.
>
> <Added code tags>
>
> Moderator Message: Please use the "code" tags to format your code snippet.
>
> Edited by: Suhas Saha on Nov 17, 2011 11:19 AM
This surely seems to be a bug to me(if not by design), did you check for any SAP notes? Perhaps a front end trace can help(Note 407743) !
-Rajesh. -
Historical and transaction data in the same tables creates perf problems
Our Oracle based application is slow partly due to the fact that historical data are kept in the same table as transactional data. For example records about deceased patients, patients treated 5 years ago...etc, are kept in the one and only one patient table, which is needed to run the daily process of the hospital. So gradually all our major tables PATIENTS, CHARTS, NAMES, APPOINTMENTS have grown very large and since most of our SQL join all these tables at the same time, then all screens and reports run very slowly. I have introduced the idea that we should split all these tables in two: historical PATIENTS data, and CURRENT PATIENTS data...the same with all the others. A nice system would first search in the smaller transactional tables, which would run faster being smaller, and if no data found, then fallback to the historical tables. But this would require programming. From what I have read mateialized view could solve part of our problem. We could have views containing for example only one year worth of the data, and I guess any changes could be later replicated in the base table. What I dont know is what to do if we cannot find the patient in the matealized views ? Do I need to fallback to another SQL which will search in the initial base tables ? Anyway we can implement this without programming ? Tx.
Appointment table: 207,470
Visit table: 5,890,920
Patient table: 2,993,129
Chart table: 2,864,069
Patient names table: 3,938,118
SELECT
APPOI_OR_VISIT,
VISIT_SEQ,
PAT_SEQ,
INST_CODE,
INST_CODE_DISPL,
INST_DESC,
CLINIC_CODE,
CLINIC_CODE_DISPL,
CLINIC_DESC,
SPEC_CODE,
SPEC_CODE_DISPL,
SPEC_DESC,
VISIT_DATE,
VISIT_TIME,
VISIT_TIME_ARRIVAL,
APPTYPE_CODE,
SESSION_DOM_MODE,
PRESTYPE_CODE,
PRESTYPE_DOM_TYPE,
DIA_CODE,
VISIT_TIME_START_RESP,
VISIT_TIME_DISCHARGE,
APPOI_NB_DURATION,
VISIT_TX_REASON,
VISIT_TX_COMMENT,
EXTDOC_CODE,
VISIT_PN_REFPHYS_NAME,
PATYPE_CODE,
PAYRESP_CODE,
VISIT_IND_GROUP,
VISIT_PCODE,
VISIT_IND_COMPLETE,
VISIT_IND_ADMISSION,
VISIT_IND_CONFIDENTIALITY,
VISIT_DATE_ACCIDENT,
APPOI_SEQ,
BILLING_CODE,
VISIT_TX_DIAGNOSIS,
CST_CODE_1,
CST_CODE_2,
CST_CODE_3,
APPOI_DH_CRE,
APPOI_CODE_CRE_USER,
APPOI_DH_MOD,
APPOI_CODE_MOD_USER,
VISIT_CODE_CRE_USER,
VISIT_DH_CRE,
VISIT_UPDATED_COUNT,
VISIT_CODE_MOD_USER,
VISIT_DH_MOD,
APPOI_PAYRESP_CODE,
APPOI_DT_ACCIDENT,
PATIENT_LAST_NAME,
PATIENT_FIRST_NAME,
PATIENT_CONFIDENTIALITY,
PATIENT_CHART_EXT,
TO_NUMBER(SUBSTR(PATIENT_CHART_EXT, 1, INSTR(PATIENT_CHART_EXT, '|')-1)) AS PATIENT_CHART_NO,
PAT_IND_SPECIAL_RISK
FROM
SELECT
'VISIT' AS APPOI_OR_VISIT,
VISIT.VISIT_SEQ,
VISIT.PAT_SEQ,
INSTITUTION.INST_CODE,
INSTITUTION.INST_CODE_DISPL,
INSTITUTION.INST_DESC,
CLINIC.CLINIC_CODE,
CLINIC.CLINIC_CODE_DISPL,
CLINIC.CLINIC_DESC,
SPECIALTY.SPEC_CODE,
SPECIALTY.SPEC_CODE_DISPL,
SPECIALTY.SPEC_DESC,
VISIT.VISIT_DATE,
VISIT.VISIT_TIME,
VISIT.VISIT_TIME_ARRIVAL,
VISIT.APPTYPE_CODE,
VISIT.SESSION_DOM_MODE,
VISIT.PRESTYPE_CODE,
VISIT.PRESTYPE_DOM_TYPE,
VISIT.DIA_CODE,
VISIT.VISIT_TIME_START_RESP,
VISIT.VISIT_TIME_DISCHARGE,
VISIT.APPOI_NB_DURATION,
VISIT.VISIT_TX_REASON,
VISIT.VISIT_TX_COMMENT,
VISIT.EXTDOC_CODE,
VISIT.VISIT_PN_REFPHYS_NAME,
VISIT.PATYPE_CODE,
VISIT.PAYRESP_CODE,
VISIT.VISIT_IND_GROUP,
VISIT.VISIT_PCODE,
VISIT.VISIT_IND_COMPLETE,
VISIT.VISIT_IND_ADMISSION,
VISIT.VISIT_IND_CONFIDENTIALITY,
VISIT.VISIT_DATE_ACCIDENT,
VISIT.APPOI_SEQ,
VISIT.BILLING_CODE,
VISIT.VISIT_TX_DIAGNOSIS,
VISIT.CST_CODE_1,
VISIT.CST_CODE_2,
VISIT.CST_CODE_3,
VISIT.APPOI_DH_CRE,
VISIT.APPOI_CODE_CRE_USER,
VISIT.APPOI_DH_MOD,
VISIT.APPOI_CODE_MOD_USER,
VISIT.VISIT_CODE_CRE_USER,
VISIT.VISIT_DH_CRE,
VISIT.VISIT_UPDATED_COUNT,
VISIT.VISIT_CODE_MOD_USER,
VISIT.VISIT_DH_MOD,
NULL AS APPOI_PAYRESP_CODE,
TO_DATE(NULL) AS APPOI_DT_ACCIDENT,
NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(VISIT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
PATIENT.PAT_IND_SPECIAL_RISK
FROM
AS_T_VISITS VISIT,
CT_R_INSTITUTIONS INSTITUTION,
AS_T_CLINICS CLINIC,
CT_R_SPECIALITIES SPECIALTY,
PI_T_NAMES NAME,
PI_T_PATIENTS PATIENT,
PI_R_CONF_LEVELS CONFIDENTIALITY
WHERE
VISIT_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
VISIT_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
CLINIC.CLINIC_CODE = VISIT.CLINIC_CODE AND
SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
INSTITUTION.INST_CODE(+) = VISIT.INST_CODE AND
NAME.PAT_SEQ = VISIT.PAT_SEQ AND
NAME.NAMTYP_CODE = 1 AND
PATIENT.PAT_SEQ = VISIT.PAT_SEQ AND
CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE
UNION
SELECT
'APPOI' AS APPOI_OR_VISIT,
0 AS VISIT_SEQ,
NVL(APPOINTMENT_GROUP.PAT_SEQ, APPOINTMENT.PAT_SEQ) AS PAT_SEQ,
INSTITUTION.INST_CODE,
INSTITUTION.INST_CODE_DISPL,
INSTITUTION.INST_DESC,
CLINIC.CLINIC_CODE,
CLINIC.CLINIC_CODE_DISPL,
CLINIC.CLINIC_DESC,
SPECIALTY.SPEC_CODE,
SPECIALTY.SPEC_CODE_DISPL,
SPECIALTY.SPEC_DESC,
APPOINTMENT.SESSION_DATE AS VISIT_DATE,
APPOINTMENT.APPOI_TIME AS VISIT_TIME,
'' AS VISIT_TIME_ARRIVAL,
APPOINTMENT.APPTYPE_CODE,
APPOINTMENT.SESSION_DOM_MODE,
0 AS PRESTYPE_CODE,
'' AS PRESTYPE_DOM_TYPE,
0 AS DIA_CODE,
'' AS VISIT_TIME_START_RESP,
'' AS VISIT_TIME_DISCHARGE,
APPOINTMENT.APPOI_NB_DURATION,
APPOINTMENT.APPOI_TX_REASON AS VISIT_TX_REASON,
APPOINTMENT.APPOI_TX_COMMENT AS VISIT_TX_COMMENT,
APPOINTMENT.EXTDOC_CODE,
APPOINTMENT.APPOI_PN_REFPHYS_NAME AS VISIT_PN_REFPHYS_NAME,
APPOINTMENT_TYPE.PATYPE_CODE AS PATYPE_CODE,
0 AS PAYRESP_CODE,
DECODE(APPOINTMENT_GROUP.PAT_SEQ,NULL,0,1) AS VISIT_IND_GROUP,
'' AS VISIT_PCODE,
0 AS VISIT_IND_COMPLETE,
0 AS VISIT_IND_ADMISSION,
APPOINTMENT.APPOI_IND_CONFIDENTIALITY AS VISIT_IND_CONFIDENTIALITY,
TO_DATE(NULL) AS VISIT_DATE_ACCIDENT,
APPOINTMENT.APPOI_SEQ,
0 AS BILLING_CODE,
'' AS VISIT_TX_DIAGNOSIS,
0 AS CST_CODE_1,
0 AS CST_CODE_2,
0 AS CST_CODE_3,
APPOINTMENT.APPOI_DH_CRE AS APPOI_DH_CRE,
APPOINTMENT.APPOI_CODE_CRE_USER AS APPOI_CODE_CRE_USER,
APPOINTMENT.APPOI_DH_MOD AS APPOI_DH_MOD,
APPOINTMENT.APPOI_CODE_MOD_USER AS APPOI_CODE_MOD_USER,
'' AS VISIT_CODE_CRE_USER,
SYSDATE AS VISIT_DH_CRE,
0 AS VISIT_UPDATED_COUNT,
'' AS VISIT_CODE_MOD_USER,
SYSDATE AS VISIT_DH_MOD,
PAYRESP_CODE AS APPOI_PAYRESP_CODE,
APPOI_DT_ACCIDENT,
NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(APPOINTMENT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
PATIENT.PAT_IND_SPECIAL_RISK
FROM
AS_T_APPOINTMENTS APPOINTMENT,
AS_R_APPOINTMENT_TYPES APPOINTMENT_TYPE,
AS_T_CLINICS CLINIC,
CT_R_SPECIALITIES SPECIALTY,
CT_R_INSTITUTIONS INSTITUTION,
AS_T_APPOINTMENT_GROUPS APPOINTMENT_GROUP,
PI_T_PATIENTS PATIENT,
PI_R_CONF_LEVELS CONFIDENTIALITY,
PI_T_NAMES NAME,
AS_T_APPOINTMENT_SEQ_MAPPING SEQMAP
WHERE
SESSION_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
SESSION_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
APPOINTMENT.APPOI_DOM_TYPE IN('A','AR') AND
CLINIC.CLINIC_CODE = APPOINTMENT.CLINIC_CODE AND
SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
INSTITUTION.INST_CODE(+) = APPOINTMENT.INST_CODE AND
APPOINTMENT_GROUP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
APPOINTMENT_TYPE.APPTYPE_CODE (+) = APPOINTMENT.APPTYPE_CODE AND
NAME.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
NAME.NAMTYP_CODE = 1 AND
PATIENT.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE AND
SEQMAP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
SEQMAP.APPOI_SEQ IS NULL
ORDER BY
VISIT_DATE, VISIT_TIME, PATIENT_CHART_NO -
How to combine 2 the same tables from 2 different databases
We have made 2 databases company1 and company2
Both databases contains the same tables
Now we want to make a report with server reporting services. The report must give us information from the 2 databases.
We use the following query:
SELECT '501'as divisie, GRV_DebtorOutstanding2.[Debtor code] AS Debiteur, GRV_DebtorOutstanding2.cmp_name AS Naam, SUM(GRV_DebtorOutstanding2.[Outstanding Amount]) AS Saldo,
GRV_DebtorOutstanding2.blokkade, GRV_Debtors.City
FROM [501].dbo.GRV_DebtorOutstanding2 INNER JOIN
[501].dbo.GRV_Debtors ON GRV_DebtorOutstanding2.[Debtor code] = GRV_Debtors.[Debtor code]
WHERE (GRV_DebtorOutstanding2.blokkade = 'B')
GROUP BY GRV_DebtorOutstanding2.[Debtor code], GRV_DebtorOutstanding2.cmp_name, GRV_DebtorOutstanding2.blokkade, GRV_Debtors.City
ORDER BY Debiteur
when we use the same query to select the data of the other database in the same query it doesn't work. I have tried it with the command Union All
But it crashes,
please help, to fix itHi Robert,
According to your description, you have created two same databases. When you run the same query for the second database, it doesn’t work.
In your scenario, since databases are the same and the query for first database can work fine, it should also work when query the second database using the same query. When you create second dataset, please check if you have used a correct datasource
which is second database. Then try to run the query again. If issue persists, please share the error message around the time when you query the second database.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
Retrieve data from the same table
i have a table with following fields
emp_no,name,salary,department,dept_prev,prev_emp_no.
now i want retrieve emp_no,name,salary,department, from the data base for a perticular employeee number along with dept_prev
but dept_prev is the prev_emp_no dept_prev
now iam doing two query like this
first query to retreive name,salary,department
select name,salary,department from employee where emp_no = 10
second to retrieve the dept_prev from the same table but this
dept_prev must be based on prev_emp_no
select dept_prev from employee where emp_no in(select prev_emp_no from employee where emp_no =10)
can any one suggest to combine these two queries in a single sql statements, because all the fieldds are from the same table.
ThanksWould this one solve it?
SELECT emp.NAME, emp.salary, emp.department,
prev_emp.dept_prev
FROM employee emp,
employee prev_emp
WHERE emp.emp_no = 10
AND prev_emp.emp_no = emp.prev_emp_no;
not tested
C. -
Hi,
I want to center two different text row that are in the same table but one on the center and the other one on the left. I put a <span> tag hoping that it has been overwhelmed the table's class properties The .bottomsel's font-family and the .Cig84's font-family and colour work but the text-align don't: they're both on the left.
These are my source and CSS codes:
Source:
<table width="600" border="0">
<tr>
<td class="bottomref"><p><span class="bottomsel">| <a href="index.html" target="_self">Main</a> | <a href="about.html" target="_self">About</a> | <a href="clients.html" target="_self">Clients</a> | <a href="contact.html" target="_self">Contact</a> |</span><br />
<span class="credits">Credits: <span class="Cig84">Cig84</span></span></p></td>
</tr>
</table>
CSS:
.bottomsel {
text-align: center;
font-family: Georgia, "Times New Roman", Times, serif;
.credits {
text-align: left;
.Cig84 {
color: #F00;
font-family: "Comic Sans MS", cursive;Use paragraph tags with CSS classes.
CSS:
.center {text-align:center}
.left {text-align:left}
HTML:
<table width="600" border="0">
<tr>
<td class="bottomref">
<p class="center">This text is center aligned</p>
<p class="left">This text is left aligned</p>
</td>
</tr>
</table>
Nancy O. -
Want to select individual data as well as aggregate data from the same table
want to select a, b from tab1 also need to find in the same table tab1 need to do sum(b) group by a
SELECT a,b,0 AS Ord
FROM tab1
UNION ALL
SELECT a,SUM(b),1
FROM tab1
GROUP BY a
ORDER BY a,Ord
assuming SQL Compact
If its SQL Server then we have much simpler methods
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
How to retirve data in the same sequence as it is entered by user.
Dear All,
Can anybody please help me to resolve the below oaf issue.
Issue : In one of the column in advanced table is OAMessageTextInputBean. User will enter data as
1) color
2) size
3) name.
I set the properties of Text inputBean Heigth and length. so when ever user enter more data automatically scrollbar is getting to scroll up and down. So far ok. But,
When i want to represent this data in view mode, i am using OAMessageStyledText bean. But i data enter abouve is getting in the same line as
1) color2)size3)name.
I want to show the data entered by user in textInput same in message Styled Text, basically sequence. So, Could anybody help me how to achieve this requirement?
Thanks in advance,
Hasine K.hi,
in advance table create a item rawtext and add HTML tag and use <br> tag for breaking the line.........for more go to OAF Userguide -
How to compare records in the same table?
I have a table of course registrations. I would like to select course registrations as of a certain date that do not have a dropped status against it.
CREATE TABLE REGISTRATIONS
(ID VARCHAR(7) ,
COURSE VARCHAR(4),
CURRENT_STATUS VARCHAR(10),
STATUS_DATE VARCHAR(10))
INSERT INTO REGISTRATIONS
(ID, COURSE, CURRENT_STATUS, STATUS_DATE)
VALUES
('1111111','ADMN', 'REGISTERED', '2014-04-10'),
('1111111','MATH', 'REGISTERED', '2014-04-10'),
('1111111','ADMN', 'DROPPED', '2014-04-10'),
('1111111','MATH', 'DROPPED', '2014-04-12'),
('1111111','BIOL', 'REGISTERED', '2014-04-10')
SELECT * FROM REGISTRATIONS
ORDER BY COURSE, CURRENT_STATUS
drop table REGISTRATIONS
ID COURSE CURRENT_STATUS STATUS_DATE
1111111 ADMN DROPPED 2014-04-10
1111111 ADMN REGISTERED 2014-04-10
1111111 BIOL REGISTERED 2014-04-10
1111111 MATH DROPPED 2014-04-12
1111111 MATH REGISTERED 2014-04-10
The above example shows that ID '1111111' has registered for ADMN and BIOL on April 10th but dropped ADMN the same day. It also shows that they registered for MATH on April 10th but dropped it on the 12th.
If I were to select course registrations to date as of April 10 I would see both ADMN records, BIOL and MATH. BIOL and MATH would be OK but I don't want to see the ADMN data in the result because they have essentially cancelled themselves out.
In saying that, how do I write a script to select all course registrations as of a certain date but omit the ones that have been dropped at anytime before the select date?check below,
SELECT * FROM REGISTRATIONS a
WHERE CURRENT_STATUS <> 'DROPPED' AND STATUS_DATE <= '2014-04-12'
AND COURSE NOT IN (
SELECT COURSE FROM REGISTRATIONS
WHERE CURRENT_STATUS = 'DROPPED' AND STATUS_DATE <= '2014-04-12')
ORDER BY a.COURSE, a.CURRENT_STATUS
Maybe you are looking for
-
64 bit processor running on a 32 bit os
I have a laptop that has a 64 bit processor running on a 32 bit os. Can I upgrade my os to 64 bit? If so how? I have a compaq presario with AMD 64 Athlon X2 procssor (64-bit) running on windows vista premium 32-bit. Please help.
-
My iPad screen is distorted and looks psychedelic
My iPad screen is distorted and looks psychedelic
-
Where does Adobe store my InDesign invoice
I just bought the InDesign app. I am charged the fee monthly. But I have been unable to locate my invoice for the amount. Adobe sends me an e-mail, but an e-mail is not enough documentation, I need the invoice. Does anyone know where I may find it?
-
I am having problems playing a cd I burned on my Mac on another player.
I am having problems playing a cd I burned in my Mac on another player.
-
How to enable popup's in Safari in MACBOOK air?
How to enable popup's in Safari in MACBOOK air?