Problem in block based Query
Respected Guru's
I have a problem eith block bassed query.i have already used this block based query and it is working too.
But here i am facing the the problem.why becuz i have used a global variable to pass value for execute it.
and used 'set_block_property' to execute this query ..
go_block('block name ')
execute_query;
But it si showing unable to perform the query..
How i do this?? plez help me out...
Dear...........
There are some possible reasons.
1- The items that are in data block , there is some field data is not database field and you set the property of this item is
"Data Base Item" = 'Yes' , means this field is not in table.
2- user right problem
3- see the block property where set the property QUERY = NO\
THX.
Similar Messages
-
Problems with creation of a block based on a procedure
Hi,
I have created a block based on a database procedure. This procedure has a PL/SQL table as IN OUT parameter.
I am able to create a multi-line text item and display the contents of the pl/sql table in it.
I want to edit the data in the text item and save it back into that pl/sql table.
I understand that i have to have a separate insert-procedure for doing that. Right?
Should this procedure be a database procedure?
My pl/sql table is contained in a package specification in the database.
From forms how can i access it?
When i tried it says 'cannot directly access remote package variable or cursor'.
Please can you help solve my problem?
Thanks,
Saju.check out : http://www.summitsoftwaredesign.com/scripts/forms_blocks.html
-
Block based on view ,enter query
Hi,
I have a block based on a view.One column of the view is
substr(f_gt_marks(tcs23.idu_nr_dossr),1,128).
When I enter 'PAPER%' for the above column and press execute query i get:
PAPER
PAPER1PAPER2
When the form is in enter query mode and when I enter 'PAPER' and press execute query I get FRM 40301 query caused no rows to be retrieved.
I want only paper to be retrieved.The form works only if I append % to the search criteria.
Can you please advise me.
I am working on forms 9i.
Thanks and RegardsTry to debug for form, and get the SQL Statement that is being executed, see if it's doing anything out of the ordinary and try to run in SQL*Plus and see the result.
I think your SQL is trying use the SUBSTR function on the value you enter in ENTER-QUERY mode.
SUBSTR(f_gt_marks('PAPER'),1,128)Anyway, best for you to see what the form's SQL statement is when issuing the query.
Tony -
Update detail block based on FROM QUERY
I have 2 blocks in master-detail relation. The master is based on a table, the detail on from query. The Insert works fine... but whenever i want to update any field from the detail block, the items (text, lists, whatever) don't allow any updating.
Is there some workaround?
Thank you for the help
NRRTM on blocks based on from-query.
If I recall well, it says that you shoud write the DML code in on-insert, on-update and on-delete triggers - and, anyway, if I do not remember well the manual, that's what I do.
So, the on-insert trigger should have an insert into <my_dml_table>...
The on-update trigger sould have an update <my_dml_table>... where ... And there's a thing: you may have the rowid of <my_dml_query> fetched - which would be the best - or use some primary key for that table for update (not so good performance).
The on-delete trigger somewhat like the on-update trigger.
Moreover, I believe it would be better to have procedures for on-insert, on-update and on-delete grouped in one package in the database - again, this is what I use to do. -
Block based on from clause query
Hi all...
I am using forms 10g .....
When I wanted block based on from clause query...
I used this query ( SELECT * FROM exit INNER JOIN enter ON exit.ent_num = enter.ent_num where enter.depart=1)...
When I run form .....
frm-40505 oracle error unable to perform query
Thank you
Edited by: osa3_12 on Dec 10, 2009 4:33 AMhi
try something like this.
1* select empno,ename from emp where empno=empno order by 1
SQL> /
EMPNO ENAME
7000 Sarah
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
7782 CLARK
7788 SCOTT
7839 KING
7844 TURNER
EMPNO ENAME
7876 ADAMS
7900 JAMES
7902 FORD
7934 MILLER
8898 Sheela
16 rows selected.
1* select empno,ename from emp where empno=7000
SQL> /
EMPNO ENAME
7000 Sarah
SQL> sarah -
How to execute the query for a block based on the parameter
Hi All,
Good evening.
i have requirement where i need to display the data in one block based on the selected items.
the scenario is like this...there are 2 LOV's and one apply button and one external region on the form.
so when u select the lov values and click on apply button the query should execute based on this 2 lov values.
i am not getting how to achieve this..i am very new to oracle forms..
Please Help..
Thanks
Bharat
please help..it is urgent..
thanks
bharat
Edited by: Bharat on Jan 31, 2012 5:19 AMBharat wrote:
Hi All,
Good evening.
i have requirement where i need to display the data in one block based on the selected items.
the scenario is like this...there are 2 LOV's and one apply button and one external region on the form.
so when u select the lov values and click on apply button the query should execute based on this 2 lov values.
i am not getting how to achieve this..i am very new to oracle forms..Another way you can do this. Create a lov and don't assign it to any column just one return item (should be id).
Now create a button may be your "apply button" write two trigger when-button-press and when-mouse-click.
at When -Button-Press trigger, change the block state to 'ENTER-QUERY' and at when-mouse-click show the LOV and then write execute_query.
Hope this will help you.
If someone's response is helpful or correct, please mark it accordingly. -
Query a database block based on a non-database block
hi everybody
can anybody help me as how to query a database block based on a non-database block, without a master-detail relationship?
i have a block : date_input which contains a non-database item: start_date
another database block (event_block)containing details of an event
i have to input a date in the start_date and query the event_block
in wich trigger should i insert the code?
thanksIf you are trying to query your database block (event_block) using the value from start_date in your non-database block, then you can set the Where clause in the database block using:
SET_BLOCK_PROPERTY ('event_block', DEFAULT_WHERE, 'your where clause that includes start_date');
Place this statement in a trigger that is executed prior to the block being queried. -
[Block based on From Query] On-Lock Trigger
Hi,
I have a block based on an Emp_Dept view.
I manage updating and inserting with the On-Update and On-Insert triggers.
I wonder if I have to code this in the On-Lock trigger:
message( 'Oracle locks' );
lock table emp in share row exclusive mode;
If I want Oracle to prevent another user from updating the same row I'm updating.
Thanks for your help.
JBMThis is the code we use to lock specific records in ON-LOCK:
CURSOR crLock IS
RESOURCE_BUSY EXCEPTION;
PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -54);
SELECT ID
FROM THE_BASE_TABLE_OF_THE_VIEW
WHERE ID=:BLOCK.ID FOR UPDATE OF ID NOWAIT;
nDummy NUMBER;
BEGIN
OPEN crLock;
FETCH crLock INTO nDummy;
CLOSE crLock;
EXCEPTION
WHEN RESOURCE_BUSY THEN
message('record cannot be locked');
RAISE FORM_TRIGGER_FIALURE;
END; -
Troubleshooting blocks based on stored procedures
Hello,
I'm creating a form block that is based on a stored procedure. I've followed the steps in note 66887.1 "Basing a Block on a Stored Procedure - Sample Code", but am still having problems. Currently, the stored procedure runs successfully when I call it from SQL*Developer, but I receive a "FRM-40301: Query caused no records to be retrieved. Re-enter" when I run it from the form.
I'm not sure how to troubleshoot this problem. I tried using the Forms Debugger, but that didn't seem to provide any visibility to what Forms was doing. Can anyone suggest a way to troubleshoot problems like this?
Thanks,
CindyHi Tony
Did youuse a REF CURSOR or table of records??I'm using a REF CURSOR.
Here's the signature of the procedure I'm specifying as the "Query Data Source Name":
PROCEDURE do_query(p_combined IN varchar2,
p_legal IN varchar2,
p_maiden IN varchar2,
p_preferred IN varchar2,
p_indrfn IN varchar2,
p_birthdate IN varchar2,
p_sex IN number,
p_unit IN number,
p_writingsys1 IN varchar2,
p_writingsys2 IN varchar2,
results IN OUT name_query_cur)
Here's the definition of the name_query_cur ref cursor type:
TYPE return_rec IS RECORD(
indrfn cms_name.naindrfn%TYPE,
legal varchar2(485),
maiden varchar2(485),
preferred varchar2(485),
birthdate varchar2(8),
unit cms_unit.ununit%TYPE,
sex cms_individual.insex%TYPE,
baptized cms_individual.inbaptized%TYPE,
priesthood cms_individual.inpriesthood%TYPE,
unitcountry cms_individual.inunitcountry%TYPE,
secured cms_individual.insecured%TYPE,
phsecured cms_individual.inphsecured%TYPE,
privilege cms_individual.inprivilege%TYPE,
confidential cms_individual.inconfidential%TYPE,
recordstatus cms_individual.inrecordstatus%TYPE
TYPE name_query_cur IS REF CURSOR RETURN return_rec;
Do you have all the columns listed in the Query Data Source Columns? In "Query Data Source Columns", I have listed all the columns of the ref cursor. So, I have the following columns specified there:
indrfn
legal
maiden
preferred
birthdate
unit
sex
baptized
priesthood
unitcountry
secured
phsecured
privilege
confidential
recordstatus
And did you set the Query Data Source Arguments??Yes, I set this to match the arguments to the do_query routine. I gave each argument the exact same name as it had in the do_query routine. So, this is currently set as:
p_combined IN varchar2 value=:control.combined
p_legal IN varchar2 value= :member_lov.legal
p_maiden IN varchar2 value= :member_lov.maiden
p_preferred IN varchar2 value= :member_lov.preferred
p_indrfn IN varchar2 value= :member_lov.indrfn
p_birthdate IN varchar2 value= :member_lov.birthdate
p_sex IN number value= :member_lov.sex
p_unit IN number value= :member_lov.unit
p_writingsys1 IN varchar2 value= 'Latn'
p_writingsys2 IN varchar2 value= left this blank
results IN OUT name_query_cur value=left this blank
The blocks based on the ref cursor should have all the items which arethere in the ref cursor type. If the number of items does not match the
individual items in the ref cursor type when you execute query you'll get FRM-40350 Query caused no records to be retrieved.
The items in the block exactly match the ref cursor. They are the exact same names, types, and in the exact same order as the ref cursor columns.
Make sure you have listed all the columns, and make sure your REF Cursor returns rows in SQL*Plus.The ref cursor returns rows in SQL*Plus, just not in Forms.
Can you see anything I've missed or done wrong? -
Trying to develop a form having a block based
on stored procedure. My form works fine if
the stored procedure having REF CURSOR as one
of the argument but if I am using dynamic SQL
in my procedure I can not use Strong REF CURSOR, so I had to use Pl/Sql Table as one of the parameter in the proceudre.
In that case when I run my form and Execute the query it just comes out of the form without displaying anything and also it doesn't throw any error.
Don't know what I am doing wrong.
Pl. Help...
nullI drilled down the proble further and identified that i can
recreatr the problem in any 7.3.4 database ....
But in 8.0.5 it's working fine .....
Is developer 6.0 is going to support Oracle 7.3.4
it'll be highly appreciated if any one from Oracle development
team can give me a response
Thanks in advance...
Lebon Mathew (guest) wrote:
: Problem : If a block value is refered in
: a LOv - record group query
: the form cannot adjust the out put .. and
: is not generating.....
: Record group query which works :
: select security_role, sec_role_desc, database_role
: from security_role
: where wnd_appln = 'XXXXXXXXX'
: order by security_role, database_role
: Record group query which is not working :
: select security_role, sec_role_desc, database_role
: from security_role
: where wnd_appln = :APP_ROLES_BK.wnd_appln
: order by security_role, database_role
: Error Generated :
: FRM-30064: Unable to parse statement icrgg/icrggc: hicrg.
: Record Group SECURITY_ROLE_LOV
: Form: EMPLOYEE
: FRM-30085: Unable to adjust form for output.
: Table structure :
: CREATE TABLE security_role
: security_role VARCHAR2(15) NOT NULL,
: sec_role_desc VARCHAR2(20) NOT NULL,
: open_nsr VARCHAR2(1),
: open_pkt VARCHAR2(1),
: chg_wk_grp VARCHAR2(10),
: asgn_anlst VARCHAR2(10),
: updt_oth_wkgp_pkt VARCHAR2(1),
: admin_tasks VARCHAR2(1),
: create_po VARCHAR2(1),
: billing_changes VARCHAR2(1),
: invoice_changes VARCHAR2(1),
: change_owner VARCHAR2(1),
: wnd_appln VARCHAR2(15),
: database_role VARCHAR2(20)
: PCTFREE 10
: PCTUSED 40
: INITRANS 1
: MAXTRANS 255
: TABLESPACE wa0dat0t01
: STORAGE (
: INITIAL 32768
: NEXT 8192
: PCTINCREASE 0
: MINEXTENTS 1
: MAXEXTENTS 121
: w@w Lebon Mathew
: WellsFargo - Telecom Applications
: (415)-477 6445
null -
Master-Detail with 2 blocks based in stored procedure doesn't work.
Hi. I'm Oscar and I'm new for here.
I have a problem that i can't find the correct answer to solve it.
Well. I've created a form with 2 blocks. Both of them have the Query Data Source Type Property to "Procedure", and both procedures on database returns one ref cursor of a record type each one.
BLOCK BL_COMPETICIONES --> query data source: p_get_competiciones (p_Cursor is cursor of record (CODIGO NUMBER,
NOMBRE VARCHAR2(50),
SETCRICKETSN VARCHAR2(1),
SET01SN VARCHAR2(1),
FECHAINICIO DATE,
FECHAFIN DATE).
On triggers (on-lock, on-insert, on-delete and on-update) I have the call to the corresponding stored procedure to lock, insert, delete or update.
Well, when i've only this block in form, the form works correctly.
But when I added a second block (which is suppossed to be a detailed data from the first one), and after I've assigned the query procedure and created the relation between both blocks, then run the form and try to execute query on first block, returning records correctly, but then, when execution goes to the program unit "query_master_details", the sentence "execute query" doesn't do anything (and the cursor is in the detailed block), so detailed block continues to be without records.
I don't know how to solve this. Someone can help me, please?. Thanks.
Edited by: user5067020 on 09-abr-2009 16:38It could be that there is something screwy with LV, but given that it uses standard interfaces for comm with the DBMS, I would not expect that. A much more realistic possibility is that the toolkit is mucking things up. (A fairly common occurrence.)
Try bypassing the toolbox -- which you don't really need anyway -- an talk directly to the ActiveX or .net interface.
Also, what DBMS? What drivers are you using?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Need to create a block based on view
We can create a block based on procedure...but whats the need to do so...please can anybody explain.
create the block with the data block wizard. Use your View as Data-Source.
After that set all items to QUERY-ONLY, when they are not updateable. E.g. if you create a view from EMP to DEPT. Then it is not allowed to update DNAME. DNAME is set to QUERY-ONLY. -
Need to create a block based on procedure
We can create a block based on procedure...but whats the need to do so...please can anybody explain.
There are several recent posts on the topic with a lot of good help & documentation.
The Metalink note: 66887.1
Re: Form on a procedure
If you can't access Metalink, search here on that note. Someone posted the full text a couple days ago.
This is also very good reference:
Block based on procedure
Essentially, you have a procedure, returning a table-of-records type variable, called by the block "Query Data Source..." properties.
Name = procedure name
Arguments = procedure parameters (IN parameter(s) Value is :block.item)
Source Columns = the record type columns for your table-of-records
Datatypes & sizes must match all around.
Start very simple & get it to work first, then expand.
You must follow the documentation very carefully. If it doesn't work at first, go through everything to verify. Also, read the Tip & Issues at the end of the Metalink note.
Have fun. It works awsome once you get the hang of it. -
Display a message in status bar when error in a block based procedure
Hi
I have a block based on procedures.
If I have an exception when I try to insert a record for example, how can I display a user friendly message in the status bar ?
here is my insert procedure :
PROCEDURE emp_insert2(t IN emptab) IS
BEGIN
FOR i IN t.first..t.last LOOP
INSERT INTO emp (empno, ename, job, hiredate, sal)
VALUES(t(i).empno, t(i).ename, t(i).job, t(i).hiredate, t(i).sal);
END LOOP ;
EXCEPTION
When DUP_VAL_ON_INDEX then
Raise_Application_Error( -20002, '^This identifier already exists^' ) ;
END emp_insert2;When I use the ON-FORM trigger and ERROR_CODE and ERROR_TEXT variables, I get an FRM-XXXX message saying :
40735--INSERT-PROCEDURE trigger raised unhandled exception ORA-00001.
I want a message like :
ORA-20002 This identifier already existsHello,
ORA-20500: ^This identifier already exists^ ORA-06512: à "SCOTT2.EMP_PKG", ligne 48
I cannot figure out what is the problem described by the second part of the message.
why numeric or value error in this case ? ( ligne 48 corresponds to the raise_applicaion_error instruction )There is no problem with the second part it is just for showing the line number it not the numeric or value error the code for numeric or value error is ORA-06502. See the below link for more information
http://www.techonthenet.com/oracle/errors/ora06512.php
So, now you can display your customized message in status bar using the error code which you defined in RAISE_APPLICATION_ERROR like below...
DECLARE
errcode VARCHAR2(50) := DBMS_ERROR_CODE;
errtxt VARCHAR2(1000) := DBMS_ERROR_TEXT;
BEGIN
IF vErrCode='-20500' THEN
MESSAGE('Here display your customized message.');
ELSE
-- Handle the rest errors...
END IF;
END; -Ammad -
Query for records on a block with Query Data Source Type : Procedure
Hi All,
The veriosn of form I'm using is:
Forms [32 Bit] Version 6.0.8.23.2
I have a block based on a procedure.
But when I enetr-query and search for records specific to ceratin criteria even then the result of the Query is all records.
Is Query not allowed on a block with Query Data Source Type : Procedure.
Hope my question is clear.
Thanks in advance.
Regards
ArifWhen you use a table based block, forms can construct any select with any where clause based on the given inputs. Using a procedure based block, forms cannot "know" which in or out parameter of the procedure corresponds to which item. Even if Forms could pass the value of an item to an argument automagically, the procedure would have to "do something" with the argument, and you´d have to code it.
So, any item that should be used in the where-clause must be mapped to an argument.
Perhaps it would be easier to use a table based block querying a view? For DDL, you could use an instead-of-trigger on the view.
Regards,
Gerd
Maybe you are looking for
-
Can't print to a windows networked Gestetner printer
I can not print to a printer on a Windows server. I am connected to the server and can see other printers on Appletalk and Bonjour. I can see the Gestetner Dsc535 multifunction printer unders "Windows Printing" in the printer set up utility. I get as
-
Error handling when value is null
hi i have a stuation where i what to display meaningfull error message if the lov is not selected,am navigating to next page based on lov selection,i what to display good message if you try to navigate without making selection public String showSelec
-
Hello! I'm at the begin with LabView. I'd like to verify my signal with an oscilloscope. After this, when i active a light, the power of this signal must be save. I have found the oscilloscope VI. I'm tring to modify it in order to save, when it's ne
-
How to Test if an Email Address Exists?
So we have all been doing email address validation for awhile which I know how to do, but validation only tests if an email address is entered in the right format. It doesn't verify if an email address actually exists. I am creating an application
-
I have Final Cut Pro X version 10.0.7 and plans to update to version 10.0.8, but whenever i click update it says, "Final Cut is already installed on this computer. Choose Software Update from the Apple menu to check for available updates." I have no