Query map the DB Link Table

Hi Team
I have query like
select site_id from site;
O/P :-
12323
12444
12333
but i want to stored this date on variable like
v_site (12323,12444,12333)
because i about using dblink for other be i need to put this values like
select * from table@dblink
where site_id in ( v_site);
Thanks for Advance...

Hi,
why dont you put like
----Not tested-----
site_id in (select site_id from site)Regards,
CKLP
Pls mark posts and answered/helpful it you consider it really was.
Edited by: CKLP on Sep 26, 2011 5:12 AM

Similar Messages

  • Query builder and multiple linked tables...

    Hi all,
    I have a database with a large table (50+ fields) and lots of tables (at
    least 10 tables) linked to the bigger one.
    I can link 7 or 8 tables using Query builder but after that, it gets slow
    and slower.
    I can't link other tables since it appear to hang.
    How can I solve this?
    Here is a sample of the large table (articles):
    - id_art
    - code_art
    - material_id_art (fk)
    - color_id_art (fk)
    - finishing_id_art /fk)
    - and so on... with other fields set as foreign keys.
    The color table is:
    - id_col
    - colid_col
    - name_col
    - language_col
    The table view is:
    id_col colid_col name_col language_col
    1 1 rosso it
    2 1 red uk
    3 1 rojo es
    The other tables follow the same color table specification.
    I would like to obtain all articles with color_id_art field equal to the
    color.colid_col field AND color.language_col equal to a session variable
    (language). This session variable contains 'it', 'uk', or 'es', depending
    on user selection on other pages.
    I can use query builder to do something similar with few tables but when
    the linked tables are 10 or more the query builder began to slow down too
    much and is totally unusable.
    Is there a way to create such a query manually?
    I'm not a SQl programmer so, I have not all the knowledge to do this.
    Can anyone point me in the right direction or point me to some tutorial
    about such a problem?
    I thank you in advance.
    tony

    Ciao Tony,
    Well, the main table is 4000+ records
    I´ve heard of other users having similar issues with this (or more) amount of data, what´s not surprising, because every time you´re making a change to your query, the Query Builder tries to refresh the browser
    I think that the problem is related to too much inner joins and too many WHERE clauses with AND condition
    maybe this might add to the problem, but I´m pretty convinced that the major bottleneck is the substantial amount of records your main table has.
    Günter, can I ask you how would you manage a multilingual product catalog where the main table (products) has lots of linked details tables (color, finishing, structure...) to be translated on a number of languages?
    this is indeed a little tricky by nature, however I think that storing e.g. all the international color names in a table is too complicated, when you could simply...
    a) check the currently running language session variable
    b) define a PHP if/else condition which will "virtually" translate the stored "id_col" values, example:
    if ($_session['language'] == "uk") {
    $pattern = array("1", "2", "3", "4");
    $replace = array("red", "blue", "black"', "green");
    $colors = str_replace($pattern, $replace, $row_queryname['columnname']);
    else {
    $pattern = array("1", "2", "3", "4");
    $replace = array("rosso", "blu", "nero"', "verde");
    $colors = str_replace($pattern, $replace, $row_queryname['columnname']);
    3. later in your page "echo" the alias variable $colors, which should return different results depending on the currently active language session variable
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Query directly the EM DB tables?

    Hi,
    Is it possible to query directly the DB sitting behind the EM web front end? Where will this DB normally be found, name of the DB, schema, user account, default password?
    Thanks,
    Yoni

    Hi,
    The URL used shows the hostname where the database is running.
    Ask the dba or systems admin fir the oracle user account details on the machine
    Then log in to the machine.
    Thanks
    M

  • Query for the huge table is not working.

    Hi,
    I am having a link between oracle server and Microsoft sql server let' say 'SQLWEB' this link is perfectly working fine when I query table having few hundred thousand records but It’s not working for one of the table which is having a more then 3 million record at sql server. any one of you is having any Idea why this peculiar behavior is there any limitations for this heterogeneous link is there any workaround for the same. Below you can see the first query returns the count from table but second query is getting disconnected as that’s a very huge table having millions of record.
    shams at oracleserver> select count(*) from investors@sqlweb ;
    COUNT(*)
    15096
    shams at oracleserver> select count(*) from transactions@sqlweb;
    select count(*) from transactions@sqlweb
    ERROR at line 1:
    ORA-02068: following severe error from SQLWEB
    ORA-28511: lost RPC connection to heterogeneous remote agent using SID=%s
    ORA-28509: unable to establish a connection to non-Oracle system
    Regards
    Shamsheer
    Message was edited by:
    Shamsheer

    In general you want to minimize the traffic going over the dblink. This is best handled with view on the sql server try. You might try creating a view on sql server like:
    create view all_investors as
    select * from investors
    Then from sql plus:
    select count from all_investors@sqlweb.

  • Map Builder Labeling Links from Network Theme

    Hi,
    Map Builder cannot change labelig column for links('link_id' is default), I need column 'LINK_NAME'
    I change column manuly in metadata_view
    update user_sdo_themes
    set styling_rules = '
    <label>
    <link column="LINK_NAME" style="T.ROAD NAME"> 1 </link>
    </label>
    where name = '...'
    commit
    and check by select styling_rules from ... all is OK
    refresh data in MapBuilder or restart MapBuilder and ... "link_id" comes back :-)
    This problem is connected with Themes/Network Themes; in Base Maps all is ok.
    Question is, how to change labeling column for links in Network Themes.
    BR,
    Tomek
    Edited by: ToM2 on Dec 4, 2008 5:24 AM

    As a network theme, the link_id and node_id are always used in labelling. If you want to use a different attribute for labeling the links of a network data, you can create a geometry theme based on the network link table (it is a geometry table), and then you will be able to select any column for labeling.
    Joao

  • Joining three tables through link tables

    I have three separate tables that are related to each other through two link tables.
    Employees have a many to many relationship with Programs (1 link table)
    Employee + Programs have a many to many relationship with Attributes (The employee attributes depend on the program). This is another link table.
    So, the first link table (emp_prog_lk) has two columns, employee_id and program_id. The second link table has three attributes, employee_id, program_id, and attribute_id.
    The question is, how can I map the Employee object so that I can call getAttributes(Program) and receive the list of attributes for the specified program? Is this even possible without writing custom SQL?
    Thanks.

    How do you want your object model to look? Do you want Employee to simply have a Collection of Attributes? If so, then you're right, I don't think this is possible -- but to me if you'd like this association table between employees and Attributes to have extra info (in this case a Program), then you need to consider and model it in your Object model.
    I.e., when you have a relationship table that has anything other than the PK's of the 2 tables it's relating, then you really need to model that in Java and aren't really able to rely on the java.util.Collection to suffice.
    - Don

  • JDBC query in the course of a separate EJB transaction

    Hi all,
    I am implementing a web application that let user upload file and send it to the backend for processing,which involves EJB level transaction(many read+write operations),say transaction L .The processing time may last for 10 minutes. Meanwhile the user can view the history of the files he uploaded and CURRENT STATUS of the file he submitted for processing,we call it file upload history summary (they are from direct JDBC query to the upload history table,say table U in the database,since they are read only data).
    My problem is: the user can not see his LATEST file upload status UNTIL the backend processing transaction is completed,although the row for latest file he just submits in Table U was created during the course of the transaction L by an EntityBean UEJB.
    I am using Jboss server,do u guys have any idea so that I can see the new file status once it's created by the UEJB even before the transaction L is completed?Thanks

    You can achieve this by using JMS and MDB. Because once your file is uploaded, the server is busy in loading the data to the database. So it is not sending you back the response as you are doing a synchronous communication. You have to use Asynchronuous communication to achieve this. This way the client will not wait for the response and the transaction to finish.
    While uploading you a send the file as a message object using JMS and MDB. Let the MDB call the other EJB to load the data to the database. Then you can refresh the status browser automatically in certain periods to retrieve data using other EJB like simple access. The browser will automatically submit itself and get the data from EJB while the other EJB uploading the data to the database.
    Hope this helps. If you are still not clear write again. I will explain it again.
    Thanks
    Amit

  • Link table/References table

    Hi folks, looking for some advice, I have the same product supplied by many suppliers the only difference is the price.
    I have a Products table and a Suppliers table was thinking of adding a link table. This will allow the products to have many suppliers i.e. I would only need to enter the products once into the database.
    The problem is each supplier charges a different price for the same product; do I need a price table linked to the SupplierProduct link table?
    Open to ideas
    Ps what is the difference between a Link table and Reference table, to me they are just the same thing?

    Take a look at the AdventureWorks example:
    BusinessEntityID is actually VendorID.
    SQL Server uses the junction table terminology for link (bridge, crossref) table.
    The "Reference" terminology: FOREIGN KEY reference, parent-child tables.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Reset changes in view link table when cancel popup

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    I have a form with a table which I edit with a popup.
    inside this popup I have a view link table.
    On cancel the popup I would like to clear the changes that were made in the view link table.
    I was trying this code:
    public void popupCancelListener(PopupCanceledEvent popupCanceledEvent) {
            DCIteratorBinding it= getBindings().findIteratorBinding("MyViewLinkIterator");
            ViewObject vo = it.getViewObject();
            vo.clearCache();
            vo.executeQuery();
    But it didn't work, when I open the popup again I see the changes that were made in the view link.
    they weren't reset.
    Any idea?
    Thanks a lot!

    It doesn't help.
    As I check, If I'm creating a new row
    after
      vo.clearCache(); 
      vo.executeQuery();
    the row is still existing.
    How could it happen?

  • Problem Set Linked Table

    Hi to all,
    Im using SAP B1 2005B SP:00 PL01. I created a UDT. Now iv created a UDF in a master form from where i want to link the values of the UDT to this field.. Now wen i go to use the SET LINKED TABLE option the length automatically gets set to 8.. Now wen i try to add the field i get the erro saying "Alphanumeric Column size cannot be decreased." Help would be appreciated
    Regards
    Aris

    Hi Aristotle,
    To resolve this, please follow the instructions below:
    1.        Create the UDF with Type - Alphanumeric and Structure - Text
    2.        Now check the box Set Linked Table - note that the structure is regular again.
    3.        Now add the table and the error is displayed.
    4.        Now uncheck the box 'Set Linked Table' and set the Structure to Text again and recheck the box 'Set Linked Table'.
    5.        Now add the UDF and see that it is sucessful.
    Regards,
    Adrian

  • UDF length and link table

    Dear everyone,
      I tried to add an aplhanumeric UDF and set it to 4.  The system returns an error "Aplhanumeric column size cannot be decreased".  If i linked that UDF to another UDT, the length is limited in 8.  How could i solve the above problem??
    Regards,
    Kit

    This is a known bug in 2005 SP1, SAP Note 960134 details it and a workaround.
    Simply using the DI API to create the field will also get round the problem.
    Another simple workaround I found was to:-
    a) set the new field to alpha size 1
    b) tick and then untick the "set linked table" checkbox
    c) now set the field size to whatever you want and click on add
    John.

  • SELECT * cannot be used in an INSERT INTO query when the source or destination table contains a multivalued field

    Hi,
    I am using Access 2013 and I have the following VBA code, 
    strSQL = "INSERT INTO Master SELECT * from Master WHERE ID = 1"
     DoCmd.RunSQL (strSQL)
    when the SQL statement is run, I got this error.
    SELECT * cannot be used in an INSERT INTO query when the source or destination table contains a multivalued field
    Any suggestion on how to get around this?
    Please advice and your help would be greatly appreciated!

    Rather than modelling the many-to-many relationship type by means of a multi-valued field, do so by the conventional means of modelling the relationship type by a table which resolves it into two one-to-many relationship types.  You give no indication
    of what is being modelled here, so let's assume a generic model where there is a many-to-many relationship type between Masters and Slaves, for which you'd have the following tables:
    Masters
    ....MasterID  (PK)
    ....Master
    Slaves
    ....SlaveID  (PK)
    ....Slave
    and to model the relationship type:
    SlaveMastership
    ....SlaveID  (FK)
    ....MasterID  (FK)
    The primary key of the last is a composite one of the two foreign keys SlaveID and MasterID.
    You appear to be trying to insert duplicates of a subset of rows from the same table.  With the above structure, to do this you would firstly have to insert rows into the referenced table Masters for all columns bar the key, which, presuming this to be
    an autonumber column, would be assigned new values automatically.  To map these new rows to the same rows in Slaves as the original subset you would then need to insert rows into SlaveMastership with the same SlaveID values as those in Slaves referenced
    by those rows in Slavemastership which referenced the keys of the original subset of rows from Masters, and the MasterID values of the rows inserted in the first insert operation.  This would require joins to be made between the original and the new subsets
    of rows in two instances of Masters on other columns which constitute a candidate key of Masters, so that the rows from SlaveMastership can be identified.
    You'll find examples of these sort of insert operations in DecomposerDemo.zip in my public databases folder at:
    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
    If you have difficulty opening the link copy its text (NB, not the link location) and paste it into your browser's address bar.
    In this little demo file non-normalized data from Excel is decomposed into a set of normalized tables.  Unlike your situation this does not involve duplication of rows into the same table, but the methodology for the insertion of rows into a table which
    models a many-to-many relationship type is broadly the same.
    The fact that you have this requirement to duplicate a subset of rows into the same table, however, does make me wonder about the validity of the underlying logical model.  I think it would help us if you could describe in detail just what in real world
    terms is being modelled by this table, and the purpose of the insert operation which you are attempting.
    Ken Sheridan, Stafford, England

  • How to Bind a Combo Box so that it retrieves and display content corresponding to the Id in a link table and populates itself with the data in the main table?

    I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables:
    1. Party (PartyId, Name)
    2. Case (CaseId, CaseNo)
    3. Petitioner (CaseId, PartyId) ............. Link Table
    I am completely new to .Net and to begin with I download Microsoft's sample application and
    following the pattern I have been successful in creating several tabs. The problem started only when I wanted to implement many-to-many relationship. The sample application has not covered the scenario where there can be a any-to-many relationship. However
    with the help of MSDN forum I came to know about a link table and managed to solve entity framework issues pertaining to many-to-many relationship. Here is the screenshot of my application to show you what I have achieved so far.
    And now the problem I want the forum to address is how to bind a combo box so that it retrieves Party.Name for the corresponding PartyId in the Link Table and also I want to populate it with Party.Name so that
    users can choose one from the dropdown list to add or edit the petitioner.

    Hello Barry,
    Thanks a lot for responding to my query. As I am completely new to .Net and following the pattern of Microsoft's Employee Tracker sample it seems difficult to clearly understand the concept and implement it in a scenario which is different than what is in
    the sample available at the link you supplied.
    To get the idea of the thing here is my code behind of a view vBoxPetitioner:
    <UserControl x:Class="CCIS.View.Case.vBoxPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:v="clr-namespace:CCIS.View.Case"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    d:DesignWidth="300"
    d:DesignHeight="200">
    <UserControl.Resources>
    <DataTemplate DataType="{x:Type vm:vmPetitioner}">
    <v:vPetitioner Margin="0,2,0,0" />
    </DataTemplate>
    </UserControl.Resources>
    <Grid>
    <HeaderedContentControl>
    <HeaderedContentControl.Header>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <TextBlock Margin="2">
    <Hyperlink Command="{Binding Path=AddPetitionerCommand}">Add Petitioner</Hyperlink>
    | <Hyperlink Command="{Binding Path=DeletePetitionerCommand}">Delete</Hyperlink>
    </TextBlock>
    </StackPanel>
    </HeaderedContentControl.Header>
    <ListBox BorderThickness="0" SelectedItem="{Binding Path=CurrentPetitioner, Mode=TwoWay}" ItemsSource="{Binding Path=tblParties}" />
    </HeaderedContentControl>
    </Grid>
    </UserControl>
    This part is working fine as it loads another view that is vPetioner perfectly in the manner I want it to be.
    Here is the code of vmPetitioner, a ViewModel:
    Imports Microsoft.VisualBasic
    Imports System.Collections.ObjectModel
    Imports System
    Imports CCIS.Model.Party
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' ViewModel of an individual Email
    ''' </summary>
    Public Class vmPetitioner
    Inherits vmParty
    ''' <summary>
    ''' The Email object backing this ViewModel
    ''' </summary>
    Private petitioner As tblParty
    ''' <summary>
    ''' Initializes a new instance of the EmailViewModel class.
    ''' </summary>
    ''' <param name="detail">The underlying Email this ViewModel is to be based on</param>
    Public Sub New(ByVal detail As tblParty)
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Me.petitioner = detail
    End Sub
    ''' <summary>
    ''' Gets the underlying Email this ViewModel is based on
    ''' </summary>
    Public Overrides ReadOnly Property Model() As tblParty
    Get
    Return Me.petitioner
    End Get
    End Property
    ''' <summary>
    ''' Gets or sets the actual email address
    ''' </summary>
    Public Property fldPartyId() As String
    Get
    Return Me.petitioner.fldPartyId
    End Get
    Set(ByVal value As String)
    Me.petitioner.fldPartyId = value
    Me.OnPropertyChanged("fldPartyId")
    End Set
    End Property
    End Class
    End Namespace
    And below is the ViewMode vmParty which vmPetitioner Inherits:
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Collections.Generic
    Imports CCIS.Model.Case
    Imports CCIS.Model.Party
    Imports CCIS.ViewModel.Helpers
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' Common functionality for ViewModels of an individual ContactDetail
    ''' </summary>
    Public MustInherit Class vmParty
    Inherits ViewModelBase
    ''' <summary>
    ''' Gets the underlying ContactDetail this ViewModel is based on
    ''' </summary>
    Public MustOverride ReadOnly Property Model() As tblParty
    '''' <summary>
    '''' Gets the underlying ContactDetail this ViewModel is based on
    '''' </summary>
    'Public MustOverride ReadOnly Property Model() As tblAdvocate
    ''' <summary>
    ''' Gets or sets the name of this department
    ''' </summary>
    Public Property fldName() As String
    Get
    Return Me.Model.fldName
    End Get
    Set(ByVal value As String)
    Me.Model.fldName = value
    Me.OnPropertyChanged("fldName")
    End Set
    End Property
    ''' <summary>
    ''' Constructs a view model to represent the supplied ContactDetail
    ''' </summary>
    ''' <param name="detail">The detail to build a ViewModel for</param>
    ''' <returns>The constructed ViewModel, null if one can't be built</returns>
    Public Shared Function BuildViewModel(ByVal detail As tblParty) As vmParty
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Dim e As tblParty = TryCast(detail, tblParty)
    If e IsNot Nothing Then
    Return New vmPetitioner(e)
    End If
    Return Nothing
    End Function
    End Class
    End Namespace
    And final the code behind of the view vPetitioner:
    <UserControl x:Class="CCIS.View.Case.vPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    Width="300">
    <UserControl.Resources>
    <ResourceDictionary Source=".\CompactFormStyles.xaml" />
    </UserControl.Resources>
    <Grid>
    <Border Style="{StaticResource DetailBorder}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBlock Grid.Column="0" Text="Petitioner:" />
    <ComboBox Grid.Column="1" Width="240" SelectedValuePath="." SelectedItem="{Binding Path=tblParty}" ItemsSource="{Binding Path=PetitionerLookup}" DisplayMemberPath="fldName" />
    </Grid>
    </Border>
    </Grid>
    </UserControl>
    The problem, presumably, seems to be is that the binding path "PetitionerLookup" of the ItemSource of the Combo box in the view vPetitioner exists in a different ViewModel vmCase which serves as an ObservableCollection for MainViewModel. Therefore,
    what I need to Know is how to route the binding path if it exists in a different ViewModel?
    Sir, I look forward to your early reply bringing a workable solution to the problem I face. 
    Warm Regards,
    Arun

  • Run a query on linked tables to create a new datasource

    Using Crystal XI
    I have a report that draws from two data sources.  They can't be joined at the server side, but they are linked in Crystal Database Expert. 
    I can't figure out if Crystal gives me a way to write an SQL Query to run an aggregate function referencing both tables.  The results of this query would be the datasource for a graph in the report.  I'm wondering if Crystal gives me a way, maybe through subreports, to write the query I need.
    More concretely:
    And I want to include in my datasource alarmId, Hour and the Maximum amount of calls received in any one hour for any one station (this maximum is to provide scale for a graph)
    In one table nameed AlarmStartTimes I have data like
    Alarms
    AlarmID  Hour    Recipient
    Alarm1       8       Joe
    Alarm23  10      Mark
    Alarm60  7      Joe
    Alarm95  8      Linda
    In another I have data like
    EELocation
    Recipient   Location
    Joe         Station1
    Mark         Station2
    Linda          Station1
    So if I could just join my talbes at the server side I'd use a query like:
    select *, max(select count(AlarmID) from Alarms, EELocation from Alarms Join EELocationo on Alarms.Recipient=EELocation.Recipient group by Hour, Location) AS  from Alarms
    Anyway, that's probably got a syntax error or 4 in it, but you get the idea.
    I can't group on the database side.  Since Crystal is able to link the two tables and successfully group them out by Location, it seems like there should be some way for me to run a query against the tables reflecting that existing link, but I can't see how to do it.
    The reason I can't link on database side is that the data is in two databases, and it's not known what the location of the databases is at report-writing time.  The location of the databases gets set via the Crystal API when the report is launched from an application.

    Since you have 2 datasource in the report you are limited on what you can use in crystal, such as crystal will not allow you to use sql expressions.

  • SQL Query in mapping to load warehouse table

    Hi experts,
    I hope you can help me to solve my problem. I already searched here in forum how we can add a query in a mapping but still not found an answer.
    In my warehouse I have a time dimension table which has a unique dimension key and all date information. In my source database I have a table for sales information. In that sales table I have a field called date. This date will be in format dd.mm.yyyy.
    I also have a sales table in my warehouse what is nearly a copy of the source sales table. I have only one more field in this warehouse sales table called "time_dim_key". That field should get the dimension key of the warehouse time dimension table depending to the date out of the sales table from source.
    To do that I'm thinking about a mapping what includes:
    - the source sales table
    - the warehouse dimension time table
    - the warehouse sales table
    The normal fields I can directly map from source sales table to warehouse sales table.
    But the "time_dim_key" field of warehouse sales table should get filled like:
    select dimension_key from warehouse_time_dim_table where day_date = source_sales_table.date
    Unfortunately I don't know how I include a query to get the correct date out of that source sales table in the mapping to fill the warehouse sales table.
    I hope somebody can help me to solve that issue.
    Thanks a lot!
    Regards,
    David

    take joiner from the pallete
    and create two groups
    1.warehouse_time_dim_table
    2.source_sales_table
    then in join condition write
    warehouse_time_dim_table.day_date = source_sales_table.date
    That will solve the purpose.
    Cheers
    Nawneet

Maybe you are looking for