 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases 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
|
|
|
|

February 1st, 2005, 07:49 AM
|
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

February 1st, 2005, 09:13 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
LIKE ('% || header_name || %')
Try that.
|
|

February 1st, 2005, 10:19 AM
|
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I tried doing this but still my store procedure does not return any data. The code I wrote in asp follows below:
strFAQRequest = LCase(request("section"))
dim faqs
dim dbCmd
set faqs = server.CreateObject("ADODB.RECORDSET")
set dbCmd = Server.CreateObject("ADODB.COMMAND")
Const getfaqs = "{call HMIS_FAQ_Pkg.Get_Faq_Proc(?)}"
dbCmd.ActiveConnection = con
dbCmd.CommandText = getfaqs
dbCmd.CommandType = adCmdText
dbCmd.Parameters(0).direction = adParamInput
dbCmd.Parameters(0).Value = strFAQRequest
set faqs = dbCmd.Execute
dbCmd.Cancel
set dbCmd = nothing
It always comes up with the message that no data is returned from the recordset.I reckon the way i am passing the parameters to the Store Procedure is right??
Cheers,
Nitin
|
|

February 1st, 2005, 10:36 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
What does your data look like?
|
|

February 1st, 2005, 10:42 AM
|
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The data which I fetch from table are just 2 varchar values.
Its a table of Frequently Asked question with following enteries
ID Number
Header_id Number
Question Varchar2
Answer Varchar2
The header_id is a foriegn key with maps from the table with following attributes
Header_id Number
Title Varchar2
Now from my asp page I am sending the name of this title and then trying to fetch its header_id and get my question and answer recordset.There is no data returned at all on any options I am giving .
Cheers
Nitin
|
|

February 1st, 2005, 10:53 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Will (select header_id from faq_header where title LIKE ('% || header_name || %') return one record or multiple records?
Also try select header_id from faq_header where upper(title) LIKE upper('% || header_name || %')
|
|

February 1st, 2005, 11:03 AM
|
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The Select statement only returns one record. and its header_id which is the primary key for the table.
|
|

February 1st, 2005, 11:12 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
select question, answer
from faq_data d, faq_header h
where d.header_id = h.header_id
and UPPER(h.title) LIKE UPPER('% || header_name || %');
You can also try this.
|
|
 |