Home » Developer & Programmer » Forms » set block property (group by) (forms 10g , win xp sp3)
set block property (group by) [message #600210] Sun, 03 November 2013 05:19 Go to next message
m_shehpar
Messages: 73
Registered: October 2010
Location: Pakistan
Member
Hi all,

i have scenario wherein i want to set block property before execute_query is fired. i want to do something like below, but setting group by and having clause is not working out. kindly help in this regard

	cri1 := ' CANCEL_DATE IS NULL ';
	cri2 := ' HAVING VERSION = (select max(version) from nfa_headers_all where nfa_number = NFA_HEADERS_ALL.NFA_NUMBER)
		  GROUP BY NLA_ID, NHA_ID, LINE_NUM, DESCRIPTION, BH_CC_ID, QUANTITY, TAX_FOREIGN_VENDOR, UNIT_AMOUNT, FUNC_AMOUNT, LAST_UPDATED_BY,
		 	   LAST_UPDATE_DATE, CREATED_BY, CREATION_DATE, ATTRIBUTE1, ATTRIBUTE2, ATTRIBUTE3, ATTRIBUTE4, ATTRIBUTE5, ATTRIBUTE6, ATTRIBUTE7,
		 	   ATTRIBUTE8, ATTRIBUTE9, CONSUMED_AMOUNT_PKR ';
	GO_BLOCK('NFA_HEADERS_ALL');
	SET_BLOCK_PROPERTY('NFA_HEADERS_ALL', default_where, cri1 || cri2);
	EXECUTE_QUERY;
Re: set block property (group by) [message #600215 is a reply to message #600210] Sun, 03 November 2013 07:02 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What does "not working" mean? After the above code runs, issue GET_BLOCK_PROPERTY in order to find out what was the last query executed. Perhaps you'll see the culprit then.
Re: set block property (group by) [message #600216 is a reply to message #600215] Sun, 03 November 2013 07:17 Go to previous messageGo to next message
m_shehpar
Messages: 73
Registered: October 2010
Location: Pakistan
Member
actually it cant set having and group by clause for this block. can you please see the code and suggest something !!!
Re: set block property (group by) [message #600217 is a reply to message #600216] Sun, 03 November 2013 07:23 Go to previous message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Here's something: modify data block's source. Now, it is - what? A table? Change it to a stored procedure. This is rather "complex" (if compared to an ordinary table/view source), but it can be done. Search my previous posts for these keywords; if I remember well, I provided an example of how to do that.

Because, with a stored procedure, you have some sort of "flexibility" available and maybe you could accomplish what you are after.
Previous Topic: Multiple choice or all
Next Topic: forms 6i duplicate record
Goto Forum:
  


Current Time: Sun May 19 09:44:30 CDT 2024