Search found 37 matches

by lauchuen
Thu 20 Jun 2013 14:17
Forum: PostgreSQL Data Access Components
Topic: Change key value on Master detail
Replies: 5
Views: 5221

Re: Change key value on Master detail

oh, sorry, my bad, maybe my question make u confused.
how to implement a cascade update for detail.master_id ?
it doesn't mean that the dataset need to direct update the database value, i'm talking about the UI level - the grid view.

ok, maybe we start again, following the new table structure:

Code: Select all

master table (
id varchar(50) primary key,
name varchar(50)
);

detail table (
id varchar(50) primary key,
master_id varchar(50),
name varchar(50),
FOREIGN KEY (master_id) REFERENCES master (id) ON DELETE RESTRICT ON UPDATE CASCADE,
);
two PgQuery dataset, master-detail relationship, cachedupdate mode is True, and two dbgrid are connected with them separately. and then:
1. insert a record on master grid, like id = 'A'
2. insert two record on detail grid, like id = 'A1', master_id = 'A' & id = 'A2', master_id = 'A'
3. update master grid id from 'A' to 'B'
4. ** important ** 'A1' & 'A2' records in detail grid are disappeared

so, my problem is how to maintain detail grid keep displaying 'A1' & 'A2' records when master key changed?

thanks!
by lauchuen
Tue 18 Jun 2013 18:12
Forum: PostgreSQL Data Access Components
Topic: Change key value on Master detail
Replies: 5
Views: 5221

Re: Change key value on Master detail

i know the foreign key has support cascade update function. but the problem is now i'm using the cachedupdated mode.

refer to your solution, is that means pgdac doesn't support this features or it occur by bugs?
by lauchuen
Fri 14 Jun 2013 20:49
Forum: PostgreSQL Data Access Components
Topic: Change key value on Master detail
Replies: 5
Views: 5221

Change key value on Master detail

Code: Select all

master table (
id varchar(50) primary key,
name varchar(50)
);

detail table (
id varchar(50) primary key,
master_id varchar(50),
name varchar(50)
);
hi,

above tables are master-detail relationship, and cachedupdate is true, separate two grid link with them in the same form.
firstly i insert a record on master table id = 'A', then go to detail table insert 2 records, the master_id append 'A' by default due to the master-detail relationship, enter some value for 2 records like id = 'A1' & 'A2'
now the problem is when i update the master table id from 'A' to 'B', all details records disappear. how to implement a cascade update for detail.master_id ?

thx & regards

jacky
by lauchuen
Mon 22 Apr 2013 12:30
Forum: PostgreSQL Data Access Components
Topic: Nothing happen onLogin event
Replies: 3
Views: 2015

Nothing happen onLogin event

hi,

i've set LoginPrompt to True and add some logic in onLogin event, but nothing happen. how to use this event? since documentation haven't mention it.

thx
by lauchuen
Mon 06 Aug 2012 02:32
Forum: PostgreSQL Data Access Components
Topic: Handle violation on PostError event
Replies: 1
Views: 2892

Handle violation on PostError event

hi,
is that possible to trip when violation of duplicate key or foreign key constraint on PostError event ? or where should i handle this violation raise after DataSet.CommitUpdates;

thx.
by lauchuen
Sat 14 Jul 2012 19:37
Forum: PostgreSQL Data Access Components
Topic: Handle parameters with null value
Replies: 1
Views: 1623

Handle parameters with null value

hi,

the database schema

Code: Select all

create table items (
  id serial,
  name varchar(100),
  mfg_date date,
);
INSERT INTO items (name) VALUES ('ABC');

Code: Select all

pgQuery.Close;
pgQuery.SQL.Text := 'SELECT * FROM items WHERE name = :name AND mfg_date = :mfg_date';
pgQuery.ParamByName('name').Value := 'ABC';
pgQuery.ParamByName('mfg_date').Value := null;
pgQuery.ParamByName('mfg_date').Bound := True;
pgQuery.Open;
Result: No Record Found. (Wrong)

Even i turn on the transform_null_equals inside postgresql, the result also wrong. So, what is the right approach to handle parameters with null values?
by lauchuen
Wed 04 Jul 2012 09:23
Forum: PostgreSQL Data Access Components
Topic: how to disable store Connection.connected on runtime
Replies: 17
Views: 3505

Re: how to disable store Connection.connected on runtime

hi,
did you implemented this feature on this build ?
by lauchuen
Mon 02 Jul 2012 19:45
Forum: PostgreSQL Data Access Components
Topic: Master Detail with CachedUpdate
Replies: 28
Views: 6111

Re: Master Detail with CachedUpdate

thank you for the effort. since i think it is very important for database application development on the master-detail relationship. refer to the database side, there're also has a foreign key to control cascade or restrict update/delete. and i think there're also not every application use un-changeable ID for their application, hopeful your team can fix this problem soon.
by lauchuen
Sat 30 Jun 2012 14:52
Forum: PostgreSQL Data Access Components
Topic: Master Detail with CachedUpdate
Replies: 28
Views: 6111

Re: Master Detail with CachedUpdate

hi,

does the latest version have any update related to this features ?
by lauchuen
Thu 31 May 2012 11:55
Forum: PostgreSQL Data Access Components
Topic: Master Detail with CachedUpdate
Replies: 28
Views: 6111

Re: Master Detail with CachedUpdate

already use smInsert for MasterDataSet, but if i haven't Post the MasterDataSet before insert DetailDataSet record, after i Post the MasterDataSet, all DetailDataSet has gone (disappear).

and this only appear when the table was empty (no record), bugs?
by lauchuen
Wed 30 May 2012 15:28
Forum: PostgreSQL Data Access Components
Topic: Master Detail with CachedUpdate
Replies: 28
Views: 6111

Re: Master Detail with CachedUpdate

hello,

its me again...now, i've another table schema which similar to previous.

Code: Select all

master table (
 id varchar(50) primary key,
 name varchar(50) NOT NULL,
);

detail table (
 id serial primary key,
 master_id varchar(50) NOT NULL,
 name varchar(50) NOT NULL
);
just the serial id field changed to varchar(50) and name now is not null. i found that master table must be posted before detail table insert record, is that true ? how to avoid that ?

following my settings:
tblMaster.SQL.Text := 'SELECT * FROM master';
tblMaster.CachedUpdates := True;
tblMaster.Options.DefaultValues := True;
tblMaster.Options.LocalMasterDetail := True;

tblDetails.SQL.Text := 'SELECT * FROM detail';
tblDetails.CachedUpdates := True;
tblDetails.Options.DefaultValues := True;
tblMaster.Options.LocalMasterDetail := True;

since name field now is not null, the users may insert detail record before fill the name field (since i can't control the users behavior), so any solution about this ? very urgent, please help.
by lauchuen
Wed 23 May 2012 11:56
Forum: PostgreSQL Data Access Components
Topic: how to disable store Connection.connected on runtime
Replies: 17
Views: 3505

Re: how to disable store Connection.connected on runtime

any suggestion ? (except close the dataset everytime before deploy)

thx
by lauchuen
Wed 23 May 2012 09:06
Forum: PostgreSQL Data Access Components
Topic: Any Cascade features of Master-Detail ?
Replies: 3
Views: 1645

Re: Any Cascade features of Master-Detail ?

yes, ofcause that is very easy to implement. but think about to create these procedure really slow down the development time, if the component can provide these simple features really helpful. its ok. thanks a lot.