Error Message:Not All Variables Bound.

Under Oracle8, using C to access the database, I can have something like the following
-----------
insert into XXX (col1)
values (decode(:jc,0,NULL,:jc ));

and bind the variable 'jc' once.

However, compiled under oracle7, when I run the program, it complains with 'Not all variables bound'.  Seems the compiler sees two 'jc's in the building of the statement but only one bind command.  One strategy may be to rename one of the variables and bind it as well, but this is very extensive throughout the program.  Is there anyway to go around this?
dteohAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

syakobsonCommented:
What tool do you use to compile?

Solomon Yakobson.
0
szetoaCommented:
Just a thought, can you bind the variable the second time.
0
dteohAuthor Commented:
Sorry.  The platform is Digital unix osf1 V4.0 1091 alpha.  The compiler is DIGITAL_C++_Version_V6.1-027 with libraries Generic++ 2.1 and STLport 3.01.

Also when I try to bind jc twice, the compiler complains.
0
dteohAuthor Commented:
Hi.  here are somemore updates to the problem.  Our database is one that deals with Chinese characters (double byte?).  There is an environment variable called NLS_LANG that is defaulted to AMERICAN_AMERICA.WE8DEC.  I find that when I replace it with TRADITIONAL CHINESE_TAIWAN.ZHT16DBT then it works.  Does anyone have any idea why?
0
Ron WarshawskyCommented:

Here what ORACLE says:

Doc ID:  Note:1004426.6
Subject:  ORA-1008 NOT ALL VARIABLES BOUND DURING RUNTIME
Type:  PROBLEM
Status:  PUBLISHED
 Content Type:  TEXT/PLAIN
Creation Date:  24-MAY-1994
Last Revision Date:  24-MAY-1994
Language:  USAENG
 
Problem Description:
====================
 
ORA-1008 "not all variables bound" during run time.
 
Problem Explanation:
====================

Solution Abstract:
==================
 
This is bug 71568. This bug is caused by referencing a bind variable at the
very last optional clause (having, group by, order by, etc.), the select is not
null terminated in this case.  
 
Workaround: Don't put the bind variable at the end.
 
Solution Diagnostics:
=====================
 
Solution Explanation:
=====================

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.