Home » Developer & Programmer » Forms » Block based on Stored Procedure
Block based on Stored Procedure [message #87279] Thu, 16 December 2004 00:15 Go to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
I have a created a form (based on the oracle example 66887.1) - it works as expected .... (I think!)

However - Whenever I try to restrict the query (to return certain record(s)) 'all' records are returned.... (as hardcoded in the procedure)

Is this normal functionality for a block based on a procedure?

If so - why would anybody use them!!!?

Thanks in advance.
Re: Block based on Stored Procedure [message #87304 is a reply to message #87279] Thu, 16 December 2004 22:42 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
Modify your Database Proc to accept the where clause of your form also & your desire functionality will work.

HTH
Regards
Himanshu
Re: Block based on Stored Procedure [message #87306 is a reply to message #87304] Fri, 17 December 2004 00:21 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
OK - have YOU actually got this working - or just thinking about the issue logically?

In basing a datablock on a procedure you must (it is claimed) use the 'Query Data Source Arguments' property pallet. This property pallet allows you to define the IN/OUT put parameters as defined in the procedure.

As you (and a friend previously) suggested I changed the procedure adding another IN parameter, and also referenced this in the 'Query Data Source Arguments'. (So far so good eh!?) --not mentioned in the Oracles example (which experiance shows are not to be trused when they do claim to work!).

Now...... The Value property (within Query Data source Arguments) seems to only accept HARD-CODED values and is not dynamic or progamaic.

Am I barking up the wrong tree - or just plain blind?

If you have a working example great - but I am beginning to miss the point of using a procedure - the advantages don't come close to the additional hastle and necessary coding......
Re: Block based on Stored Procedure [message #87308 is a reply to message #87306] Fri, 17 December 2004 01:04 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
further investigation:

I can get the default_where passed (bit of a fudge but works... - I'm not happy about it but it does)

However - the default where is not set via the query execution, and neither is the :system.last_query (not executed one yet!)

So: I can only think that I need to construct the actual 'where clause' my self, from the users input before I execute query..! (WHAT! @%"!?!)

There must be a better way - surely to use procedure based blocks you don't have to check every data item prior to query to make them act as a 'base table' block? ..... do you?

I am really no seeing this as a 'way forward'.

Does this fit your model of Procedure Blocks - it sure wasn't mine until yesterday!
Re: Block based on Stored Procedure [message #87310 is a reply to message #87306] Fri, 17 December 2004 01:22 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Dear John,
I think you are too rude to be participating in any sort of Forum.
I have not seen even a single civilized person in my life using such abusive language.

In IT industry nothing is impossible,only you must have patience & desire to succeed.

I provide my views on this forum assuming that people who are posting there queries over here have fair amount of programming knowledge & are not novices as this forum has separate area defined for newbees.

Morover John,nothing in this world comes free of cost except advices on the forums maintained by oraganizations like "ORAFAQ" site.

But I dot think anybody over here is participating to do your job on your behalf or tolerate such remarks.

Let me tell you that whatever I have suggested is very much possible & I have done it numerous times when I started my carrer as a developer.

Today I do not code & manage numerous people like you but still participate in various forums as Technology is my hobby & passion.

Anyways I request you to be polite in future as this will help you in your personal as well as Professional life.

Regards
Himanshu
Re: Block based on Stored Procedure [message #87312 is a reply to message #87310] Fri, 17 December 2004 02:52 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
MMmm - I would be interested in what you class as abusive language?

your offence has been noted and I appoligise Himanshu, but having reread my previous posts there is nothing that I would call offensive. please hight the term(s) so I will be more awaire in future posts.

The only controversal point was my reference to 'YOU', which is more of a problem with how electornic communication is read than the intention of the question - the question was only to claify your experiance of procedure based blocks.

John
Re: Block based on Stored Procedure [message #87313 is a reply to message #87308] Fri, 17 December 2004 02:57 Go to previous message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Final:

Oracle recomment a similar approach, passing the where clause down to the procedure - however this does mean the form will have to check you use input prior to execute query for every queriable item - not a satisfactury solution.

Another friend has suggested basing the procedure on a VIEW then basing the form on that view - this may work(?) but I am going to forget about procedure blocks (for now) and just write a basic view (not muuch code, no hastle and acknowledgment that I have just wated 2 days development (no offence to anybody intended - just a statement of fact.)
Previous Topic: Problem : Parameter passing
Next Topic: Reg Calling Form associated with a Menu from another form
Goto Forum:
  


Current Time: Thu Sep 19 05:50:16 CDT 2024