DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: help me

  1. #1
    manish Guest

    help me


    freinds i am tring to execute following query

    can any one tell me how can i correct it?
    as it is not executing .

    i explain it--

    actually i am trying to retrieve information of persons which meet a parameter
    given by the user .
    the information is distributed among differenr tables.

    one thing more the qualification table has multiple records for a person.

    so please help me solve this problem.


    one thing more i have made use of session variables quite extensively.
    is that harmful??

    SQL = "SELECT DISTINCT A.EMAILID,A.FIRST_NAME,A.MIDDLE_NAME,A.LAST_NAME,B.QUALIFICATION
    "
    SQL = SQL & " FROM PERSONAL_INFO A,QUALIFICATION_TABLE B"
    SQL = SQL & " WHERE A.EMAILID = B.EMAILID AND B.EMAILID IN "
    SQL = SQL & " ( SELECT EMAILID FROM CANDIDATE_CURRENT_EMPLOYMENT "
    SQL = SQL & " WHERE CURRENT_LEVEL = " & chr(39) & session("rel") & chr(39)
    & ")"

  2. #2
    Michael Guest

    Re: help me

    Manish, I added a join instead having so many conditions in the where clause
    and don't use the chr(39). That works well for output to the client but here
    simply include the single quote in your literal string.

    SQL = "SELECT DISTINCT
    A.EMAILID,A.FIRST_NAME,A.MIDDLE_NAME,A.LAST_NAME,B.QUALIFICATION"

    SQL = SQL & " FROM PERSONAL_INFO A JOIN QUALIFICATION_TABLE B ON (A.EMAILID
    = B.EMAILID)"

    SQL = SQL & " WHERE B.EMAILID IN"

    SQL = SQL & " (SELECT EMAILID FROM CANDIDATE_CURRENT_EMPLOYMENT"

    SQL = SQL & " WHERE CURRENT_LEVEL = '" & session("rel") & "'"

    Michael Sanchez
    Runtime Web Development

    "manish" <m_jaiswal1@yahoo.com> wrote in message
    news:3eb9dc9a$1@tnews.web.devx.com...
    >
    > freinds i am tring to execute following query
    >
    > can any one tell me how can i correct it?
    > as it is not executing .
    >
    > i explain it--
    >
    > actually i am trying to retrieve information of persons which meet a

    parameter
    > given by the user .
    > the information is distributed among differenr tables.
    >
    > one thing more the qualification table has multiple records for a person.
    >
    > so please help me solve this problem.
    >
    >
    > one thing more i have made use of session variables quite extensively.
    > is that harmful??
    >
    > SQL = "SELECT DISTINCT

    A.EMAILID,A.FIRST_NAME,A.MIDDLE_NAME,A.LAST_NAME,B.QUALIFICATION
    > "
    > SQL = SQL & " FROM PERSONAL_INFO A,QUALIFICATION_TABLE B"
    > SQL = SQL & " WHERE A.EMAILID = B.EMAILID AND B.EMAILID IN "
    > SQL = SQL & " ( SELECT EMAILID FROM CANDIDATE_CURRENT_EMPLOYMENT "
    > SQL = SQL & " WHERE CURRENT_LEVEL = " & chr(39) & session("rel") & chr(39)
    > & ")"




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center