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.
Author |
Topic |
lpapp
Starting Member
8 Posts |
Posted - 2006-11-30 : 03:45:50
|
ok the criteria with hath i have the problem looks like thisSELECT DISTINCT Contractdetailat.NRCONTRACT, Contractdetailat.DINDATA,Contractdetailat.PINALADATA, Contractdetailat.PUNCTDELUC,Contractdetailat.COMPONENTE, Contractdetailat.PRETUNITAR,Contractdetailat.NRBUC, Contractdetailat.PRETTOTAL,Firma.DENUMIREFI, Firma.NRREGCOM, Firma.CODFISCAL,Firma.SEDIULSOCI, Firma.JUDETUL, Firma.CODIBAN,Firma.BANCA, Firma.PUNCTDELUC, Firma.NRCONTRACT,Delegati.NUMELEDELE, Delegati.BI_CI_, Delegati.SERIA,Delegati.ELIBERATPO, Delegati.MIJLOCTRAN,Delegati.NRMASINA, Delegati.DATAEXPEDFROM "D:\ISTI\28.11.2006\contractdetailat.dbf" Contractdetailat INNER JOIN "D:\ISTI\28.11.2006\firma.dbf" Firma ON (Contractdetailat.NRCONTRACT = Firma.NRCONTRACT) , "D:\ISTI\28.11.2006\delegati.dbf" DelegatiWHERE (Contractdetailat.NRCONTRACT = Firma.NRCONTRACT) AND (Contractdetailat.NRCONTRACT LIKE '............') in this section ........ i have to introduce the next statment editbox text or other component datavalue wich is al integer value asstring |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-30 : 03:55:15
|
Without sample data, your expected output/result based on the provided sample data, it is hard to tell.Peter LarssonHelsingborg, Sweden |
 |
|
swatib
Posting Yak Master
173 Posts |
Posted - 2006-11-30 : 03:58:02
|
Do you need to execute a query having dynamic ORDER BY value?If yes, the try this:declare @colname varchar(50)set @colname='cityname'EXEC ('select * from citymaster order by ' + @colname)Njoy Life |
 |
|
mr_mist
Grunnio
1870 Posts |
Posted - 2006-11-30 : 04:22:47
|
If all you want to do is parametere substition, then write a stored procedure that executes your statement and then, in the LIKE statement, compare to your variable -CREATE PROCEDURE moo@yourvariable VARCHAR(30)ASBEGIN SELECT column FROM yourtable WHERE somecolumn LIKE @yourvariableEND If you want to convert stuff from INTs, then probably it is easiest to do this in your web application, when you validate the input. You shouldn't directly be passing the contents of a text box into your query without pre-processing and validation anyway.-------Moo. :) |
 |
|
lpapp
Starting Member
8 Posts |
Posted - 2006-11-30 : 04:56:59
|
thanks but i have anopdher problem in the sql statment it gives me the message token "@variale " maybe i didnt defined rigth i'l try te sql documentation to help me .or i'l try to defining it in the source code too but maybee i'll get a double definirion error i'm working on it i'll be back with te final answer. quote: Originally posted by mr_mist If all you want to do is parametere substition, then write a stored procedure that executes your statement and then, in the LIKE statement, compare to your variable -CREATE PROCEDURE moo@yourvariable VARCHAR(30)ASBEGIN SELECT column FROM yourtable WHERE somecolumn LIKE @yourvariableEND If you want to convert stuff from INTs, then probably it is easiest to do this in your web application, when you validate the input. You shouldn't directly be passing the contents of a text box into your query without pre-processing and validation anyway.-------Moo. :)
papp |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|