Casting parameter in Stored Procedure

  • hi

    i have stored procedure which takes parameter as datetime datatype. i need to cast that it behave like datetime in a parameter,but when i called it from framework manager in cognos,it should be varchar.

    How to do this?

  • This was removed by the editor as SPAM

  • but when i called it from framework manager in cognos,it should be varchar.

    When you called, it was varchar OR you want it as varchar in Cognos?

    If first, then it's default typecasting to varchar. Please check it.

    Else typecast it into varchar in Cognos.

  • In case if you need the value to be datetime and storage type to be varchar in COGNOS, then you need to CAST it to datetime in the SP once the value is passed in varchar paremeter.

    But make sure that the value stored in the parameter is valid datetime, other wise it might throw conversion errors.

    The above approach will work if it is a input parameter to the SP, if the parameter is an output parameter then try in other way.

    thanks
    sarat 🙂
    Curious about SQL

  • my problem is in sql stored procedure i have datetime ,but in cognos framework it givesme error like expected framework is CCYY-MM-DD T hh:mm:ss.even i cast it to varchar in stored procedure and try to have varchar in cognos,it gives me error like conversion from datetime to varchar has prob.

  • This was removed by the editor as SPAM

  • hi

    i used like this in #prompt('parm1','datetime')# in cognos framework.but it gives me error like parm 1 is not found in stored procedure.

    if i use #prompt('parm1 ','ndatetime') then it gives me error like expected format 'CCYY-MM-DDT hh:mm:ss' .

    Thanks

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply