Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PLS-00049: bad bind variable

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

610 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