ODBC Connection with one to many results

Hi there - I have followed Stefan Cameron's excellent blogs on linking livecycle forms to data from an odbc connection however I have now become stuck.
Effectively I have a form that populates part of the form with matching data for a specific id, however I then need to populate a different part of the form from another database connection that holds multiple records for that id.
I have successfully completed the first part (YEAY!) however the second bit I cannot do - I have tried using the xfa.sourceSet.dataconnection.next() however this repeats the same data and doesn't seem to want to get the next record.
What I seem to need is a mix of Stefan's "selecting specific records" (which works great for the first bit) then the retrieving ALL records bit from here
http://forms.stefcameron.com/2006/10/12/displaying-all-records-from-an-odbc-data-connectio n/
but only where the relation matches the first section.
Does anyone have any ideas - I'm sorry if I am not being very clear - I can post more detail if needed.
Regards,
Bev.

Thanks Paul - I already have two data connections as there are two different result sets I am working on
To clairfy - the first data connection retrieves grant id, title name and address of all grants
The second data connection then retrieves financial data for all projects related to those grants
There are several records of financial data per grant.
So the first bit of code retireves all relevant data for the grant selected.
xfa.sourceSet.claimdata.#command.query.select = concat("SELECT grt_title, grt_contact, grt_org, grt_addr, grt_post FROM gs_user_claim_pdf_table WHERE grt_id = ",sGrtId, ";")
xfa.sourceSet.claimdata.open()
xfa.sourceSet.claimdata.first()
This bit works fine
The second bit is only working for the first record it finds - what I need to do is to loop through all the results and populate a repeating subform with the relevant results but I just don't know how!
xfa.sourceSet.subproject.#command.query.commandType = "text"
xfa.sourceSet.subproject.#command.query.select = concat("SELECT sub_prj_title,claim_amt,tot_est_cost,unit_type,total_units,funded_by,exp_type,grt_id,prj_ id FROM gs_user_sub_proj_table WHERE grt_id = ", sGrtId, ";")
xfa.sourceSet.subproject.open()
xfa.sourceSet.subproject.first()
_subprojects.addInstance(1)
xfa.sourceSet.subproject.next()
Any pointers gratefully received!

