473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

passing parameters using select * Like

Hello, I have never had trouble using parameters in the applications i developed, however i with this one - well u know: THIS HOW IT IS ANYWAY - U KNOW HOW U CAN USE A QUERY SAY TO SEARCH A NAME WITH CERTAIN SET OF LETTERS IN IT FOR EXAMPLE : SELECT * FROM TABLENAME WHERE NAMEFILED LIKE '%KAB%' THIS LISTS ALL NAMES WITH THE LETTERS "kAB" IN IT BU NOW I NEED TO CREATE A PROCEDURE IN WHICH A PARAMETER CAN BE PASSED FROM THE MSACCESS CLIENT TO SEARCH FOR THE NAME.

FOR EXAMPLE THE "KAB" IS PASSED TO A PARAMETER @NAME! I AM STUCK NEED HELP BAAAAAD!
Aug 29 '07 #1
3 8764
azimmer
200 Expert 100+
Hello, I have never had trouble using parameters in the applications i developed, however i with this one - well u know: THIS HOW IT IS ANYWAY - U KNOW HOW U CAN USE A QUERY SAY TO SEARCH A NAME WITH CERTAIN SET OF LETTERS IN IT FOR EXAMPLE : SELECT * FROM TABLENAME WHERE NAMEFILED LIKE '%KAB%' THIS LISTS ALL NAMES WITH THE LETTERS "kAB" IN IT BU NOW I NEED TO CREATE A PROCEDURE IN WHICH A PARAMETER CAN BE PASSED FROM THE MSACCESS CLIENT TO SEARCH FOR THE NAME.

FOR EXAMPLE THE "KAB" IS PASSED TO A PARAMETER @NAME! I AM STUCK NEED HELP BAAAAAD!
I don't really see a problem here, the example below works fine (it's a function not a procedure but illustrates the point):
Expand|Select|Wrap|Line Numbers
  1. create function myfind (@name as varchar(255)) returns table
  2. as
  3. return select * from myTable where NameField like '%'+@name+'%'
  4.  
Use it like this:
Expand|Select|Wrap|Line Numbers
  1. select * from myfind('KAB')
  2.  
Aug 30 '07 #2
Purple
404 Expert 256MB
Hi nairjones,

I would like to direct you the the posting guidelines here. Please read as your post does not comply with the site guidelines.

Purple

Moderator
Aug 30 '07 #3
I don't really see a problem here, the example below works fine (it's a function not a procedure but illustrates the point):
Expand|Select|Wrap|Line Numbers
  1. create function myfind (@name as varchar(255)) returns table
  2. as
  3. return select * from myTable where NameField like '%'+@name+'%'
  4.  
Use it like this:
Expand|Select|Wrap|Line Numbers
  1. select * from myfind('KAB')
  2.  

Thanks alot works well.
Sep 7 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
1
by: Daryl | last post by:
Hello I am using apply-templates and would like to pass a parameter to the template using with-param. Using call-template passes the parameter, but when I use apply-templates, the parameter seems...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
4
by: Alfred Taylor | last post by:
I essentially need a countif() function for xsl. Something to where I could do countif(node-set, condition). Rather than try to get too extreme, i decided to just write one for my countif() with...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
6
by: dharmadam | last post by:
Is it possible to pass a column name or the order of the column name in the DB2 table table function. For example, I want to update the address of a person by passing one of the address column name...
1
by: owengoodhew | last post by:
Guys I need your help/Advice... In my Access Database I have a query (lets say qry1) and in this query i have 2 fields for start and end date, which is provided by 2 Get functions. also i...
9
by: orenr | last post by:
Hi We have a web site for 100 users using SQL Server. In our DAL all the selections when we need to pass parameters are using the SqlCommand and they are something like: SqlCommand com = new...
11
by: kennthompson | last post by:
Trouble passing mysql table name in php. If I use an existing table name already defined everything works fine as the following script illustrates. <?php function fms_get_info() { $result =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.