Migration from Teradata to SQL

  • Hi,

    We are currently migrating our project database from teradata to SQL. In teradata all the input parameters in queries are passed as placeholder(?) . How can I convert that placeholder to sql parameter. Can someone please give me ideas on different approaches to pass the input parameters. Am new to teradata ,so please help me with it.

    example of teradata query : 
    update tablename set id=? where id=?

    Does SQL supports placeholder(?) to pass input parameters as in teradata.

    Thanks in Advance !

  • I wouldn't expect you to be able to directly port anything that's not base ansi sql code without having to review and likely modify it.

  • prasanna0184 - Friday, November 17, 2017 11:14 AM

    Hi,

    We are currently migrating our project database from teradata to SQL. In teradata all the input parameters in queries are passed as placeholder(?) . How can I convert that placeholder to sql parameter. Can someone please give me ideas on different approaches to pass the input parameters. Am new to teradata ,so please help me with it.

    example of teradata query : 
    update tablename set id=? where id=?

    Does SQL supports placeholder(?) to pass input parameters as in teradata.

    Thanks in Advance !

    IIRC, the parameter placeholder "?" can either be named or not named, in the latter case it would depend on the order of the values passed. 
    😎

    Would have expected to see something like
    update tablename set id=?NewVal where id=?OldVal

    If the query is being run in SQL Assistant, then this is not proper parameterization as the SQLA will simply replace the value passed in the query.
    To convert to T-SQL, simply use the variable and input parameter declaration, i.e.
    DECLARE @MYVAR [MyType]

    Question, have you done static code analysis to find uncompatible features used?

  • prasanna0184 - Friday, November 17, 2017 11:14 AM

    Hi,

    We are currently migrating our project database from teradata to SQL. In teradata all the input parameters in queries are passed as placeholder(?) . How can I convert that placeholder to sql parameter. Can someone please give me ideas on different approaches to pass the input parameters. Am new to teradata ,so please help me with it.

    example of teradata query : 
    update tablename set id=? where id=?

    Does SQL supports placeholder(?) to pass input parameters as in teradata.

    Thanks in Advance !

    WHICH QUERIES?  Do you mean as generated in the front end or in stored procedures?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 4 (of 4 total)

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