Solved

PLS-00049: bad bind variable

Posted on 2010-11-18
3
2,268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 77

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

756 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