Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Search Function

Author  Topic 

vagabond
Starting Member

5 Posts

Posted - 2006-11-07 : 07:23:07
Hi All,

Here's my problem:

I create titles and submit them for approval. Once approved I can edit them again and either save them or submit them for approval again.

My problem is:
When I am creating a title and saving it in the drafts and searching for the title, I am able to find it in the result page. This is before approval.
When I submit the same title for approval and it's approved and then I change the title and save it as draft and then search the new title I cant find it. But when I search with the old title it shows me the result but with the new title name.

When I check the db and search for the new title no records found.
When I check the db and search for the old title the system returns me the record with the same old name.

So when I search the old title in the db it returns the old title.
So when I search the application for the new title it returns the old title.

Help Appreciated!

Using SQL Server 2005

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-07 : 07:27:26
Let's ask my magic ball...
The balls answers "without any DDL and some queries and sample data this question will never be answered."

Asking questions like this is like going to the doctor and say "I have a pain. What is wrong? And fix it!".


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-11-07 : 07:42:10
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=How%20to%20ask%20a%20question%20on%20SQL%20Team%20and%20get%20a%20quick%20answer
Go to Top of Page

vagabond
Starting Member

5 Posts

Posted - 2006-11-07 : 07:48:08
Okay.

I create a Title by name "Test Link 1" and submit it for approval. The links are stored in table "nodes". The approver approves the link "Test Link 1". When I search for "Test Link 1" I am able to find it.

Now Scenario 2
I create a Title by name "Test Link 2" and submits it for approval.
The approver approves the link "Test Link 2". I edit the link "Test Link 2", rename the title to "Test Link 2 - Modify" and save it as draft (Note: I am not submitting the Link). When I search for the link "Test Link 2 - Modify" I dont get any result. But when I search for "Test Link 2" I get the search result page with the title "Test Link 2 - Modify" (This happens in the application)

Behind the scenes i.e in db

When I search for "Test Link 2" it shows the record with the same title name "Test Link 2" but when I search for "Test Link 2 - Modify" I cant find anything...

Thanks,
Let me know if it's clear with examples.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-07 : 07:52:21
Where do you submit the titles? A table in SQL Server? A file on webserver?
If using a table, where is the table layout?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vagabond
Starting Member

5 Posts

Posted - 2006-11-07 : 08:25:50
Table layout:

node_id tree_id title URL friendly_name status

New - new item not yet submitted. OR declined new link
Draft - item is changed but not yet submitted. OR declined link change
WIP - link change submitted for approval
Expired - deleted from 'select task' page
Active - item in other than above status
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-07 : 08:29:04
Where is the query to retreive the titles?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vagabond
Starting Member

5 Posts

Posted - 2006-11-07 : 08:33:37
I dont have the query to retrieve the titles or the query tht's being used to search... I am a Test Engineer and trying to figure out the cause... Sorry! But could you let me know all the possible causes for this?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-07 : 08:47:23
Is the status changing at all between submits?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vagabond
Starting Member

5 Posts

Posted - 2006-11-07 : 08:54:22
Yes it changes according to the action done. But in this case which I stated below it remains as draft and cant be searched by the modified title name. but it can be searched by the previous old name which displays the new title.

New - new item not yet submitted. OR declined new link by approver
Draft - item is changed but not yet submitted. OR declined link change (This status is reflected if item is approved atleast once)
WIP - link change submitted for approval
Expired - deleted from 'select task' page
Active - item in other than above status
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-07 : 08:56:16
Use wildcards in the search.

SELECT * FROM MyTable WHERE title like '%mysearchname%' and status = 'draft'


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

samuelclay
Yak Posting Veteran

71 Posts

Posted - 2006-11-08 : 17:02:12
Without some idea of the search query code, how do we troublshoot the search query?

Possible cause? Error in search query...

Sounds like maybe the status is not being set properly when an approved item is then changed, but it is imposssible to tell without sample code (update and search queries).
Go to Top of Page
   

- Advertisement -