Henry Olive 5 Posted 6 hours ago Good Day In Stored Procedure i can use below code WHERE :CUSTNO IS NULL OR C.CUSTNO=:CUSTNO) How can i use above code inside Delphi (10,4) ? SqlText := 'SELECT CUSTNO, CUSTNAME,EMAIL FROM CUSTOMER WHERE CUSTNO = :CUSTNO'; CDS1.CommandText := SqlText; CDS1.Params[0].asString = ?? // If :CUSTNO = '' (Empty) then show all Customers else just show choosen Customer Thank You Share this post Link to post
Angus Robertson 590 Posted 5 hours ago Why not just execute the stored procedure from Delphi? I don't have any SQL statements in Delphi applications, just build the stored procedure parameters and use the ADO Execute method which returns a DataSet RecordSet that I parse for various results. It means you can test all your SQL outside of Delphi. Angus Share this post Link to post
Henry Olive 5 Posted 4 hours ago Thank you Angus I dont want to use S.Proc. as i wrote my prior message i know how to use params in S.Proc but i want to use a dataset, query component inside Delphi Share this post Link to post
Angus Robertson 590 Posted 2 hours ago Just pass your literal SQL command to the Execute method, it returns a RecordSet which is a DataSet method. Angus Share this post Link to post