General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 9th, 2004, 12:38 PM
Iqbal Mamdani Iqbal Mamdani is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 Iqbal Mamdani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Oracle Form

I have two tables with following fields

1. Trans_master
trans_id varchar2 -- Primary key
tdate date
account_no varchar2 -- Foreign key

Data for your understanding
Trans_id tdate account_no
0001 01-Oct-04 1234-01
0002 02-Oct-04 6789-02
0003 03-Oct-04 6789-02
0004 04-Oct-04 1234-01

2. Trans_Detail
trans_id varchar2 -- Foreign key
Debit number
credit number
tag char(1)
tag_dt date

Trans_id debit credit tag tag_Dt
0001 500 Y 02-Oct-04
0001 1000 N 03-Oct-04
0002 600 N 03-Oct-04
0002 400 Y 04-Oct-04
0003 700 Y 06-Oct-04
0003 900 N 06-Oct-04
0004 800 Y 07-Oct-04
0004 100 N 07-Oct-04

I want to make a query/view form based on Trans_detail table in which the user cannot insert, update or delete data except 'tag' field which can be updated. for that purpose I created a dummy block 'Control' and data block 'Trans_detail' based on table. In dummy block I created an item 'Acc_no'.

Now I want to retrieve the data like this:
Control Block
Acc_no 1234-01

Trans_Detail Block
Trans_id debit credit tag tag_Dt
0001 1000 N 03-Oct-04
0004 100 N 07-Oct-04

In SQL prompt I wrote the following query and it worked correct as I wanted.

select b.*
from trans_master a, trans_detail b
where a.trans_id = b.trans_id
and a.account_no = '1234-01'
and a.tag = 'N'

Please tell me how can I use above query in forms?


Thanks


Iqbal Mamdani

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Oracle Form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT