954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Oracle Help Vb.net application

Hi there Sorry if i have posted this on the wrong area.
I have a problem with a simple query shown below

SELECT * FROM Disney
WHERE Upper(COLNAME) LIKE UPPER('%' || SEARCHSTRING || '%');

My problem, The colname variable is not being recognised as a column name for example
A user can select to view a set of characters from the DB by username, movies, etc etc (they select this from a combobox) They then enter a search string(textbox)
colname = username
Searchstring = pluto
SELECT * FROM Disney
WHERE Upper(COLNAME) LIKE UPPER('%' || SEARCHSTRING || '%');

The problem is orac;e does not seem to be picking up that colname is a column name and seems to be doing a simple comparison. To make this clearer

it' seems to be trying to match username = pluto
rather than finding pluto in the username column.

Has anyone got any ideas how i can get around this. I have a strange feeling it is something to do with dynamic pl/sql but i am new to oracle so i have no idea how to write dynamic queries. Any help would be muchly appreciated

I am using oracle 11g and visual studio .net 2005

many regards and thanks in advanced icklecoder

icklecoder
Newbie Poster
1 post since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You