Home » Developer & Programmer » Forms » FRM 40507 Unable to fetch next query record
FRM 40507 Unable to fetch next query record [message #189007] Tue, 22 August 2006 14:41 Go to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
Hello everyone,

What does that mean? And how do I get rid of that error message?
Re: FRM 40507 Unable to fetch next query record [message #189105 is a reply to message #189007] Wed, 23 August 2006 04:21 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Hi dear

FRM-40507: ORACLE error: unable to fetch next query record.

Cause: One of the following:

1. A fatal error occurred while trying to fetch the next query record.

2. If you are connected to an non-Oracle datasource through ODBC, the cursor loses its position in the result set after a commit.

Action: Requery if you are connected with a non-Oracle datasource. If not, contact your DBA.

best regard


Re: FRM 40507 Unable to fetch next query record [message #193754 is a reply to message #189007] Tue, 19 September 2006 05:27 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Press Shift+F1 for (forms6i) or ctrl+Shift+E ( for Forms10G) at run time to see what exactly error is occuring in fetching the record .

Sandy
Re: FRM 40507 Unable to fetch next query record [message #193795 is a reply to message #193754] Tue, 19 September 2006 07:39 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
I did the Shift F1 as you suggested and got ORA 01722: invalid number error from the following code:

SELECT ROWID,TAX_PAYER_NO,TAX_TRANS_NO,DOC_NO,TRANS_DATE,
ENTER_DATE,AMOUNT,CHEQUE_NO,RECEIPT_NO,
PAYMENT_TYPE_NO,BANK_NO,PAYMENT_LOC_NO 
FROM TAX_TRANSACTION WHERE tax_payer_no = :1 
and payment_loc_no is not NULL  order by trans_date, enter_date, doc_no

[Updated on: Tue, 19 September 2006 07:43]

Report message to a moderator

Re: FRM 40507 Unable to fetch next query record [message #193921 is a reply to message #193795] Tue, 19 September 2006 23:28 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

In selected feilds ROWID,TAX_PAYER_NO,TAX_TRANS_NO,DOC_NO,TRANS_DATE,ENTER_DATE,AMOUNT,CHEQUE_NO,RECEIPT_NO,PAYMENT_TYPE_NO,BANK_NO,PAYMENT_LOC_NO one of the column is not of number type while the item defined for this column is number in forms. Check in database block for this item.

Sandy
Re: FRM 40507 Unable to fetch next query record [message #194374 is a reply to message #193921] Thu, 21 September 2006 15:05 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
One of the fields were not a number data type as you suggested, WHen I describe the table, one the the fields were number, but in ORacle forms it was defined as char. I fixed it, but I am still getting the same error message.
Re: FRM 40507 Unable to fetch next query record [message #194395 is a reply to message #194374] Thu, 21 September 2006 23:55 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Do u have any post-query or post change or pre-select trigger in form? If yes, can you send the code..

Are you getting the same error when pressing shift+F1.

Sandy
Re: FRM 40507 Unable to fetch next query record [message #196284 is a reply to message #194395] Wed, 04 October 2006 15:02 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
A post-query trigger code as follows:

SELECT PAY_LOC.PAYMENT_LOC_DESC
INTO :TAX_TRANSACTION.PAYMENT_LOC_DESC
FROM TAX_TRANSACTION TAX_TRANS, PAYMENT_LOC PAY_LOC
WHERE TAX_TRANS.PAYMENT_LOC_NO = PAY_LOC.PAYMENT_LOC_NO
AND TAX_TRANS.TAX_TRANS_NO = :TAX_TRANS_NO;

SELECT PAY_TYPE.PAYMENT_TYPE_DESC
INTO :TAX_TRANSACTION.PAYMENT_TYPE_DESC
FROM TAX_TRANSACTION TAX_TRANS, PAYMENT_TYPE PAY_TYPE
WHERE TAX_TRANS.PAYMENT_TYPE_NO = PAY_TYPE.PAYMENT_TYPE_NO
AND TAX_TRANS.TAX_TRANS_NO = :TAX_TRANS_NO;

SELECT TRANS_TYPE.TAX_TRANS_TYPE_DESC
INTO :TAX_TRANSACTION.TAX_TRANS_TYPE_DESC
FROM TAX_TRANSACTION TAX_TRANS, TAX_SUB_TRANS TAX_SUB, TAX_TRANS_TYPE TRANS_TYPE
WHERE TAX_TRANS.TAX_TRANS_NO = TAX_SUB.TAX_TRANS_NO 
AND TAX_SUB.TAX_TRANS_TYPE_NO = TRANS_TYPE.TAX_TRANS_TYPE_NO
AND TAX_SUB.TAX_TRANS_NO = :TAX_TRANS_NO;

IF :TAX_TRANSACTION.PAYMENT_TYPE_NO = 2 THEN
  SELECT BANK_NAME
  INTO :TAX_TRANSACTION.BANK_NAME
  FROM TAX_TRANSACTION TAX_TRANS, BANK BANK
  WHERE TAX_TRANS.BANK_NO = BANK.BANK_NO
  AND TAX_TRANS.TAX_TRANS_NO = :TAX_TRANS_NO;
END IF;

EXCEPTION
	when no_data_found then
 	null;
 	when others then 
 	null;
Re: FRM 40507 Unable to fetch next query record [message #196547 is a reply to message #196284] Thu, 05 October 2006 21:02 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I assume that this Post-Query trigger is on the block 'TAX_TRANSACTION' - true?

Do not refer to 'TAX_TRANS_NO' as ':TAX_TRANS_NO', please put a 'block' name in front of it.

David
Previous Topic: calling a procedure from a particular library
Next Topic: how textbox disable and accept only from lov
Goto Forum:
  


Current Time: Mon Apr 29 03:54:00 CDT 2024