0

how to create the sqlite function in objective c. call the function for inserting the query.

CREATE FUNCTION dbo.ListDates
(
     @StartDate    DATETIME  
    ,@EndDate      DATETIME
)
RETURNS
@DateList table
(
    Date datetime
)
AS
BEGIN

/*add some validation logic of your own to make sure that the inputs are sound.Adjust the rest as needed*/

  INSERT INTO
    @DateList
  SELECT FLD_Date FROM TableOfDates (NOLOCK) WHERE FLD_Date >= @StartDate AND FLD_Date <= @EndDate
  RETURN
END
KkMIW
  • 1,092
  • 1
  • 17
  • 27
  • 1
    SQLite doesn't do stored procedures. Is there any reason why it has to be a stored procedure, rather than just writing Objective-C code to insert these records? – Rob Aug 10 '16 at 09:33
  • Thank you Rob, i go for query. – KkMIW Aug 10 '16 at 10:19

0 Answers0