JClient: Different tables with same ViewObject
I am using two tables the user can see at the same time as different JInternalFrames which show the data of the same ViewObject. I have two questions concerning this:
1. When I have opened the first table and have done a executeQuery() for the ViewObject I would think that I don't need another executeQuery() to show the data in the second table. But without another execcuteQuery() the second table is empty. Any chance to avoid the second executeQuery()?
2. The second table is smaller than the first, so less rows are displayed. So when I open the second table, in my first table also only these few rows are displayed and the remaining rows are blank. I tried setRangeSize() but it doesn't work. Any idea?
Thanks a lot in advance,
Matthias
I'd expect the results to be somewhat better than the results you seem to be getting.
Are you sure that the JInternalFrames are sharing the same panelBinding instance and not each creating their own?
HTH
Mike.
Similar Messages
-
Retrieving Data from different Tables with same tuple name
Hi,
I am made the following query from different tables. A tuple "name" is appearing in some tables. So when I run the qiery in a Java class, it delivers the same result of c.name, bpl.name and p.name. The result of c.name is correct, but the other 2 names are overwritten. It works perfect in a postgreSql query tool. How can I correct it, plz?
SELECT c.ad_client_id, c.name, o.c_order_id, o.ref_order_id, bp.name, bpl.name, o.dateordered, o.datepromised, od.c_orderline_id,p.m_product_id,p.name, cur.iso_code, od.qtyordered
FROM adempiere.ad_client c, adempiere.c_order o, adempiere.c_orderline od, adempiere.c_bpartner bp, adempiere.m_product p, adempiere.c_bpartner_location bpl, adempiere.c_currency cur
WHERE c.ad_client_id =11 and c.ad_client_id = o.ad_client_id and bp.c_bpartner_id=o.c_bpartner_id and o.c_order_id = od.c_order_id and od.m_product_id = p.m_product_id and o.c_bpartner_location_id =bpl.c_bpartner_location_id and o.c_currency_id=cur.c_currency_id;
CheersHi,
create alias, if u have similar field names as below. Use the alias name (rs.getString("cname") and rs.getString("bpname") and so on ) to retrive data.
SELECT c.ad_client_id, c.name as cname, o.c_order_id, o.ref_order_id, bp.name as bpname, bpl.name as bplname, o.dateordered, o.datepromised, od.c_orderline_id,p.m_product_id,p.name as pname, cur.iso_code, od.qtyordered
FROM adempiere.ad_client c, adempiere.c_order o, adempiere.c_orderline od, adempiere.c_bpartner bp, adempiere.m_product p, adempiere.c_bpartner_location bpl, adempiere.c_currency cur
WHERE c.ad_client_id =11 and c.ad_client_id = o.ad_client_id and bp.c_bpartner_id=o.c_bpartner_id and o.c_order_id = od.c_order_id and od.m_product_id = p.m_product_id and o.c_bpartner_location_id =bpl.c_bpartner_location_id and o.c_currency_id=cur.c_currency_id;Regards,
Ram -
Where statement on two different tables with same column name
Hello,
I have 2 financial tables:
tblincome, tblexpenses
in each table I have column name "monthPayed" (have values of all the months of the year).
I would like to create a balance view table that will show me the financial status for the Q1 (for example).
I have a column totalIncome and totalExpended respectively.
I've create a view table that shows me the financial balance at the moment but I want it to be devide to Quarters of the year...
Regards
Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.
This is minimal polite behavior on SQL forums. Where is the code you already tried? Or are you so lazy, so rude or so privileged that you did not do anything for yourself?
In fact that silly “tbl-” prefix is so bad that it has a name! It is called Tibbling and Phil Factor even wrote a humor article on bad programmers that use it.
Your narrative is vague; it sounds like this is the DDL:
CREATE TABLE Incomes
(payment_month CHAR(10) NOT NULL PRIMARY KEY,
income_amt DECIMAL(12,2) NOT NULL
CHECK (income_amt > 0.00),
CREATE TABLE Expenses
(payment_month CHAR(10) NOT NULL PRIMARY KEY,
expense_amt DECIMAL(12,2) NOT NULL
CHECK (expense_amt > 0.00),
>> in each table I have column name "monthPayed" (have values of all the months of the year). <<
I hope not! 2014 has not gotten to September, November or December yet! And the ISO-11179 data element name should be “payment_month”; but it is still wrong! An expense is not a payment! An income is not a payment!
>> I would like to create a balance view table that will show me the financial status for the Q1 (for example). <<
Report Period Table
Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements in the DML.
The report period table gives a name to a range of dates that is common to the entire enterprise.
CREATE TABLE Something_Report_Periods
(something_report_name CHAR(10) NOT NULL PRIMARY KEY
CHECK (something_report_name LIKE <pattern>),
something_report_start_date DATE NOT NULL,
something_report_end_date DATE NOT NULL,
CONSTRAINT date_ordering
CHECK (something_report_start_date <= something_report_end_date),
etc);
These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
Now figure it out for yourself, show us what effort you put into this, then we will help you.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Can I run 2 different domains with same name but on 2 different machines?
I am trying to setup 2 domains with same name (sharedcds1) on 2 different machines (Machine1 and Machine2).
When I start the weblogic managed server 1 (sharedcds1managedserver1) on Machine2, it throws an error saying it has some conflicts with the managed server 1 running on Machine1. How did the managed server of one machine know about the other server. Can I run 2 different domains with same name but on 2 different machines?
Here is the error in the log -
<Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
The object from 4596206652609838848S:130.170.61.153:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
ore servers. Such objects can only be deployed from one server.>
<Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
The object from 8842351474821025197S:130.170.61.154:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
ore servers. Such objects can only be deployed from one server.>
Thanks
SatishYes you can. Make sure that domains configured to use different multicast address. WLS uses multicast for communications between nodes in domain.
although your configuration will work, you could have troubles if you going to execute inter-domain calls between domains/servers with the same names. -
We migrated Packages from SSIS 2008 to 2012. The Package is working fine in all the environments except in one of our environment.
SSIS 2012 is intermittently failing with below error while importing data from a source table into a Destination table with same exact schema.
Error: 2014-01-28 15:52:05.19
Code: 0x80004005
Source: xxxxxxxx SSIS.Pipeline
Description: Unspecified error
End Error
Error: 2014-01-28 15:52:05.19
Code: 0xC0202009
Source: Process xxxxxx Load TableName [48]
Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "Invalid date format".
End Error
Error: 2014-01-28 15:52:05.19
Code: 0xC020901C
Source: Process xxxxxxxx Load TableName [48]
Description: There was an error with Load TableName.Inputs[OLE DB Destination Input].Columns[Updated] on Load TableName.Inputs[OLE DB Destination Input]. The column status returned was: "Conversion failed because the data value overflowed
the specified type.".
End Error
But when we reorder the column in "Updated" in Destination table, the package is importing data successfully.
This looks like bug to me, Any suggestion?Hi Mohideen,
Based on my research, the issue might be related to one of the following factors:
Memory pressure. Check there is a memory challenge when the issue occurs. In addition, if the package runs in 32-bit runtime on the specific server, use the 64-bit runtime instead.
A known issue with SQL Native Client. As a workaround, use .NET data provider instead of SNAC.
Hope this helps.
Regards,
Mike Yin
If you have any feedback on our support, please click
here
Mike Yin
TechNet Community Support -
Hi everyone, again landed up with a problem.
After trying a lot to do it myself, finally decided to post here..
I have created a form in form builder 6i, in which on clicking a button the data gets exported to excel sheet.
It is working fine with a single table. The problem now is that i am unable to do the same with 2 tables.
Because both the tables have same number of columns & column names.
Below are 2 tables with column names:
Table-1 (MONTHLY_PART_1)
Table-2 (MONTHLY_PART_2)
SL_NO
SL_NO
COMP
COMP
DUE_DATE
DUE_DATE
U-1
U-1
U-2
U-2
U-4
U-4
U-20
U-20
U-25
U-25
Since both the tables have same column names, I'm getting the following error :
Error 402 at line 103, column 4
alias required in SELECT list of cursor to avoid duplicate column names.
So How can i export the data to excel which has 2 tables with same number of columns & column names?
Should i paste the code? Should i post this query in 'SQL and PL/SQL' Forum?
Help me with this please.
Thank You.You'll have to *alias* your columns, not prefix it with the table names:
$[CHE_TEST@asterix1_impl] r
1 declare
2 cursor cData is
3 with data as (
4 select 1 id, 'test1' val1, 'a' val2 from dual
5 union all
6 select 1 id, '1test' val1, 'b' val2 from dual
7 union all
8 select 2 id, 'test2' val1, 'a' val2 from dual
9 union all
10 select 2 id, '2test' val1, 'b' val2 from dual
11 )
12 select a.id, b.id, a.val1, b.val1, a.val2, b.val2
13 from data a, data b
14 where a.id = b.id
15 and a.val2 = 'a'
16 and b.val2 = 'b';
17 begin
18 for rData in cData loop
19 null;
20 end loop;
21* end;
for rData in cData loop
ERROR at line 18:
ORA-06550: line 18, column 3:
PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names
ORA-06550: line 18, column 3:
PL/SQL: Statement ignored
$[CHE_TEST@asterix1_impl] r
1 declare
2 cursor cData is
3 with data as (
4 select 1 id, 'test1' val1, 'a' val2 from dual
5 union all
6 select 1 id, '1test' val1, 'b' val2 from dual
7 union all
8 select 2 id, 'test2' val1, 'a' val2 from dual
9 union all
10 select 2 id, '2test' val1, 'b' val2 from dual
11 )
12 select a.id a_id, b.id b_id, a.val1 a_val1, b.val1 b_val1, a.val2 a_val2, b.val2 b_val2
13 from data a, data b
14 where a.id = b.id
15 and a.val2 = 'a'
16 and b.val2 = 'b';
17 begin
18 for rData in cData loop
19 null;
20 end loop;
21* end;
PL/SQL procedure successfully completed.
cheers -
SQL 2008 how to compare & identify data among 2 tables with same structure ?
Hello is there a TSQL way of comparing row by row for example comparing DateTimeStamp field in 2 separate tables with same structure in identifying if it's data was changed (If Table1.DateField > Table2.DateField THEN UPDATE it's entire row to match it's
corresponding Table1 row.) ?
Probably thinking would need a cursor to loop through or are there other better ways via TSQL ?
Thanks in advance.Hi,
I am assuming you have a PRIMARY KEY field or a UNIQUE field in both tables, which you should!
You can do this using "UPDATE with INNER JOIN". (SQL Server – Update Table with INNER JOIN)
Working example:
USE [TestDatabase]
GO
/* Create Temp Tables */
CREATE TABLE [dbo].[Table1]
[ID] INT
,[Name] VARCHAR(10)
,[ModifyDate] DATETIME
CREATE TABLE [dbo].[Table2]
[ID] INT
,[Name] VARCHAR(10)
,[ModifyDate] DATETIME
GO
INSERT INTO [dbo].[Table1] ([ID], [Name], [ModifyDate]) VALUES (1, 'Vishal', GETDATE())
INSERT INTO [dbo].[Table2] ([ID], [Name], [ModifyDate]) VALUES (1, 'Gajjar', GETDATE() + 1)
GO
SELECT [ID], [Name], [ModifyDate] FROM [dbo].[Table1]
SELECT [ID], [Name], [ModifyDate] FROM [dbo].[Table2]
GO
UPDATE T1
SET T1.[Name] = T2.[Name]
FROM [dbo].[Table1] T1
INNER JOIN [dbo].[Table2] T2 ON T1.[ID] = T2.[ID] /* Join on Key field */
WHERE T2.[ModifyDate] > T1.[ModifyDate] /* Update criteria */
GO
/* CleanUp - Drop Tables
DROP TABLE [dbo].[Table1], [dbo].[Table2]
This Updates Table1 with latest values from Table2, You need to change the UPDATE statement for your scenario.
- Vishal
SqlAndMe.com -
Get the Common from Two Internal Tables with same structure
Hi ,
I need to get the Common data from Two Internal Tables with same structure with using the looping method.
For e.g.
I have two internal table say ITAB1 and ITAB2.
ITAB1 has values A,B,C,D,E,F
ITAB2 has values A,H,B,Y,O
Output at runtime should be : A,BHi mohit,
1. If u want to compare all fields,
for matching purpose,
then we can do like this.
2.
report abc.
data : a like t001 occurs 0 with header line.
data : b like t001 occurs 0 with header line.
loop at a.
LOOP AT B.
IF A = B.
WRITE :/ 'SAME'.
ENDIF.
endloop.
ENDLOOP.
regards,
amit m. -
2 tables with same primary key
Hi,
2 tables with same primary key is possible,but when is wise to go for such ?
is that a bad desisn ?
eg:
Personal_details_employee
Official_details_employee
these 2 tables have same Primary key emp_id.
plz. reply me at [email protected] also
thanx
vikramhi Vikram,
In this case u can have then in one table itself and why do want to have two tables.
- Suresh.A -
Requesting license for two different ssystem with same SID
Hello,
Is it possible to request 2 license for two systems with same SID. The systems are on different machines and their HW key are different but both have same SID. While requesting license, will it permit to create 2 different license with SAME SID.
Regards
DebHi Anil,
The one for which the license is already requested is the main development portal with SID EP2. I have installed one local version of SAP EP with the same SID EP2. Now we need a license for the second system.
If we change the HW key of the original license which is already applied in the main development portal under SMP and apply for a new license for the new local version, can it have any future implications, if any.
What is the best way to deal with the situation. Is there a full proof way to change the SID of the EP system, which I can try in the local EP system.
Regards
Deb -
Select query for 6 different tables with vbeln as same selction criteria
Hi,
I have a query..
I am using 6 differnet tables with vbeln being the same primary key on the basis of which i have to match the data.
I have assign vbeln with different name but in the select query it gives me the error that vbeln2 is not the correct field.
Can anyone please suggest how can i use the different field name and read the data from the table.hi,
Use alias name for fields / tables in select query, problem will solve
Regards,
Praveen Savanth.N -
Concatenate tables with same name from different servers - CR2013
Hello,
I need some help. I need data from 2 tables with the same name on different SQL servers thru an ODBC connection. When I try to get the data by adding both to my datasource I get data from one or the other. I have considered creating a view, but not sure how to handle this. Thanks.Hi,
Linked Servers are pretty simple and straightforward, just do a search for the procedure.
I do have an additional comment, though. Depending on what tables you're gathering, I've found noticeable differences in performance when I use a connector to a DB on Server Instance "A" linked to "B" versus Server Instance B linked to A. I haven't determined the circumstances affecting one over the other.
If I'm not happy with speed using a connector A, I try switching to B. I like to use as much SQL code as possible, but you can't get around the connector still being a factor.
Matt -
Selecting two different Names using the same table with same field
Hello,
I am trying to display several fields from different tables. Here are some of the fields that I need: The instructor needs to go after the social.
WESL | ENGR-1101-SW1 | Hinojosa | Ashley | Social | Instructor |
I am using a table where they have the social and I need to get both the student and the instructor. How do I select the instructor when the instructor's id is on a different table. example
CLASS PERSON CLASS_ASSIGN
student_id student_id: name facutly_id
Here is the code that I have so far and it works.
rem ----------------
rem Filename: cer.sql
rem Purpose: to get data from banner and put into flat file
rem Date: August 17, 2006 4:51 P.M.
rem Author: Robert Hernandez
rem ---------------
rem Notes: Need to add the Instructor - having problems
rem using the same spriden_id.
rem Also need to have admissions enter the grad date for
rem several students: Procedure is working as is.
declare
l_output utl_file.file_type;
grad_month varchar2(2);
buffer varchar2(1000);
cursor cursor1 is
select ssrmeet_bldg_code,
ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_seq_numb,
spriden_last_name,
spriden_first_name,
spriden_id,
scbcrse_title,
ssbsect_term_code,
sfrstcr_grde_code,
sorhsch_graduation_date,
decode(substr(sorhsch_graduation_date,4,3),'JAN','01',
'FEB','02',
'MAR','03',
'APR','04',
'MAY','05',
'JUN','06',
'JUL','07',
'AUG','08',
'SEP','09',
'OCT','10',
'NOV','11',
'DEC','12') as grad_month,
sorhsch_sbgi_code
from ssbsect,ssrmeet,sfrstcr,spriden,scbcrse,sorhsch
where rownum < 200
and ssbsect_seq_numb like 'S%'
and (ssrmeet_term_code = ssbsect_term_code
and ssrmeet_crn = ssbsect_crn)
and (ssbsect_crn = sfrstcr_crn
and sfrstcr_pidm = spriden_pidm
and length(spriden_id) = 9
and substr(spriden_id,1,1) <> 'A')
and (ssbsect_crse_numb = scbcrse_crse_numb
and ssbsect_subj_code = scbcrse_subj_code)
and spriden_pidm = sorhsch_pidm
and sorhsch_graduation_date is null
order by ssbsect_crse_numb;
begin
l_output := utl_file.fopen('CER','rbfpce.txt','W');
for cur1_rec in cursor1 loop
buffer:= cur1_rec.ssrmeet_bldg_code||'|'||
cur1_rec.ssbsect_subj_code||'-'||
cur1_rec.ssbsect_crse_numb||'-'||
cur1_rec.ssbsect_seq_numb||'|'||
cur1_rec.spriden_last_name||'|'||
cur1_rec.spriden_first_name||'|'||
substr(cur1_rec.spriden_id,1,3)||'-'||
substr(cur1_rec.spriden_id,4,2)||'-'||
substr(cur1_rec.spriden_id,6,4)||'|'||
cur1_rec.scbcrse_title||'|'||
cur1_rec.ssbsect_term_code||'|'||
cur1_rec.sfrstcr_grde_code||'|'||
'20'||SUBSTR(cur1_rec.sorhsch_graduation_date,8,2)||
cur1_rec.grad_month||'|'||
cur1_rec.sorhsch_sbgi_code;
utl_file.put_line(l_output,buffer,false);
end loop;
utl_file.fclose(l_output);
exception
when no_data_found then
utl_file.fclose(l_output);
end;
/Can you be more precise , please :
- which table stores the people identities ? (I call this one Identity)
- which table gives the class where the student works in (I cal l this one Claa_attendees)
- which table gives the instructor of a class (I call this one Class)
If your issue is that you have one table which stores Itendities , and you need to display Student identity and Instructor Identity, you have to call this table twice in your query , using table aliases . I mean :
Select Stud_iden.name, Instr_iden.name
From Identity Stud_iden, Identity Instr_iden, Class_attendees, Class
Where Class.clas_id = class_attendees.class_id
and class.instructor_id = Instr_iden.people_id
and class_attendees.student_id = Stud_iden.people_id
Is this what you need to do ? -
JTable Blank Rows When INSERT/DELETE in other panel with same ViewObject
Hi,
Jdev 10.1.2
JClient
2 panels based on same ViewObject in same AM
One panel with Grid UI => JTable
Other panel with Form UI
When I insert or delete a record in the panel with Form UI and return to the panel with JTable blank rows are displayed.
The problem remains even after commiting before returning to JTable panel.
When I activate the execute button in the JTable panel, the display is OK but the currency is lost.
I suppose calling the refresh method when returning to the JTable panel should solve the problem.
Can you please suggest me a server-side/model workaround:
refresh (which option to use ??)
Thanks
Frederic
PS I tried the workaround of thread 10.1.2 JClient binding Error. but that doesn't help.Same problem with default wizard generated Master-Detail Form.
When in the detail more then 10 rows exist, the scrollbar shows that not all rows are displayed.
If I use the scrollbar to view the last rows they are blank, in order to display them I must activate the next button one time for each additional row.
The workaround is to enter -1 in the range size of the iterator.
But what if the range size is 10.
Is the blank rows display a bug?
OR
Must the scrolling area (size of JScrollPane) be defined according to the range size of the iterator?
If the latter is true:
Can somebody give me some clues on which attributes of the JScrollPane must be set (PreferredSize, MinimumSize ??) and on how to calculate this area: total width & total height if the row height for the table is set to 20?
Your help will be appreciated
Frederic -
Need to create a new row in table with same data as Primary key, but new PK
Hello Gurus ,
I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
Any ideas of how it can be done without much complication?
Thanks in advance for your reply.
Reards,
Swapneel Kaleuser9970447 wrote:
Hello Gurus ,
I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
Any ideas of how it can be done without much complication?
Thanks in advance for your reply.
Reards,
Swapneel Kalesomething like
insert into mytable values ('literal for new pk',
select non-pk-1,
non-pk-2,
non-pk-n
from mytable
where pk-col = 'literal for existing pk')
Maybe you are looking for
-
IPod transfering podcasts to iPod it shouldn't be
iTunes transfers all of my podcasts to my 2nd Gen iPod Nano, regardless if I specify 1, 3, or 5 "most recent" podcasts or even completely disable podcast syncing altogether- The podcasts that are not supposed to be syncing to the iPod cannot be playe
-
Create Folder for FC Studio...
Currently I have all the FC Studio apps in my Dock. Thats: Final Cut Pro, DVD Studio Pro, Live Type, Motion, Compressor <-- all as individual Dock icons. +(Same goes for the Adobe Production Bundle)+ On my PCs I'm using Docks w/ Stacks also. +The dif
-
Running the Outdoor Camera on Batteries
The power adapter for the camera is 12V/1A, 100~240 VAC. Has anyone every run one of these off of a battery? My reason for asking is that I want to mount the camera in a work shed on the back of my property. There is no power in the shed and I had th
-
AAA and 3560 Switch + CNA
Hi Has anyone got this to work? CNA. (Cisco Networks Assistants) and AAA (Tacacs+) on a 3560 switch. I cant get the CNA to work in this setup but it works fine on together with 3500XL and 3550 serie switch. With the same parameter. this is the aaa c
-
We're testing JRockit and it crashes after a few days, after somewhere between 2-6 days of operation. With crash I'm referring to that the process dies completely and a .dump-file is produced (see below) The system is pretty heavy used on a linux box