Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
| Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2005, 07:49 AM
Authorized User
 
Join Date: Sep 2004
Location: West Midlands, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Nitin_sharma Send a message via Yahoo to Nitin_sharma
Default Like Statement

Hi Guys,
I am new to oracle coding and I wrote this store procedure

PROCEDURE Get_Faq_Proc
       ( header_name in varchar2,
         out_faq_list OUT curTableList
       )
    IS
    BEGIN
         OPEN out_faq_list for
         select question , answer
         from faq_data
         where header_id = (select header_id from faq_header where title LIKE (''%' || header_name || '%'');

         end Get_Faq_proc;
And it comes up with an oracle error at like statement.
Any help would be appreciated.
Nitin

 
Old February 1st, 2005, 01:31 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

I think u need to create the SQL statement and store in a string and then execute the string.

Om Prakash
 
Old February 4th, 2005, 07:27 PM
Authorized User
 
Join Date: Feb 2005
Location: Chennai, Tamil Nadu, India.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rockyrak
Default

hi,

can you please send the error message that you are getting.



Ram
 
Old February 5th, 2005, 12:17 AM
Authorized User
 
Join Date: Dec 2004
Location: , , India.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use,

PROCEDURE Get_Faq_Proc
       ( header_name in varchar2,
         out_faq_list OUT curTableList
       )
    IS
str varchar2(1000);
    BEGIN
str := 'select question , answer
         from faq_data
         where header_id = (select header_id from faq_header where title LIKE (''%'' || header_name || ''%'')';
         OPEN out_faq_list for str


         end Get_Faq_proc;


Sujit Ku. Mahapatra
 
Old February 12th, 2005, 01:46 PM
Registered User
 
Join Date: Jan 2005
Location: hyd, a.p, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use like operator this way-
like '%' || upper(header_name) || '%';

thr




Similar Threads
Thread Thread Starter Forum Replies Last Post
if/else statement mussa Beginning PHP 5 July 3rd, 2006 06:06 PM
What does the @ do in the following statement? kenn_rosie VB.NET 2002/2003 Basics 1 March 15th, 2006 12:20 PM
Like Statement Nitin_sharma Oracle ASP 2 May 10th, 2005 12:18 AM
Like statement Nitin_sharma Classic ASP Databases 7 February 1st, 2005 11:12 AM
if statement markhardiman VS.NET 2002/2003 1 July 31st, 2003 06:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.