Home » Developer & Programmer » Forms » order by non-database item
order by non-database item [message #135939] Mon, 05 September 2005 00:44 Go to next message
rzkhan
Messages: 370
Registered: March 2005
Senior Member
Hi all. I am trying to use order by property of the non database item in a database block. as below
set_block_property(----,order_by,:block.non_data_base_colmumn)

It clears the block instead of order by. Plz guide me..
Thanks
Riaz

Re: order by non-database item [message #136059 is a reply to message #135939] Mon, 05 September 2005 20:03 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Either retrieve all the records from the database and then sort them manually, or base your block on a view, or a procedure.

The 'order by' is done as part of the database SQL so you need to have the data available at the database level.

David
Re: order by non-database item [message #392397 is a reply to message #136059] Tue, 17 March 2009 15:47 Go to previous messageGo to next message
nasty
Messages: 1
Registered: November 2006
Junior Member
iam facing the same problem.


[Updated on: Tue, 17 March 2009 15:49]

Report message to a moderator

Re: order by non-database item [message #392400 is a reply to message #392397] Tue, 17 March 2009 15:53 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
iam facing the same problem.

i have a datablock called 'CA'. its based on 'curr_assign' table.
that datablock has an item called 'dsp_name'.its non database item. this item gets value from a view called 'perpal_v'.

prompt for 'dsp_name' is NAME

now i need to create a a sort button near 'NAME'. when i click that button ,it should sort the NAME field.

my problem is , i cannot use set_block_property('..order_by,..)
as that NAME field doesnt belong to 'curr_assign' table.

i cannot write in order by clause of CA. which is useless.

i attached the block pic . i need to have sort button near NAME field.


can you please help me or give me some code which helps .

i tried a lot.

thanks
tibbu
  • Attachment: srt.jpg
    (Size: 26.53KB, Downloaded 891 times)
Re: order by non-database item [message #392403 is a reply to message #392400] Tue, 17 March 2009 16:14 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you do what David had suggested in the second message posted in this topic?
Re: order by non-database item [message #392630 is a reply to message #392403] Wed, 18 March 2009 12:36 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
You want me to create a view on both 'curr_assgn' table and 'persons' table from where iam getting values for NAME field??

i have retrieved all the records.
after retrieving all the records, i want to sort the NAME field by clicking on a sort button. thats what iam unable to do.

thanks littlefoot for your quick response. i hope you could solve my problem.
Re: order by non-database item [message #392632 is a reply to message #135939] Wed, 18 March 2009 12:57 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
That's easy if the item you want to order by is a database item.
Just change the order_by property of the block and re-query.
You still need to employ one of David's suggestions to make your item a db item though.
Re: order by non-database item [message #392935 is a reply to message #392632] Thu, 19 March 2009 13:08 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
'Name ' field is not a database item. its getting value from a view called perpal_v. and NAME field is on a datablock whose table is 'Curren_assgn'.
perpal_v view is created on a group of tables called 'persons, and 'person_al'.

so you want me to create a view by joining 'currn_assgn','persons','person_al' ?????

and then give that view's name in 'query datasource name' property of that datablock??

is there any other solution??

please help me.
Re: order by non-database item [message #392938 is a reply to message #392935] Thu, 19 March 2009 13:21 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
nastyjillu wrote on Thu, 19 March 2009 18:08

so you want me to create a view by joining 'currn_assgn','persons','person_al' ?????


Maybe?
You need to write a view that gets all the data you need. You know what that data is and where it comes from, I don't.

Quote:

and then give that view's name in 'query datasource name' property of that datablock??



Yes

Quote:

is there any other solution??



Base the datablock on a stored procedure
Re: order by non-database item [message #392950 is a reply to message #392938] Thu, 19 March 2009 15:21 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
i created a view and gave 'query data soure name' property as view name. but when i compiled, it gives below error:

FRM-30100: Block must have at least one primary key item.
Block: CA
Form: PMDWAP
FRM-30085: Unable to adjust form for output.

Re: order by non-database item [message #393031 is a reply to message #392950] Fri, 20 March 2009 01:16 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is quite self-explanatory - choose an item (such as ID) which should act as a "primary key item" and set this property to "Yes".
Re: order by non-database item [message #393193 is a reply to message #393031] Fri, 20 March 2009 12:31 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
i gave primary key. iam not getting any errors while compiling. but when i deployed, i got error in the application when i tried to open CA block. error is given below

FRM-40505:ORACLE error :unable to perform query

when i tried to query CA block it gives below error:

table or view doesnt exist.

i replaced the old table name with view name in all places. even though iam getting that error. might be in PLL i have table name that i dont have permission to change.
Re: order by non-database item [message #393236 is a reply to message #393193] Fri, 20 March 2009 15:44 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Run the form again. When the error appears, go to Help menu and select "Display error" - see what's in there (and, eventually, post it back here).
Previous Topic: Single Button Required to Display multiple Canvases
Next Topic: problem
Goto Forum:
  


Current Time: Mon Feb 03 21:02:28 CST 2025