Solved

PLS-00049: bad bind variable

Posted on 2010-11-18
3
2,294 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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 syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

705 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