Joining 5 tables
anybody tell how to join 5 tables .....if u have coding plz send me ........
Hi Ravi,
Dont use joins on five tables, it will impact the performence very badly.. instead use FOR ALL ENTRIES..
Proceed as follows:
SELECT xxxx
FROM xxxx
INTO tab1
WHERE selection condtions.
IF sy-subrc EQ 0
AND NOT tab1[] IS INITIAl.
SELECT yyyy
FROM yyyy
INTO tab2
FOR ALL ENTRIES IN tab1
WHERE xxx EQ tab1-xxx.
and so on.. for all the 5 tables..
Thanks and Best Regards,
Vikas Bittera.
**Points for useful answers**
Similar Messages
-
What is the better way to join table for ASE 12.5?
To join table with T-SQL, there are 2 options:
select * from tab1 a join tab2 b on a.id = b.id where x=y
select * from tab1a, tab2 b where a.id = b.id and x=y
this is only a syntax difference or there is a performance difference? which one is better for performance?The first query (using the join clause) is the ANSI standard way of writing joins and is usually supported by all mainstream RDBMSs.
The second query is the T-SQL method of writing joins and may have limited re-usability with other RDBMSs.
In most cases which one you use is usually one of preference, ie, which ever one you're comfortable with.
From a technical perspective there are some join constructs that you cannot build with T-SQL joins, but can build with ANSI joins (eg, you may have problems in T-SQL with a table that you want to be both a) an inner table of an outer join and b) part of a equi/inner join).
Soooo, ANSI joins provide you a lot more flexibility in coding as well as portability (between other RDBMSs). But if you're going to work with ASE you'll still need to understand how T-SQL joins work as you'll see quite a lot of T-SQL join-based queries. -
How can I pass multiple condition in where clause with the join table?
Hi:
I need to collect several inputs at run time, and query the record according to the input.
How can I pass multiple conditions in where clause with the join table?
Thanks in advance for any help.
Regards,
TDIf you are using SQL-Plus or Reports you can use lexical parameters like:
SELECT * FROM emp &condition;
When you run the query it will ask for value of condition and you can enter what every you want. Here is a really fun query:
SELECT &columns FROM &tables &condition;
But if you are using Forms. Then you have to change the condition by SET_BLOCK_PROPERTY.
Best of luck! -
How to use a MAP whithout join table
Hello
I am still evaluating KODO ;-)
I am using kodo 3.1.2 with an evaluation version
linux (kernel 2.6)
SUN JDK 1.4.2_04
MYSQL MAX 4.0.18 -Max
IDEA 4.0.3 and ANT 1.5.4 (to be exhaustive)
I am wondering how to configure the following mapping involving a Map. :
public class Translation {
private String locale;
private String txt;
public class TranslatableDescription {
/**Map of Key=locale as String; Value = {@link Translation}*/
==> private Map translations = new HashMap(); <==
public void addATranslation(Translation t){
translations.put(t.getLocale(), t);
file package.jdo :
<?xml version="1.0"?>
<jdo>
<package name="data">
<class name="Translation"/>
<class name="TranslatableDescription">
<field name="translations">
<map key-type="java.lang.String"
value-type="tutorial.data.Translation"/>
<extension vendor-name="kodo" key="jdbc-key-size" value="10"/>
</field>
</class>
</package>
</jdo>
The default Mapping generate a join table : TRANS_TRANSLATION which works
fine, but I would like to remove this table by adding a
colonne in the "TRANSLATION" table containing the JDOID of the
TRANSLATIONDESCRIPTION owner of this TRANSLATION.
I have made some try like this one in the mapping file
<class name="TranslatableDescription">
<field name="translations">
<jdbc-field-map type="n-many-map" key-column="LOCALE"
ref-column.JDOID="OWNERJDOID" table="TRANSLATION0"
value-column.JDOID="JDOID"/>
</field>
The schema generated in my DB is correct but when I try to persist some
objects I have the following Exception :
727 INFO [main] kodo.jdbc.JDBC - Using dictionary class
"kodo.jdbc.sql.MySQLDictionary" (MySQL 4.0.18'-Max' ,MySQL-AB JDBC Driver
mysql-connector-java-3.0.10-stable ( $Date: 2004/01/13 21:56:18 $,
$Revision: 1.27.2.33 $ )).
Exception in thread "main" kodo.util.FatalDataStoreException: Invalid
argument value, message from server: "Duplicate entry '2' for key 1"
{prepstmnt 8549963 INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID)
VALUES (?, ?, ?) [reused=0]} [code=1062, state=S1009]
NestedThrowables:
com.solarmetric.jdbc.ReportingSQLException: Invalid argument value,
message from server: "Duplicate entry '2' for key 1" {prepstmnt 8549963
INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID) VALUES (?, ?, ?)
[reused=0]} [code=1062, state=S1009]
java.sql.BatchUpdateException: Invalid argument value, message from
server: "Duplicate entry '2' for key 1"
at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:42)
at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:24)
at kodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:594)
at
kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:152)
at
kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.java:964)
at
kodo.runtime.PersistenceManagerImpl.beforeCompletion(PersistenceManagerImpl.java:813)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:69)
at
kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
at
tutorial.CreateTranslatableDescription.main(CreateTranslatableDescription.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
I have the feeling that KODO does try to make diffent row in the table
"TRANSLATION0" for the TRANSLATION and the MAP.
So, is this kind of mapping supported by KODO and if yes, how can I
configure it.
Thank you for your help
NicolasSo, is this kind of mapping supported by KODO and if yes, how can I
configure it.It is not directly supported. You can fake it using a one-many mapping
(see thread: Externalizing Map to Collection of PC), but unless you must
map to an existing schema, it's probably not worth the effort. (Note:
also there is a bug that actually prevents this from working with 3.1.2;
the bug is fixed for 3.1.3, but it hasn't been released yet). -
Am inserting only one table in a join table view
am in Jdeveloper 11.1.2.1.0
hi i have the following view am only able to insert in one table,which is SMS_PARTY_ADDRESS,am not able to insert to the othe join table which is property, my view is
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
xmlns="http://xmlns.oracle.com/bc4j"
Name="smsProp_partyAddress"
Version="11.1.2.60.81"
BindingStyle="OracleName"
CustomQuery="true"
PageIterMode="Full"
UseGlueCode="false">
<DesignTime>
<Attr Name="_isExpertMode" Value="true"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<LABEL
ResId="sms1100.smsProp_partyAddress_LABEL"/>
</SchemaBasedProperties>
</Properties>
<ViewAccessor
Name="Sub_lov1"
ViewObjectName="sms1100.Sub_lov"
RowLevelBinds="true"/>
<ListBinding
Name="LOV_Town"
ListVOName="Sub_lov1"
ListRangeSize="-1"
ComboRowCountHint="10"
NullValueFlag="none"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="Town"/>
</AttrArray>
<AttrArray Name="DerivedAttrNames">
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="TowId"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="Id"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="DsdRegion"/>
<Item Value="ServiceDeliveryArea"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
<SQLQuery><![CDATA[SELECT SmsPartyAddress.ADDRESS_LINE1,
SmsPartyAddress.ID,
SmsPartyAddress.ADDRESS_LINE2,
SmsPartyAddress.ADDRESS_LINE3,
SmsPartyAddress.ADDRESS_LINE4,
SmsPartyAddress.ADDRESS_TYPE_IND,
SmsPartyAddress.PAR_ID,
SmsPartyAddress.PROP_ID,
SmsPartyAddress.START_DT,
SmsProperties.TOW_ID,
SmsProperties.ID AS ID1,
SmsProperties.ADDRESS_LINE,
SmsProperties.ERF_NO,
SmsProperties.WAR_ID,
SmsProperties.ZONE,
DECODE(TOW1.TOWN,NULL,TOW.TOWN,TOW1.TOWN)TOWN ,
TOW.TOWN SUBURB,
POSTAL_CODE
FROM SMS_PARTY_ADDRESS SmsPartyAddress, SMS_PROPERTIES SmsProperties,
SMS_TOWNS TOW
,SMS_TOWNS TOW1
,SMS_POSTAL_CODES PCOD
WHERE SmsPartyAddress.PROP_ID = SmsProperties.ID(+)
and TOW.PCOD_ID = PCOD.ID
AND TOW.TOW_ID = TOW1.ID (+)
--and TOW1.ID = SMSPROPERTIES.TOW_ID(+)
and TOW.ID = SMSPROPERTIES.TOW_ID
and SmsPartyAddress.prop_id = SmsProperties.id
CONNECT BY PRIOR TOW.TOW_ID = TOW.ID]]></SQLQuery>
<EntityUsage
Name="SmsPartyAddress"
Entity="sms1100.SmsPartyAddress"/>
<EntityUsage
Name="SmsProperties"
Entity="sms1100.SmsProperties"
Association="sms1100.proppaddAssociation"
AssociationEnd="sms1100.proppaddAssociation.SmsProperties"
SourceUsage="sms1100.smsProp_partyAddress.SmsPartyAddress"
ReadOnly="true"
Reference="true"
DeleteParticipant="false"
JoinType="LEFT OUTER JOIN">
<DesignTime>
<AttrArray Name="_srcAttributes">
<Item Value="sms1100.SmsPartyAddress.PropId"/>
</AttrArray>
<AttrArray Name="_dstAttributes">
<Item Value="sms1100.SmsProperties.Id"/>
</AttrArray>
</DesignTime>
</EntityUsage>
<ViewAttribute
Name="AddressLine1"
PrecisionRule="true"
EntityAttrName="AddressLine1"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE1"/>
<ViewAttribute
Name="Id"
IsUpdateable="while_insert"
PrecisionRule="true"
EntityAttrName="Id"
EntityUsage="SmsPartyAddress"
AliasName="ID"/>
<ViewAttribute
Name="AddressLine2"
PrecisionRule="true"
EntityAttrName="AddressLine2"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE2"/>
<ViewAttribute
Name="AddressLine3"
PrecisionRule="true"
EntityAttrName="AddressLine3"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE3"/>
<ViewAttribute
Name="AddressLine4"
PrecisionRule="true"
EntityAttrName="AddressLine4"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE4"/>
<ViewAttribute
Name="AddressTypeInd"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="AddressTypeInd"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_TYPE_IND"/>
<ViewAttribute
Name="ParId"
PrecisionRule="true"
EntityAttrName="ParId"
EntityUsage="SmsPartyAddress"
AliasName="PAR_ID"/>
<ViewAttribute
Name="PropId"
PrecisionRule="true"
EntityAttrName="PropId"
EntityUsage="SmsPartyAddress"
AliasName="PROP_ID"/>
<ViewAttribute
Name="StartDt"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="StartDt"
EntityUsage="SmsPartyAddress"
AliasName="START_DT"/>
<ViewAttribute
Name="TowId"
PrecisionRule="true"
EntityAttrName="TowId"
IsUpdateable="true"
EntityUsage="SmsProperties"
AliasName="TOW_ID"
IsPersistent="true"/>
<ViewAttribute
Name="Id1"
IsUpdateable="while_insert"
PrecisionRule="true"
EntityAttrName="Id"
EntityUsage="SmsProperties"
AliasName="ID1"/>
<ViewAttribute
Name="AddressLine"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="AddressLine"
EntityUsage="SmsProperties"
AliasName="ADDRESS_LINE"/>
<ViewAttribute
Name="ErfNo"
IsUnique="true"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="ErfNo"
EntityUsage="SmsProperties"
AliasName="ERF_NO"/>
<ViewAttribute
Name="WarId"
PrecisionRule="true"
EntityAttrName="WarId"
EntityUsage="SmsProperties"
AliasName="WAR_ID"/>
<ViewAttribute
Name="Zone"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="Zone"
EntityUsage="SmsProperties"
AliasName="ZONE"/>
<ViewAttribute
Name="Town"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="TOWN"
Expression="TOWN"
SQLType="VARCHAR"
LOVName="LOV_Town">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="combo_lov"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
<ViewAttribute
Name="Suburb"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="SUBURB"
Expression="SUBURB"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="PostalCode"
IsPersistent="false"
PrecisionRule="true"
Precision="4"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="POSTAL_CODE"
Expression="POSTAL_CODE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="4"/>
</DesignTime>
</ViewAttribute>
<AttrArray Name="KeyAttributes">
<Item Value="Id"/>
</AttrArray>
<ResourceBundle>
<PropertiesBundle
PropertiesFile="SmsFrontService.SmsFrontServiceBundle"/>
</ResourceBundle>
</ViewObject>i what to insert in both table partyAddress and propertyaddress,the property table the Updateable="never" and is disable,am not able to set is to alwaysuse this method but the column i still disable
<EntityUsage
Name="SmsProperties"
Entity="sms1100.SmsProperties"
Association="sms1100.proppaddAssociation"
AssociationEnd="sms1100.proppaddAssociation.SmsProperties"
SourceUsage="sms1100.smsProp_partyAddress.SmsPartyAddress"
Reference="true"
ReadOnly="false"
DeleteParticipant="false"
JoinType="LEFT OUTER JOIN">
public class smsProp_partyAddressImpl extends ViewObjectImpl {
protected void create(AttributeList attributeList) {
// The view row will already have created "blank" entity instances
SmsPropertiesImpl newProperty = new SmsPropertiesImpl();
SmsPartyAddressImpl newPostal = new SmsPartyAddressImpl();
//SmsPropertiesViewImpl newProperty = getSmsPropertiesView2();
//SmsPartyAddressViewImpl newPostal = getSmsPartyAddressView1();
//SmsPropertiesImpl newProperty = getSmsPropertiesView2();
//SmsPartyAddressImpl newPostal = getSmsPartyAddressView1();
try {
// Let postal Address "blank" entity instance to do programmatic defaulting
newProperty.create(attributeList);
// Let postalAddress "blank" entity instance to do programmatic
// defaulting passing in new SmsPropertiesImpl instance so its attributes
// are available to the SmsPartyAddressImpl's create method.
newPostal.create(newProperty);
catch (JboException ex) {
newProperty.revert();
newPostal.revert();
throw ex;
catch (Exception otherEx) {
newProperty.revert();
newPostal.revert();
throw new RowCreateException(true /* EO Row? */,
"SmsProperties" /* EO Name */,
otherEx /* Details */);
}but the updatable="Always"
the view is
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
xmlns="http://xmlns.oracle.com/bc4j"
Name="smsProp_partyAddress"
Version="11.1.2.60.81"
BindingStyle="OracleName"
CustomQuery="true"
PageIterMode="Full"
UseGlueCode="false"
RowClass="sms1100.smsProp_partyAddressRowImpl"
ComponentClass="sms1100.smsProp_partyAddressImpl"
RowInterface="sms1100.common.smsProp_partyAddressRow"
ClientRowProxyName="sms1100.client.smsProp_partyAddressRowClient">
<DesignTime>
<Attr Name="_isExpertMode" Value="true"/>
<Attr Name="_codeGenFlag2" Value="Access|Coll|Prog|VarAccess"/>
<Attr Name="_isCodegen" Value="true"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<LABEL
ResId="sms1100.smsProp_partyAddress_LABEL"/>
</SchemaBasedProperties>
</Properties>
<ViewAccessor
Name="Sub_lov1"
ViewObjectName="sms1100.Sub_lov"
RowLevelBinds="true"/>
<ListBinding
Name="LOV_Town"
ListVOName="Sub_lov1"
ListRangeSize="-1"
ComboRowCountHint="10"
NullValueFlag="none"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="Town"/>
</AttrArray>
<AttrArray Name="DerivedAttrNames">
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="TowId"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="Id"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="DsdRegion"/>
<Item Value="ServiceDeliveryArea"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
<SQLQuery><![CDATA[SELECT SmsPartyAddress.ADDRESS_LINE1,
SmsPartyAddress.ID,
SmsPartyAddress.ADDRESS_LINE2,
SmsPartyAddress.ADDRESS_LINE3,
SmsPartyAddress.ADDRESS_LINE4,
SmsPartyAddress.ADDRESS_TYPE_IND,
SmsPartyAddress.PAR_ID,
SmsPartyAddress.PROP_ID,
SmsPartyAddress.START_DT,
SmsProperties.TOW_ID,
SmsProperties.ID AS ID1,
SmsProperties.ADDRESS_LINE,
SmsProperties.ERF_NO,
SmsProperties.WAR_ID,
SmsProperties.ZONE,
DECODE(TOW1.TOWN,NULL,TOW.TOWN,TOW1.TOWN)TOWN ,
TOW.TOWN SUBURB,
POSTAL_CODE
FROM SMS_PARTY_ADDRESS SmsPartyAddress, SMS_PROPERTIES SmsProperties,
SMS_TOWNS TOW
,SMS_TOWNS TOW1
,SMS_POSTAL_CODES PCOD
WHERE SmsPartyAddress.PROP_ID = SmsProperties.ID(+)
and TOW.PCOD_ID = PCOD.ID
AND TOW.TOW_ID = TOW1.ID (+)
--and TOW1.ID = SMSPROPERTIES.TOW_ID(+)
and TOW.ID = SMSPROPERTIES.TOW_ID
and SmsPartyAddress.prop_id = SmsProperties.id
CONNECT BY PRIOR TOW.TOW_ID = TOW.ID]]></SQLQuery>
<EntityUsage
Name="SmsPartyAddress"
Entity="sms1100.SmsPartyAddress"/>
<EntityUsage
Name="SmsProperties"
Entity="sms1100.SmsProperties"
Association="sms1100.proppaddAssociation"
AssociationEnd="sms1100.proppaddAssociation.SmsProperties"
SourceUsage="sms1100.smsProp_partyAddress.SmsPartyAddress"
Reference="true"
ReadOnly="false"
DeleteParticipant="false"
JoinType="LEFT OUTER JOIN">
<DesignTime>
<AttrArray Name="_srcAttributes">
<Item Value="sms1100.SmsPartyAddress.PropId"/>
</AttrArray>
<AttrArray Name="_dstAttributes">
<Item Value="sms1100.SmsProperties.Id"/>
</AttrArray>
</DesignTime>
</EntityUsage>
<ViewAttribute
Name="AddressLine1"
PrecisionRule="true"
EntityAttrName="AddressLine1"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE1"/>
<ViewAttribute
Name="Id"
IsUpdateable="while_insert"
PrecisionRule="true"
EntityAttrName="Id"
EntityUsage="SmsPartyAddress"
AliasName="ID"/>
<ViewAttribute
Name="AddressLine2"
PrecisionRule="true"
EntityAttrName="AddressLine2"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE2"/>
<ViewAttribute
Name="AddressLine3"
PrecisionRule="true"
EntityAttrName="AddressLine3"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE3"/>
<ViewAttribute
Name="AddressLine4"
PrecisionRule="true"
EntityAttrName="AddressLine4"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_LINE4"/>
<ViewAttribute
Name="AddressTypeInd"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="AddressTypeInd"
EntityUsage="SmsPartyAddress"
AliasName="ADDRESS_TYPE_IND"/>
<ViewAttribute
Name="ParId"
PrecisionRule="true"
EntityAttrName="ParId"
EntityUsage="SmsPartyAddress"
AliasName="PAR_ID"/>
<ViewAttribute
Name="PropId"
PrecisionRule="true"
EntityAttrName="PropId"
EntityUsage="SmsPartyAddress"
AliasName="PROP_ID"/>
<ViewAttribute
Name="StartDt"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="StartDt"
EntityUsage="SmsPartyAddress"
AliasName="START_DT"/>
<ViewAttribute
Name="TowId"
PrecisionRule="true"
EntityAttrName="TowId"
EntityUsage="SmsProperties"
AliasName="TOW_ID"/>
<ViewAttribute
Name="Id1"
IsUpdateable="while_insert"
PrecisionRule="true"
EntityAttrName="Id"
EntityUsage="SmsProperties"
AliasName="ID1"/>
<ViewAttribute
Name="AddressLine"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="AddressLine"
EntityUsage="SmsProperties"
AliasName="ADDRESS_LINE"/>
<ViewAttribute
Name="ErfNo"
IsUnique="true"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="ErfNo"
EntityUsage="SmsProperties"
AliasName="ERF_NO"/>
<ViewAttribute
Name="WarId"
PrecisionRule="true"
EntityAttrName="WarId"
EntityUsage="SmsProperties"
AliasName="WAR_ID"/>
<ViewAttribute
Name="Zone"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="Zone"
EntityUsage="SmsProperties"
AliasName="ZONE"/>
<ViewAttribute
Name="Town"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="TOWN"
Expression="TOWN"
SQLType="VARCHAR"
LOVName="LOV_Town">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="combo_lov"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
<ViewAttribute
Name="Suburb"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="SUBURB"
Expression="SUBURB"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="PostalCode"
IsPersistent="false"
PrecisionRule="true"
Precision="4"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="POSTAL_CODE"
Expression="POSTAL_CODE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="4"/>
</DesignTime>
</ViewAttribute>
<AttrArray Name="KeyAttributes">
<Item Value="Id"/>
</AttrArray>
<ResourceBundle>
<PropertiesBundle
PropertiesFile="SmsFrontService.SmsFrontServiceBundle"/>
</ResourceBundle>
</ViewObject>am also geting this error in my view after i set readOnly="false"
Remove updateable flag from entity usage or mark attributes as key attributes for this entity usage
i follow your link -
I am beginner in MVC and I would like to create a view which populates two (or more) joined tables in a single view table as described below.
I have two tables:
1 - Bloggers: - bloggerID (int);
- bloggerName (string)
2 - Blogs: - blogID (int);
bloggerID (int);
- blogTitle (string);
- blogImage (string)
A blogger can have one or more blogs while one blog must be related to only one blogger.
I would like to have a view table on my webpage as the following:
Blogger Name
Blog Title
Blog Image
Noris Gang
Virus
virus.jpg
Noris Gang
Desktops
desktop.jpg
Gauthier
Books
books.png
John Leon
NNNMHJhjdhj
Nmbj.jpg
I'm using MVC 4 (or at least 3).
Thanks for your help.Hello,
From your description, it is not very clear that what you mean about the View, if it means the View concept in database as SQL Server, your required view should be as below:
Create view
as
Select Bloggers.bloggerName, Bloggers.blogTitle, Bloggers.blogImage
From Bloggers join Blogs on Bloggers.bloggerID = Blogs. bloggerID
If it means the UI view in MVC concept, I suggest you could ask it on the MVC forum:
http://forums.asp.net/1146.aspx
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
What are the Pros and Cons while joining tables at DF and Universe level
Hi Experts,
I am new to Data federator designer. I need help on the below.
Could you please let me know the Pros and Cons while joining the source tables in data federator
And While joining the DF target tables in universe designer.
Regards,
GanaHi,
1. I have created target tables based on source tables with one to one mapping and then join all target tables in universe.
Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
Target tables:Target tables are same as source tables
--- Yes this is the way to create target Tables and join them in the universe.These target Tables gives you the flexibility like in future your requirement is to add one more object based on some calculation which is not possible in the universe so that time you can create one more column in the target table and do the calculation. at the same time if you are using source table you can not do anything.
2. Created single target table with all objects of source tables and merged all sources tables data.
Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
Target table: Single table.
--- This is bit complex structure to merge all tables data in the one target table.in this situation you have to put more efforts and it is more complex.basically this type of target table is useful when you are merging data by multiple source into single or creating one target table based on the union of tables by adding two mapping rules or more and you can not join tables in universe.
Better approach is first 1. create target tables based on the source tables and join them in the universe.
Thanks,
Amit -
Additional field in join table for CMP EJB
Hello,
I'm trying to perform this task using CMP entity beans:
The entity A has a CMR relation of cardinality m-n with entity B (bidirectional) (This is working fine).
I want to add a parameter to the relation.
Ex : When I find that A1 is linked to B1, I need to perform "x" times an action. x would be my parameter, and I would have kept this parameter as an additional column in the join table A_TO_B.
Could anyone provide an example of how to perform this with CMP EJB?
NOTE: I'm using OC4J 10g 9.0.4 standalone (and cannot change my version).
Thanks
TanguyManohar,
You need to create an append structure for table VBAP (for example ZAVBAP) using SE11. In this structure you create your ZZ fields. If you need a non-SAP domain/data element for your field then you need to create it first using the same transaction and activate it. Attach ZAVBAP to VBAP so the SE11 shows:
.APPEND in the Fields column and
ZAVBAP in the Field type column.
Your ZZ fields will be shown automatically.
When you have finished then activate your ZAVBAP structure. You will notice when you go VA01 (for example) that a lot of programs are being recompiled. Don't worry. It will be ok.
The user-exit screen number for items is 8459 (in program SAPMV45A).
Thanks,
Wojtek -
Hi All,
Here I am facing the problem in Joining table I have S031,s032,makt,marc,I need a field ATWRT field from CAWN table,I did't find any link for this above from tables, any one please help me how to find out.
REPORT ZMMTEST.
tables:s031,s032,makt,marc.
DATA : BEGIN OF itab1 OCCURS 0,
matnr TYPE s031-matnr,
lgort TYPE s031-lgort,
werks TYPE s031-werks,
spmon TYPE s031-spmon,
magbb type S031-magbb,
wagbb type S031-wagbb,
azubb type S031-azubb,
aagbb type S031-aagbb,
END OF itab1.
DATA : BEGIN OF itab2 OCCURS 0,
matnr like makt-matnr,
maktx like makt-maktx,
END OF itab2.
DATA : BEGIN OF itab3 OCCURS 0,
matnr TYPE marc-matnr,
werks type marc-werks,
ekgrp type marc-ekgrp,
END OF itab3.
DATA : BEGIN OF itab4 OCCURS 0 ,
matnr TYPE s032-matnr,
lgort TYPE s032-lgort,
werks TYPE s032-werks,
mbwbest type s032-mbwbest,
wbwbest type s032-wbwbest,
END OF itab4.
data : begin of itab5 occurs 0,
objek type ausp-objek,
atwrt type cawn-atwrt,
end of itab5.
DATA : BEGIN OF itab_final1 OCCURS 0,
matnr TYPE s031-matnr,
lgort TYPE s031-lgort,
werks TYPE s031-werks,
spmon TYPE s031-spmon,
magbb type S031-magbb,
wagbb type S031-wagbb,
azubb type S031-azubb,
aagbb type S031-aagbb,
maktx TYPE makt-maktx,
ekgrp type marc-ekgrp,
mbwbest type s032-mbwbest,
wbwbest type s032-wbwbest,
END OF itab_final1.
DATA : BEGIN OF itab_final OCCURS 0,
matnr TYPE s031-matnr,
lgort TYPE s031-lgort,
werks TYPE s031-werks,
spmon TYPE s031-spmon,
magbb type S031-magbb,
wagbb type S031-wagbb,
azubb type S031-azubb,
aagbb type S031-aagbb,
maktx TYPE makt-maktx,
ekgrp type marc-ekgrp,
mbwbest type s032-mbwbest,
wbwbest type s032-wbwbest,
atwrt type cawn-atwrt,
END OF itab_final.
select-options:s_matnr for s031-matnr.
start-of-selection.
select matnr lgort werks spmon magbb wagbb azubb aagbb
from s031 into table itab1
where matnr in s_matnr.
if not itab1[] is initial.
select matnr maktx from makt into table itab2 for all entries in itab1 where matnr = itab1-matnr.
if not itab2[] is initial.
select matnr werks ekgrp from marc into table itab3 for all entries in itab2 where matnr = itab2-matnr.
if not itab3[] is initial.
select matnr werks mbwbest wbwbest from s032 into corresponding fields of table itab4 for all entries in itab3 where matnr = itab3-matnr.
*if not itab4[] is initial.
select atwrt from cawn into corresponding fields of table itab5.*
endif.
endif.
endif.
endif.
end-of-selection.
loop at itab3.
itab_final-matnr = itab3-matnr.
read table itab2 with key matnr = itab3-matnr.
if sy-subrc = 0.
itab_final-maktx = itab2-maktx.
read table itab1 with key matnr = itab2-matnr.
if sy-subrc = 0.
itab_final-lgort = itab1-lgort.
itab_final-werks = itab1-werks.
itab_final-spmon = itab1-spmon.
itab_final-magbb = itab1-magbb.
itab_final-wagbb = itab1-wagbb.
itab_final-azubb = itab1-azubb.
itab_final-aagbb = itab1-aagbb.
endif.
endif.
itab_final-ekgrp = itab3-ekgrp.
read table itab4 with key matnr = itab3-matnr.
if sy-subrc = 0.
itab_final-mbwbest = itab4-mbwbest.
endif.
itab_final-wbwbest = itab4-wbwbest.
append itab_final.
clear itab_final.
endloop.
WRITE: /2 'material', 23 'storagelocation',29 'plant',35 'date',44 'val.stock.issue',66 'val.stock.issue.value',86 'no.of.stock.receipts',97 'no.of.stock.issues',150 'material.des', 160 'pur.group',190 'stock.val',210 'stock.quan'.
ULINE.
loop at itab_final.
WRITE: /2 itab_final-matnr, 23 itab_final-lgort,29 itab_final-werks,35 itab_final-spmon,44 itab_final-magbb,66 itab_final-wagbb,86 itab_final-azubb,97 itab_final-aagbb,
150 itab_final-maktx, 160 itab_final-ekgrp,190 itab_final-wbwbest,210 itab_final-mbwbest,itab_final-atwrt.
ENDLOOP.
Thanks®ds,
Sree.Hi sree,
take join between s031-sptag ,ausp-datuvthen fetch records based on this condition.(itab1)
After retrieve records based on join condition between
ausp-atinn,ausp-adzhl and cawn-atinn,cawn-adzhl.(itab2)
Retrieve records using for all entries bet first join condition and second join condition.
use for all entries between itab1 and itab2.
it will work surely.
reaward points -
Joining table in GRC 10 Process Control
Hi,
I am trying to create a new Data Source in GRC 10 Process Control. I need to join tables AGR_1251 (main table) and AGR_USERS. I am selecting AGR_1251 as main table. However, nothing comes up when I try to select AGR_USERS as 'Related Table'. On searching AGR_USERS , the system does not return any tables. Both are transparent tables and hence can be joined. I tried using both 'Reference Tables' as well as 'Dependent Tables' .
Can you also explain the difference between 'Reference Tables' and 'Dependent Tables'.
Regards,Hi Amarnath,
tables is used to provide the table for the CURR(currency) or QUAN (quantity) fields.
In your case you want to join tables via foreign key(s) and therefore will have to use dependant tables.
The search for table AGR_USERS as dependant table for AGR_1251 will not return anything since the only table
referred as check table (for a foreign key) in AGR_1251 is AGR_DEFINES.
I would suggest to build your query based on defined check tables (see se11) of the needed tables (in this case AGR_DEFINE is the common point of both AGR_USERS & AGR_1251).
Kind regards,
Pascal -
DB connectivi​ty toolkit: syntax error in a SELECT data from joined tables
Hello everyone
I'm trying to put in labview an SQL query on joined tables.
As example I take a DB for storing the data of 2on2 basketball games, whose tables are
matches(matchId,teamA,teamB)
teams(teamId,PlayerAname,PlayerBname,Nationality)
nationalities(NatId,natName)
To get a result table with the match number and the player names along with their nationality I use this query on MySQL (which works on the command line interface)
SELECT MatchID,
t1.PlayerAName, t1.PlayerBName, n1.natName,
t2.PlayerAName, t2.PlayerBName, n2.natName
FROM matches m
INNER JOIN teams t1 ON t1.teamID = m.teamA
INNER JOIN teams t2 ON t2.teamID = m.teamB
INNER JOIN nationalities n1 ON n1.natID = t1.nationality
INNER JOIN nationalities n2 ON n2.natID = t2.nationality
When I put it in labview, using the "select data" block, I get a syntax error as shown in the attached screenshot.
Am I mistanking something in using the JOIN statements, or the aliases?
Thanks in advance!
Solved!
Go to Solution.
Attachments:
select2dabone.vi 12 KBGiovasa wrote:
I do't like very much the chain of blocks execute query+n*(fetch element)+free object, so I try to avoid that as much that I can...
Sounds like a prime candidate for a subVI. You don't have to use it every time, but it probably would help for cases where you do want to put the SQL query directly in code.
Incidentally, if you're doing joins, you might consider using views, as that allows you to hide the details of the interactions of the tables in the DB itself.
Try to take over the world! -
Can't join tables.query dependency not found "" in EUL
hi ALL,
i created one report in disco 3.1.38 and its' running fine but after storing it in database and then again trying to open it from database it gives me error "can't join tables."name of query folder" dependency not found "" in EUL"
if any one has come across such problem and has solution for it ..please reply back.
thanks in anticipation
manishManish,
I have not run into this error before and maybe one of the oracle consultants could answer this better. But I here it goes. I would first try a refresh on the folders that the report in question is using. Is it possible that the under lining tables have changed? Do you have another copy of the same report outside of the database and does it still work?
Christopher -
Updating JOIN tables in ALDSP Logical View
I've got a logical view which has 3 physical data services in it, representing relational tables in Oracle. The 3 tables are Person(Primary key=PersonID), Address (primary key=AddressID), and a JOIN table which contains PersonID and AddressID. I am able to successfully perform "gets" and "creates" using the logical view, however I have an issue when I try to UPDATE a person by adding a new address record. When I try this from the Test tab in the DSP Studio, I can see that the product inserts a new record to the Address table and then tries to insert a record into the PERSON_ADDRESS table, but it doesn't include the ADDRESS_ID column in the insert so it fails cause that is a non-null column.
Do you know if it is possible to do this? Has anyone had any experience with a similar situation? I attached a couple screenshots of the DSP logical view.
Any help would be appreciated.
Thanks,
Chris
Additional notes:
- The primary keys in the Person and Address table are autogenerated via a SEQUENCE. I have setup the physical services corresponding to each table such that the primary key is qualified as a Sequence column, and specified the Sequence name.One additional note on this issue. When I test the Update method using the Test tab in ALDSP 3.0, if I specify an AddressId when adding a new Address, the process works fine and creates the Address record as well as the Person_Address record correctly. It seems that the issue only occurs when I leave the AddressId empty and let the process populate it using the Oracle SEQUENCE I specified on the physical Address (AddressId) service. When I leave it empty, the DSP correctly generates an AddressId and inserts it into the Address table, it just doesn't attempt to insert the new AddressId into the Person-Address record.
-
Joining tables with SQL in Crystal XI
I am new to Crsytal Reports. I want to join 2 tables using a formula, which I am trying to do in SQL. I created a simple test report and I can get it to work if I don't put any fields on the report from the joined table. ie - if I just use fields from "sal-rep" the report works. As soon as I add a field from "freight" (my joined table) the report will not display anything. (but I don't get any error messages - just a blank report). Here is my SQL:
SELECT "sal-rep"."full-name","sal-rep"."invoice-nbr","freight"."misc-charge-ammount" FROM "PUB"."sal-rep" INNER JOIN "PUB"."FREIGHT" ON ("sal-rep"."invoice-nbr"="freight"."invoice-nbr") WHERE "sal-rep"."invoice-nbr"='0000189957'I got it to work!!! This is the SQL I used -
SELECT "sal_rep"."full-name", "sal_rep"."invoice-nbr", "freight"."misc-charge-ammount", "freight"."invoice-date"
FROM "PUB"."freight" "freight" INNER JOIN "PUB"."sal-rep" "sal_rep" ON ("freight"."invoice-nbr"="sal_rep"."invoice-nbr") AND ("freight"."invoice-date"="sal_rep"."inv-date")
WHERE "sal_rep"."invoice-nbr"='0000189957'
Now when I look at the Table used in Database expert it lists - Command and Freight.
Before it was listing Command and Sal-Rep.
Not sure I understand why, but at least it's working.
thanks for your help - really appreciated! -
Joining tables in different databases
Hi,
I know we can access multiple databases like Oracle, Informix etc. through a single toplink session using session broker. Also in toplink documentation it says there is a work around for joining tables that exists in different databases i.e. joining an Oracle table with an Informix Table. If anyone had tried this or if it is possible, please let me know how to do this.
Thanks..If I could know, how to perform or some sample code, for the following two steps it would be great.
Write descriptor ammendment code to bind together that go from (A) to (B) and (B) to (A).
Be sure to map the ammendment descriptors in the mapping workbench.Or please point me to the right toplink documentation or examples.
Thanks a lot for your help. -
Select distinct problem with muliple join tables, help needed
Hi,
I have two main tables. Each has its of sub joined tables.
guest_id_for_reservation connects two major tables. This has
to be that way
because my guest may change the room status from single to
double (and the
similar exceptional requests).
guests reservation
guest_id_for_reservation
countrytable hoteltable
delegationtable roomtype
I form a query. I want to select distinct those results. But
it does not
work.
If I do not include any table related to reservation table
and its sub
joined tables (disregarding guest_id_for_reservation), it
works.
Is there a specific syntax for select distinct of this type
or any
workaround.?
Thank you
HakanHi I'm still battling with this - have connected the AX to my Imac via ethernet and it shows up fine in Airport Utility. Status light is green and it says its set up to connect to my existing wireless network using wireless connection. Security in Network Preferences is the same for both: WPA2 Personal.
So I don't think there's a problem with the AX, and my current wireless network (BT Home Hub) is working fine.
And when I restore factory settings Airport Utility can see the AX before updating settings so the wireless side of AX must work too.
I'm figuring it must be something about the settings that mean AU can't see it anymore. But I can't work out what, since security is the same.
Any ideas would be great!
Maybe you are looking for
-
How to set 1600 timmings on MSI 790FX-GD70
This is how and these are the settings that I use to achieve stable 1600 timings on my OZC Black Edition Ram using the MSI 790FX-GD70 board. OCZ AMD Black Edition 4GB (2 x 2GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) OCZ3BE1600C8LV4GK timmings CL 8
-
Help Needed in using the FM-URGENT
Hi ALL, Can anybody throw some light on how the following FM's are used , a sample program if any . RKE_CREATE_CO_ITEM_PLANNING RKE_POST_CO_ITEM_PLANNING. Actually I could not come to any conclusion on using one of them for posting my Planning data a
-
Keeps telling me my session has timed out
Everytime I try to use my ITunes,it tells me my session has timed out...
-
PC Suite does not detect my bluetooth stack of blu...
Hi can somebody help me? I have done all advises and procedures regarding uninstalling and installing in the right order but no result. = = = = = = My info is: Bluetoothstack : Bluesoleil 2.3.0.0 release 060728 stackversion: 05.04.11.20060622 PC Co
-
Hi experts I have shifted my career from marketing to sap bw,regarding i left marketing job and joined SAP BW course and now trying for the job. But i am expecting the interview question, why did you shift from marketing career to SAP or what make yo