how to execute a SQL command in one of the table f

Results 1 to 2 of 2

Thread: how to execute a SQL command in one of the table f

  1. #1
    garykoh Guest

    Default how to execute a SQL command in one of the table f

    hi,<BR> My recent project allow people to make a query with their own SQL command. I need to store the SQL command in a user table. when user login, i need to retrieve all the user infor as well as the result of SQL command stored in the field.<BR>For example :<BR>##condition field in user table will keep user SQL command as the following<BR>user.condition ="select invoice_no from invoice"<BR><BR>Thus when i execute the following command, i will get back the stored SQL command. But what i acatually want is the result of the SQL command.<BR><BR>select user.condition from user where user.usrid = "123"<BR><BR><BR>Any magic touch for that ?

  2. #2
    Join Date
    Dec 1969

    Default no magic touch...;ll have to first *get* the query from the first table and then apply it to the second one in a separate step. Why don&#039;t you want to do that? It isn&#039;t hard. And even if there is a way to do it inside SQL (and it probably *could* be done by using stored procedure in SQL Server), I don&#039;t think you&#039;d see any performance by doing so and the result would just be something that is harder to debug.<BR><BR>Don&#039;t fight simplicity!<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts