Regarding pro* c select statement

  • hi..

    I want to use variable name which contain table name into select statement.

    like

    select *from test001_emp;

    instead of this I want to use in this way

    name="test001_emp"

    select *from name;

    how should solve this prob??If u have any sol. then plz tell me

  • Lookup sp_executesql in the BOL.

    For example:

    declare @s-2 nvarchar(4000)

    set @s-2='select * from sysobjects'

    exec sp_executesql @s-2

  • This is a common beginners' request. You should get to grips with the following article to give you an idea of what you might be getting into...

    http://www.sommarskog.se/dynamic_sql.html

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

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

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