Similar Messages

  • How many apple tv can I connect with one account?

    how many apple tv can I connect with one account?

    there are 2 recent posts that suggest issues over 5, one where someone was trying to troubleshoot for a friend or client as they couldn't keep more than 5 connected, and the other where somone had more than 5 but was using 2 separate itunes libraries to share the load - not sure if that was with the same or differing AppleIDs.
    I guess there is always the possibility that things kight vary from one itunes version to the next even unintentionally to allow more.
    AC

  • Odbc connectivity with Data services 4.2

    Hi guys
    i have very general question to ask...
    presently i have dataflow which has one source table connects to query transform and further query transform connects with target table.. query transform has no filter, no order, no group by ... it is simple select * from source table ......... company where the source tables resides have given us their odbc driver to connect and extract same data... but it takes very long time to copy at our end.. i admit that data is more than 100 million (takes more than 4 hrs) records.. but could you please help me to debug what can be done to increase the performance and how can i check why it takes very long time...
    ODBC connection set up in administrative tools->ODBC application.. is there any other way to set up the odbc....
    when i run same query on the tool provided by them to connect with LIVE system.. it takes half of the time taken by data services to copy..
    I have tried changing the dataflow properties between in-memory/ pageable with degree of parallelism.
    what can i check on my end if anything wrong going at my end... before i tell anything to source company to see...
    I would be very greatful if anyone can help me to understand same.
    regards

    Hi,
    If your database is SQL server, install a SQL native client on the DS machine to connect to the DB. You don't need a ODBC for connection of DS with DB.
    Check this, assuming your DB is SQL.
    Can Data Services 4.1 Datastore connect to 32-bit MSSQL 2005 DB?
    SAP Data Services 4.1 - SQL Server Native Client issue
    Arun

  • TopLink11 Tutorial problems with one-to-many relation

    Hi,
    I installed TopLink 11 and the related tutorial to work in a simple Eclipse project.
    Everthing works fine except for the storing of the one-to-many relation in the database.
    The tutorial works with employee, address and phone tables/classes. Plain Objects can be stored and one-to-one relations too. However when trying to store a one-to-many relation not the key of the related object (which is at that tome well known) but the object is tried to be entered
    in the Logfile I find:
    [TopLink Fine]: 2008.01.10 10:27:28.748--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--INSERT INTO EMPLOYEE (EMP_ID, L_NAME, F_NAME, ADDR_ID, VERSION) VALUES (?, ?, ?, ?, ?)
         bind => [1501, Pascal, Blaise, 2252, 1]
    [TopLink Finer]: 2008.01.10 10:27:28.748--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--commit transaction
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--end unit of work commit
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--release unit of work
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--release unit of work
    [TopLink Finest]: 2008.01.10 10:27:28.748--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Register the object Employee: Blaise Pascal
    [TopLink Finest]: 2008.01.10 10:27:28.748--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query DoesExistQuery()
    [TopLink Finer]: 2008.01.10 10:28:58.370--UnitOfWork(18511661)--Thread(Thread[main,5,main])--begin unit of work commit
    [TopLink Finer]: 2008.01.10 10:28:58.370--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--begin transaction
    [TopLink Finest]: 2008.01.10 10:28:58.370--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query UpdateObjectQuery(Employee: Blaise Pascal)
    [TopLink Finest]: 2008.01.10 10:28:58.386--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(PhoneNumber[desk]: (603) 123-4567)
    [TopLink Fine]: 2008.01.10 10:28:58.386--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--INSERT INTO PHONE (P_NUMBER, EMP_ID, AREA_CODE, TYPE) VALUES (?, ?, ?, ?)
         bind => [1234567, {Employee: Blaise Pascal}, 603, desk]
    [TopLink Warning]: 2008.01.10 10:28:58.511--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071214)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Ungültiger Spaltentyp Error Code: 17004
    the highlighted section should be 1501 (the key of the employee record)
    Any ideas how to fix this?
    Thanks Erika

    Erika,
    You need to specify the other side of the relationship (on the PhoneNumber side), which is done by putting a @ManyToOne annotation on the "employee" attribute in PhoneNumber. That will cause TopLink to know that it is a relationship and not a basic mapping.
    -Mike

  • Select with One-to-Many and Many-to-One without repeating

    Hi
    I have a customer who needs a report two sides left and right, but allowing for One-to-Many and Many-to-One relationships in the one report.
    A little background:-
    This has do do with listings on land and buildings.
    One building can be built on a few pieces of land.
    Similarly, there can be several buildings on one piece of land.
    What is required is a listing of buildings on the left, land on the right, but without repeating the "single line entries" either left or right.
    For example Building1 is on Land1 and Land2, and Building2 and Building3 are built on Land3.
    We need:-
    Building1 Land1
    ________Land2
    Building2 Land3
    Building3______
    The ___ just used for spacing so you get the idea ;)
    Essentially - a "break by" on columns on the left and right.
    The Buildings and Land are in different tables, with a link table - one row for each link.
    Any ideas?
    Thanks
    Mike

    To jitu.jk - first, this is not in SQL*Plus - its a report in APEX - second, I see no way to break on the left and the right in the same select.
    Maybe there is a way.
    To Etbin
    This is a very inovative solution - I've tried it out and the result is:-
    BUILDING LAND
    _____Land 4
    _____Land 3
    _____Land 5
    Building 2 Land 4
    Building 3 Land 1
    _____Land 4
    Building 4 Land 4
    Building 5 Land 3
    _____Land 4
    (The underscores I put in for spacing - not perfect but you get the idea - hard whe you write the reply in a fixed space font and it's displayed in the forum in variable space font!! ;)
    9 rows selected.
    This is not quite the desired result - in your list of associations, we have Building1 associated with Land 3,4, and 5.
    So for Building 1 we should have:-
    Building 1 Land 3
    ________Land 4
    ________Land 5..........
    But your result doesn't include Building 1 at all.
    The other requirement is that no building or land is ever repeated - so I came up with the concept of "groups".
    Starting with one building - I find all pieces of land that are associated - listing them on the right (without repeating the building.
    I then find any other buildings asociated with any of the land records that the first building was associated with.
    These are listed on the left - without repeating the land records on the right.
    This group is given a unique identifier of the minimum association ID (my associations have ID's).
    This all done, I use the unique ID as a break column ans summarise additional columns (area, value etc) below each group.
    Because of the summaries - adding area and value etc, I can't have any building or land duplicated as I would then "double count" the area, value etc.
    Maybe you method can be made to work with some tweaking.
    Very clever indeed - forums need great answers like this - it keeps us going.
    Thanks again
    Mike

  • Odbc-connection with ms-access

    hello,
    this is my problem
    if I migrate an MS Access db to Oracle with the OMW than is the ODBC connection, from MS Access to Oracle, perfect.
    Bud I have used the migration script witch is generated by OMW and by made a connection from MS Access to Oracle in some tables the ODBC connection Failed.
    What is the problem????
    Thanks
    Andre

    You don't need MS Access installed to use the JDBC-ODBC driver.

  • ODBC Connectivity with Crystal Reports 2009 and MySQL

    Hi,
    I'm hoping someone can help me. We are currently running Crystal Reports CR Developer version 9.2.2.693 with an ODBC connection (ODBC 3.51 driver) to a My SQL database, version 4.0.18.*
    We want to upgrade to Crystal Reports 2008, CR Developer version 12.0.0.683, however when I try to run reports to the current database, I get the following error:
    *Database Connector Error: 2300:[MySQL][ODBC 3.51 Driver][mysqld-4.0.18-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near  .client where 0=1  at line 1 [Database Vendor Code: 1064] *
    Has anyone encoutered this before? Do I need to get a different rev. ODBC driver? Thanks in advance for your help.

    Thanks for your suggestion, but since the same query works when I use Crytal Reports 9 to the same MySQL database, I don't think that's the issue. I wonder if it has to do with the driver.

  • SSAS 2008 snowflake - dimensions with one-to-many relationship (NOT fact table) and hierarchy?

    Hi, below is my data model for SSAS 2008 on snowflake schema.
    Below is SQL Server DW tables:
    DimStudent - StudentID [primarykey], StudentName, DateOfBirth, AddressID
    DimStudentAddresses - AddressID [primarykey], StudentID [foreignkey], ddressLine1, AddressLine2, AddressType
    FactEnrolment - StudentID, EnrolWeek, EnrolFees
    So here FactEnrolement.StudentID is joined to DimStudent.StudentID column,
    and relationship between DimStudent & DimeStudentAddresses is one to many I.e. one student can have multiple addresses like primary or secondry address.
    To design snowflake schema in SSAS 2008 BIDS project :
     [Question-1] how to join one-to-many dimensions (NOT fact table) Like DimStudent & DimAddresses?
     [Question-2] At the end I want to have a single dimension only I.e. Student which should have both DimStudent & DimStudentAddresses tables attributes init. So I can create hierarchy from these two table into a single dimension? How
    to do this?
    Please reply with feedback particular to my above scenario as I refereed other MSDN forums but nothing solid I found.
    Any STEP-BY-STEP guideline please. Many thanks.

    Hello KM,
    Have you solved this issue after refer to Bill's suggestion? Please let us know how things go.
    If you have any feedback on our support, please click
    here.
    Best Regards,
    Elvis Long
    TechNet Community Support

  • Broadband connection with one static ip

    Hello Everyone!!
    I would like to seek your kind suggestion in mapping static ip address to the local ip address.
    We have a bsnl broadband connection, and bsnl has provided us with one static ip address.
    We are using  broadband modem.
    Now I would liket to map this static ip address to one of the private ip address which is 192.168.1.2(database server).
    i want to do nat above ips if i do so then i dont have no ip to assign to my outside interface.
    I would like to access this device over internet, by typing my public (Static ip ) given by the BSNL.
    Kindly let me know how should i configure this modem.
    security device i have is cisco ASA 5505.
    Need suggestion.
    thanks in advance

    Hi,
    I am afraid that if you are asking for guide to configuring your broadband modem then this is probably not the best section of the Cisco Support Community to do that.
    Generall though it would be best if the modem you have was configured as Bridged device and the public IP address was configured on the ASA5505 directly on its "outside" interface. This saves you from a lot of trouble playing with possible NAT configurations on 2 devices.
    On the ASA5505 you will basicly be configuring Static PAT and NOT Static NAT.
    Static NAT would bind the public IP address to the use of only single internal host.
    Static PAT on the other hand would bind certain TCP/UDP ports to some internal host.
    So naturally we should first determine which ports you need to forward to the internal host and also what the software level of your ASA5505 is so we know which NAT configuration format to use (version number is shown with the command "show version" or in the  main view of the ASDM)
    NAT/ACL 8.2 (and older) Configuration format
    static (inside,outside) tcp interface 80 192.168.1.2 80 netmask 255.255.255.255
    access-list OUTSIDE-IN permit tcp any interface outside eq 80
    access-group OUTSIDE-IN in interface outside
    In the above configuration we first use the "static" command to configure the Static PAT. The configuration basicly states that we want to forward the TCP/80 port using the "outside" "interface" IP address to the local IP address of 192.168.1.2 and local port of TCP/80.
    Finally we make an ACL that allows TCP/80 traffic from anywhere and we attach the ACL to the "outside" interface with "access-group" command. If there is an existing ACL attached to the "outside" interface then you would naturally use that.
    NAT/ACL 8.3 (and newer) Configuration Format
    object network SERVER-WWW
    host 192.168.1.2
    nat (inside,outside) static interface service tcp 80 80
    access-list OUTSIDE-IN permit tcp any object SERVER-WWW eq 80
    access-group OUTSIDE-IN in interface outside
    The above basicly does the same as the first example with the older ASA software. There are just noticiable changes in the NAT and ACL configuration formats.
    Hope this helps
    - Jouni

  • Move VS Windows App (Access DBS with one to many form)

    I have a VS Windows App (forms connected to an Access DBS-including one to many form) and would like to have users access via our SharePoint 2001 site...
    thank you.
    mjschukas

    Hi mjschukas,
    This forum is to discuss problems of Windows Forms. Your question is related to SharePoint.
    You can consider posting it in sharePoint forum(http://social.technet.microsoft.com/Forums/en-US/home?forum=sharepointdevelopmentprevious)
    for supports. Thanks.
    Best regards,
    Youjun Tang
    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.

  • Controlling Delete Order with One-To-Many

    I have a class that has six 1-M mappings. All of them have a 1-1 back reference. I would like to control the order of deletion to ensure that one of the child collections is always deleted last.
    It was suggested to me to use an after-load method to call addConstraintDependencies on the parent descriptor to control the order. This method is being called (before login) but it did not change the order. I added the after-load to the parent descriptor, adding the constraint dependency of the class I want deleted last.
    I also tried using "multi-table info" (in addition to the regular one-to-many mappings) but that seems to cause the valueHolder to retrieve the items from the table twice, giving me a list with "doubles" of every item.
    What can I do to control the order of the deletes of the children?
    Thanks,
    Allen

    Hi Don,
    This is with reference to your comments on the following oracel forum query "http://forums.oracle.com/forums/thread.jspa?messageID=508819��" regarding 1:M mapping insertion problem.(Same one)
    Actually I also have the same kind of scenario but the data in not getting inserted to the detail table. It always gives ORA-1400 error as it is unable to populate the foreign key of parent in child table.
    Can you suggest if I am missing something.
    Your quick response will be appreciated.
    Message was edited by:
    user466708

  • Help with One to Many Formula

    Post Author: Don
    CA Forum: Formula
    Hello Everyone,
    I need some assistance.  I have a one to many relationship...
    Example...
    TABLE 1
    FieldName = RecordID
    DATA, RecordID= 10
    TABLE 2, linked one to many to RecordID in TABLE1
    FieldNames = RecordID, Name, ContactType
    DATA, RecordID= 10, Name= Tom, ContactType= Sales
    DATA, RecordID= 10, Name= Dan, ContactType= Service
    DATA, RecordID=10, Name= Jon, ContactType= Sales
    What I am looking for is to create a formula that would return something that looks like this....
    Sales Contact Name
    Tom, Jon
    So... I want to grab all the "Contact Types" of "Sales" from TABLE 2 then pass in the "Name" field from TABLE 2 and if there is more then one "Name" of the sames "Contact Type" then comma seperate it.
    And...  I don't want to do this in a sub report.   I do know I can make a sub report and return both values but to my knowledge the values would be on top of one another and not beside each other comma separated.
    Ideas?

    Post Author: Don
    CA Forum: Formula
    That may work using a subreport...
    I think the root of this my problem is the fact I have a table relationship, left outer... one to many join.  So even if I drop your suggested formula in my report I still get repeating record details with blank names where all the other contact types would be.
    Ticket Number       Contact Name     Contact Type
    111111                  Dan, Jim               Sales
    111111                                                                 <---- where the other contact type appear
    111111                                                                 <---- where the other contact type appear
    I was trying to avoid having to create several subreports for each data field I need on the report.  However, I think I can use your formula in a subreport to allow the data to display in a comma separated row rather then a vertical list.
    I thought about suppressing but that won't work because I have other contact types I need to list.
    Thank you for responding.

  • Insert with one-to-many mapping

    Hi,
    I've got the following situation:
    - an object A with a vector of object B
    - I defined a one-to-many relation in the descriptor of A referencing a collection of B using indirection through valueHolderInterface, the "private owned" is also checked
    - I defined a one-to-one relation in the descriptor of B referencing the object A using indirection through valueHolderInterface
    - the bidirectional relationship is maintained.
    I try to insert a new object A with a new object B inside. The code is as follows:
    A = new A();
    B = new B();
    // ... set the A attribute values
    // ... set the B attribute values
    A.addB(B);
    UnitOfWork uow = session.acquireUnitOfWork();
    uow.registerNewObject(A);
    uow.commit();
    where addB(b) is as follows:
    ((java.util.Vector)bvector.getValue()).add(b);
    b.setA(this);
    Executing this code, the object A is inserted in the database but the object B is not. And I would like that the object B is also stored in the database. Do I really have to register it? I want to make the insert in just one transaction. Have anyone an idea? I tried a lot of different configurations and just one SQL insert order is generated by Toplink.
    Thanks,
    Frédéric

    Hi Don,
    This is with reference to your comments on the following oracel forum query "http://forums.oracle.com/forums/thread.jspa?messageID=508819&#55728;&#57235;" regarding 1:M mapping insertion problem.(Same one)
    Actually I also have the same kind of scenario but the data in not getting inserted to the detail table. It always gives ORA-1400 error as it is unable to populate the foreign key of parent in child table.
    Can you suggest if I am missing something.
    Your quick response will be appreciated.
    Message was edited by:
    user466708

  • Why does facetime hang up when i connect with one certain person

    help me!!!!!!!

    That would not be an OS X or iMac issue if the problem is only with one other person. That points the finger at an Internet connection issue that must be solved by an ISP, my guess is the other person has a slow or problem Internet connection that needs troubleshooting.

  • Confused with one to many relationship

    Hi Masters ,
    Reading about one to many : i came across this
    Each row in Table A can have many (zero or more)
    matching rows in Table B but each row in Table B
    has only one matching row in Table A.
    A ZipCode can have many Students but each Student has only
    one ZipCode
    Theoritically this would be fine but can anyone please make tables for the above so i want to see it pratical work.

    zip
    (zipcode varchar2(6)
    , low_street_number varchar2(10)
    , high_street_number varchar2(10)
    , odd_even char(1)
    , city varchar2(30)
    , constraint zip_pk primary key (zipcode)
    student
    (studentno number(10)
    , firstname varchar2(30)
    , lastname varchar2(30)
    , zipcode varchar2(6)
    , constraint zip_fk foreign key(zipcode) references zip_pk
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Outlook calendar won't sync in Windows 7, 64 bit

    after I spent about 45 min. on the phone with an Apple service representative getting I cloud to install properly on my windows 7,64 bit system, I am back to the original problem for which I uninstalled I cloud and attempted to reinstall it, namely t

  • Can't view photos on icloud

    How can I view iphone pictures on icloud? I have photostream turned on.

  • How to customize Standard Purchase Order?

    Hi, We have many company so i must put logo for every company . also i want to add some fields to the po output . i open the document from : 1) Purchase order responsibility then open Purchase order sumamry/ 2) select one purchase order and do find.

  • Firefox 30 doesn't load a lot of pages that other browsers do. WHY??

    For the last 5 days, Firefox doesn't load pages that other browser on my Mac do. I'm talking about all kind of pages (big .com pages like apple.com/trailers or boingboing or Runkeeper or even Mozilla support pages). I restart it and it does load them

  • How to link to another Form? *Urgent*

    I'm using netbean to develop an application, I've a MIDLet with Login Page, I've used setCurrent(list) to display a list when I click "enter". It works fine, but when I want it to display another Form when I click "new" under the list using the same