1
私は、Oracleデータベースに対して次のクエリを持っている:SQL Server Reporting ServicesのQuery.CommandTextにパラメータを渡すにはどうすればよいですか?
select * from (
select Person.pId, Person.lastName as patLast, Person.firstName as patFirst
, Person.dateOfBirth
, Medicate.mId, Medicate.startDate as medStart, Medicate.description
, cast(substr(Medicate.instructions, 1, 50) as char(50)) as instruct
, ml.convert_id_to_date(Prescrib.pubTime) as scripSigned
, max(ml.convert_id_to_date(Prescrib.pubTime)) over (partition by Prescrib.pId, Prescrib.mId) as LastScrip
, UsrInfo.pvId, UsrInfo.lastName as provLast, UsrInfo.firstName as provFirst
from ml.Medicate
join ml.Prescrib on Medicate.mId = Prescrib.mId
join ml.UsrInfo on Prescrib.pvId = UsrInfo.pvId
join ml.Person on Medicate.pId = Person.pId
where Person.isPatient = 'Y'
and Person.pStatus = 'A'
and Medicate.xId = 1.e+035
and Medicate.change = 2
and Medicate.stopDate > sysdate
and REGEXP_LIKE(Medicate.instructions
, ' [qtb]\.?[oi]?\.?[dw][^ayieo]'
|| '|[^a-z]mg?s'
|| '|ij'
|| '|[^a-z]iu[^a-z]'
|| '|[0-9 ]u '
|| '|[^tu]hs'
, 'i')
order by ScripSigned desc
) where scripSigned = lastScrip and scripSigned > date '2011-01-01'
私はDateTimeのように定義レポート定義されたパラメータ、DateBeginを、持っている、と私はまたDateBegin呼ばれるクエリパラメータでそれを関連付けました。私はちょうどblinkin 'ものが実際に動作するように、 "date' 2011-01-01 '"を "DateBegin"に置き換える方法を理解できません。ありがとう!
ああ、ありがとうございました。 Oracleに直接パラメータを渡す必要はありませんでした。 Crystal Reportsは、任意のSQLコマンドに対して同じパラメータ形式({?DateBegin})を使用し、バックエンドに適した形式に変換します。 – SarekOfVulcan