B
Bob Day
Using vs.2003, vb.net, sql native...
As an example, I have a 3 column table (Dialing_Rules_RBOC), 1 row, all
Integers.
....
fld_IX_Area_Code_Calling_To(value is 317)
fld_IX_Prefix_Range_Begin(value is 0)
fld_IX_Prefix_Range_End(value is 999)
....
Now I want to write a select statement that would see if there is a row that
corresponds to area code 317 and prefix 555. I am using query builder to do
this, because I am a novice at SQL. But I think it you can give me the
select statement, I can build it in the query builder.
Although awkward, the following select statement works:
SELECT fld_Dialing_Rules_RBOC_Table_ID, fld_IX_Area_Code_Calling_To,
fld_IX_Prefix_Range_Begin, fld_IX_Prefix_Range_End
FROM Dialing_Rules_RBOC
WHERE (fld_IX_Area_Code_Calling_To = @AREA_CODE) AND
(fld_IX_Prefix_Range_Begin <= @PREFIX_RANGE_BEGIN) AND
(fld_IX_Prefix_Range_End >= @PREFIX_RANGE_END)
I refer to it as awkward, because you must set the begin and end parameters
below to the same number:
Where @AREA_CODE = 317
@PREFIX_RANGE_BEGIN = 555
@PREFIX_RANGE_END = 555
I there a better way to do it?
Thanks!
Bob Day
As an example, I have a 3 column table (Dialing_Rules_RBOC), 1 row, all
Integers.
....
fld_IX_Area_Code_Calling_To(value is 317)
fld_IX_Prefix_Range_Begin(value is 0)
fld_IX_Prefix_Range_End(value is 999)
....
Now I want to write a select statement that would see if there is a row that
corresponds to area code 317 and prefix 555. I am using query builder to do
this, because I am a novice at SQL. But I think it you can give me the
select statement, I can build it in the query builder.
Although awkward, the following select statement works:
SELECT fld_Dialing_Rules_RBOC_Table_ID, fld_IX_Area_Code_Calling_To,
fld_IX_Prefix_Range_Begin, fld_IX_Prefix_Range_End
FROM Dialing_Rules_RBOC
WHERE (fld_IX_Area_Code_Calling_To = @AREA_CODE) AND
(fld_IX_Prefix_Range_Begin <= @PREFIX_RANGE_BEGIN) AND
(fld_IX_Prefix_Range_End >= @PREFIX_RANGE_END)
I refer to it as awkward, because you must set the begin and end parameters
below to the same number:
Where @AREA_CODE = 317
@PREFIX_RANGE_BEGIN = 555
@PREFIX_RANGE_END = 555
I there a better way to do it?
Thanks!
Bob Day