Home » Developer & Programmer » Forms » problem with runtime where clause
problem with runtime where clause [message #268454] Tue, 18 September 2007 13:16 Go to next message
rajat_chaudhary
Messages: 141
Registered: November 2006
Location: india
Senior Member

i am using a view(all_data) in forms6i.
now i writing a code that is

declare
runtime_where_clause varchar2(500);
begin
runtime_where_clause := 'where '||:a1||:a2||:a3||:a4;
insert into temp_dc_spcn(dcan)
(select dcan from all_data runtime_where_clause);
end;

by that code it should add the where clause at runtime, so by that code it should filter the data and insert the records as per where clause but it is inserting all the records of all_data into temp_dc_spcn;

please help me .........

regards
rajat

note := i am using non database block and can't use database block.

[Updated on: Tue, 18 September 2007 13:30]

Report message to a moderator

Re: problem with runtime where clause [message #268469 is a reply to message #268454] Tue, 18 September 2007 15:59 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is the result of the following code (i.e. insert the MESSAGE statement in there):
begin
  runtime_where_clause := 'where '||:a1||:a2||:a3||:a4;

  message(runtime_where_clause);
end;
Can you see a reason for inserting all records instead of only a part of them? What if you use this WHERE clause in an SELECT statement and run through SQL*Plus? What happens?
Re: problem with runtime where clause [message #268521 is a reply to message #268454] Wed, 19 September 2007 00:09 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why are you manually inserting records?

Populate block using cursor
http://www.orafaq.com/forum/m/605/67467/?srch=populate+block+cursor+create_record#msg_605
and my feelings about it.
http://www.orafaq.com/forum/m/134237/67467/?srch=populate+block+cursor+create_record#msg_134237
Another one of my rants.
http://www.orafaq.com/forum/mv/msg/74947/213213/67467/#msg_213213

David
Previous Topic: Screen Resolution
Next Topic: adding values in a table from list item
Goto Forum:
  


Current Time: Sun Feb 09 01:27:36 CST 2025