Home » Developer & Programmer » Forms » Bad bind variable error (oracle 9i, developer 2000)
Bad bind variable error [message #588862] Sat, 29 June 2013 01:28 Go to next message
smehta25
Messages: 5
Registered: June 2013
Location: Jammu
Junior Member

HI,

Whenever I am compiling the code, following error is coming.

BLOCK: WHEN-NEW-FORM-INSTANCE(Form),5 errors
Error 49 at line 42, column 1
bad bind variable 'tool.dsp_heading'
Error 49 at line 42, column 1
bad bind variable 'tool.dsp_heading'
Error 49 at line 50, column 2
bad bind variable 'tool.dsp_sub_heading'
Error 49 at line 57, column 2
bad bind variable 'tool.dsp_sub_heading'

Please help in fixing the same.

I am attaching the corresponding .fmb file.

Regards,
Seerat.
Re: Bad bind variable error [message #588867 is a reply to message #588862] Sat, 29 June 2013 02:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Reported message:

Quote:
Reason: will my message is visible to users?


Sure, it is.

Regards
Michel
Re: Bad bind variable error [message #588870 is a reply to message #588867] Sat, 29 June 2013 02:44 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't have Forms here so I can't open your FMB. Could you post contents of the WHEN-NEW-FORM-INSTANCE trigger?
Re: Bad bind variable error [message #588874 is a reply to message #588870] Sat, 29 June 2013 04:04 Go to previous messageGo to next message
smehta25
Messages: 5
Registered: June 2013
Location: Jammu
Junior Member

Thanks for the reply ... Below are the contents of the WHEN-NEW-FORM-INSTANCE trigger
DECLARE

counter	NUMBER(2);
sett_itm	ITEM;
dflt_dir	VARCHAR2(256);
app_name	applications.application_desc%TYPE;

BEGIN
EXECUTE_TRIGGER('WNFI');
DEFAULT_VALUE('','GLOBAL.user_code');
DEFAULT_VALUE('','GLOBAL.user_dsp_name');

app_name := 'Unknown';

IF :SYSTEM.CURRENT_FORM = 'NHPC' THEN
	disable_menu;
END IF;

SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE, 'National Hydroelectric Power Corporation ' || ' User : ' || :GLOBAL.user_code);
READ_IMAGE_FILE('nhpc.bmp', 'BMP', 'tool.nhpcpic');
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_STATE,MAXIMIZE);

dflt_dir := GET_FORM_PROPERTY('nhpc', FILE_NAME);

FOR cntr IN REVERSE 1..LENGTH(dflt_dir)
LOOP
	IF SUBSTR(dflt_dir, cntr, 1) = '\' THEN
		counter := cntr;
		EXIT;
	END IF;
END LOOP;

dflt_dir := SUBSTR(dflt_dir, 1, counter);
:GLOBAL.default_dir := dflt_dir;

END;

IF :GLOBAL.user_code <> '' THEN
	GO_BLOCK('control');
END IF;

:tool.dsp_heading := 'National Hydroelectric Power Corporation';

FOR apprec IN (	SELECT	application_desc
			FROM		applications
			WHERE		application_code = (	SELECT	application_code
									FROM		modules
									WHERE		module_code = :system.current_form))
LOOP
	:tool.dsp_heading := apprec.application_desc;
END LOOP;

FOR apprec IN (	SELECT	module_desc
			FROM		modules
			WHERE		module_code = :system.current_form)
LOOP
	:tool.dsp_sub_heading := apprec.module_desc;
END LOOP;

Waiting for your reply.

Thanks & Regards,
Seerat


[EDITED by LF: applied [code] tags]

[Updated on: Sat, 29 June 2013 04:24] by Moderator

Report message to a moderator

Re: Bad bind variable error [message #588877 is a reply to message #588874] Sat, 29 June 2013 04:33 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I suppose that ":tool.dsp_heading" and ":tool.dsp_sub_heading" represent items that belong to the TOOL block. Is that so? If not, what are they?

Code you posted seem to be OK; I don't see anything wrong in
:tool.dsp_heading := 'National Hydroelectric Power Corporation';
or
:tool.dsp_heading := apprec.application_desc;
or
:tool.dsp_sub_heading := apprec.module_desc;

which are lines that contain these items.

However, your initial post says that Quote:
BLOCK: WHEN-NEW-FORM-INSTANCE(Form),5 errors
You named 4 of them (in the same initial message), two of them mentioning DSP_HEADING and two of them DSP_SUB_HEADING. Finally, code you posted contains 3 lines (2 with DSP_HEADING, 1 with DSP_SUB_HEADING).

Therefore, something is missing and is not right. 5 <> 4 <> 3. So, what is the truth?

Finally, did you try to compile all (Ctrl + Shift + K)?
Re: Bad bind variable error [message #588879 is a reply to message #588877] Sat, 29 June 2013 04:52 Go to previous messageGo to next message
smehta25
Messages: 5
Registered: June 2013
Location: Jammu
Junior Member

There is no such tool block in the code...

and in total 5 errors are coming

BLOCK: WHEN-NEW-FORM-INSTANCE(Form),5 errors
Error 49 at line 42, column 1
bad bind variable 'tool.dsp_heading'
Error 49 at line 42, column 1
bad bind variable 'tool.dsp_heading'
Error 49 at line 50, column 1
bad bind variable 'tool.dsp_heading'
Error 49 at line 52, column 2
bad bind variable 'tool.dsp_sub_heading'
Error 49 at line 57, column 2
bad bind variable 'tool.dsp_sub_heading'

I am looking into the code written by someone else that is why i am also confused in this
:tool.dsp_heading" and ":tool.dsp_sub_heading

I am getting dese errors after compilation Razz
Re: Bad bind variable error [message #588881 is a reply to message #588879] Sat, 29 June 2013 04:59 Go to previous message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If there's no block named "tool" (and, possibly, no items named "dsp_heading" and "dsp_sub_heading"), no wonder you got errors. What did you expect?
Previous Topic: Global variable
Next Topic: getting value from db
Goto Forum:
  


Current Time: Tue May 07 15:00:05 CDT 2024