Solved

PLS-00049: bad bind variable

Posted on 2010-11-18
3
2,169 Views
Last Modified: 2013-12-07
I have the following insert statement,

I am getting PLS-00049 at line 11 and 12 at the bind variables :col_a, col_b etc..

These columns are present in mytable_STG table.

1    INSERT INTO mytable
2    (    
3        col_a, col_b, col_c, col_d, col_e
4    )
5   select    
6        trim( col_a),
7        trim( col_b),
8        SERVICEPKG.get_number( col_c),
9        trim( col_d),
10        trim( col_e),
11        abc_util.func1 ( 'BL', 'PRAX', 'NMR',  trim(:col_a), trim(:col_b), trim(:col_c), trim(:col_d )),
12       abc_util.func2 ( 'BL', 'DRAX', 'NMR',  trim(:col_e)),
13    from mytable_STG;

Error(11,86): PLS-00049: bad bind variable 'col_a'
Error(11,107): PLS-00049: bad bind variable 'col_b'
Error(11,132): PLS-00049: bad bind variable 'col_c'
Error(11,158): PLS-00049: bad bind variable 'col_d'
Error(12,82): PLS-00049: bad bind variable 'col_e'
0
Comment
Question by:gram77
3 Comments
 
LVL 1

Accepted Solution

by:
Lacca earned 400 total points
ID: 34162934
From http://download.oracle.com/docs/cd/B19306_01/server.102/b14219/plsus.htm

PLS-00049: bad bind variable "string"
Cause: The client (caller) of PL/SQL has parsed a bind variable that it has informed to be "bad".
Action: none

Try to remove the ":" or to rename your bind variables.

Regards.
0
 

Author Comment

by:gram77
ID: 34163165
Lacca:
It worked, why was : causing the trouble?
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 100 total points
ID: 34163574
They are columns in the table not variables in a procedure therefore you do not need the ':'.  The colon tells Oracle to expect a variable containing a value.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now