?
Solved

PLS-00049: bad bind variable

Posted on 2010-11-18
3
Medium Priority
?
2,313 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 1600 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 400 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

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…
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…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

764 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