<%@ Page Language="c#" %>

<%@ Register TagPrefix="uc1" TagName="Trailer" Src="Trailer.ascx" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="edu.jhu.Cas.Util" %>
<%@ Register TagPrefix="uc2" TagName="Header" Src="top.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="cjobs.css" rel="stylesheet" />
    <title>CasJobs FAQ</title>
    <%	
        string text = Request.Params["lmessage"];
        if (null == text) text = "";
%>
</head>
<body>
    <uc2:Header ID="Header" runat="server" />
    <div>
        <p>
            <%=text%>
        </p>
        <h1>
            Frequently Asked Questions&nbsp;</h1>
        <ul>
            <li><b><a href="#inv">Why am I getting "Invalid object name"
	    error for every query?</a></b> </li>
            <li><b><a href="#ks">Any keyboard shortcuts?</a></b> </li>
            <li><b><a href="#pq">How do I submit part of a query?</a></b> </li>
            <li><b><a href="#Q6">What does 'General Network Error' mean?</a></b> </li>
            <li><b><a href="#cconf">What does 'Column names in each table must be unique.' mean?</a></b>
            </li>
            <li><b><a href="#Q7">What does 'Query results exceed memory limitations' mean?</a></b>
            </li>
            <li><b><a href="#waiting">How may I check how many jobs are waiting for a given context?</a></b>
            </li>
            <li><b><a href="#bump">(How) can I bump up my MYDB size limit?</a></b> </li>
            <li><b><a href="#complete">What happens if my query does not complete?</a></b> </li>
            <li><b><a href="#stuck">Who do I notify if my job doesn't run for a long time (the queue
                appears to be stuck)?</a></b> </li>
            <li><b><a href="#drop">Why can't I drop or create tables outside the MyDB context?</a></b>
            </li>
            <li><b><a href="#enum">How can I add a <i>count</i> or enumerator column to my table?</a></b>
            </li>
            <li><b><a href="#funcs">Why can't I run user-defined functions from outside the context
                of the DB in which they are defined?</a></b> </li>
            <li><b><a href="#CL">Why isn't my CasJobs Command-Line (CL) tool working?</a></b>
            </li>
            <li><b><a href="#schema">Where can I find the schema information for various tables,
                functions and procedures similar to the SkyServer Schema Browser?</a></b> </li>
            <li><b><a href="#crossid">How can I cross-identify (find matching objects in SDSS) for
                my list of sources for which I have RA,decs?</b></li>
        </ul>
        <p>
            <b><a name="ks">Why am I getting "Invalid object name"
	    error for every query?</a></b> 
	    <br>
	    You are probably in the wrong Context, please select the
	    proper context for your query from the Context drop-down
	    menu on the top left of the Query page.  You should read
	    the <a href="Guide.aspx#context">Help page section on 'Context and Queues'</a> for further
	    information.
	<p>
            <b><a name="ks">Any keyboard shortcuts?</a></b>
            <br>
            Yup. The page for query submission has a few keyboard shortcuts for things like
            submitting a query, checking syntax, showing results, etc. Shortcuts are described
            in the tooltip for the button that performs the equivalent action.  
            Additionally, you can press the Tab key to automatically indent selected text.</p>
        <p>
            <b><a name="pq">How do I submit part of a query?</a></b>
            <br>
            From the 'Query' page, select the part of your query that you want to execute, then click on the appropriate action, like 'Quick' or 'Syntax'.  
            Your selection will be treated as the entire query.  This also works with keyboard shortcuts.
        <p>
            <b><a name="Q6">What does 'General Network Error' mean?</a></b>
            <br>
            This error message is usually a result of particularly high server load. It is not
            a direct result of your query. A resubmit will usually fix this.</p>
        <p>
            <b><a name="cconf">What does 'Column names in each table must be unique.' mean?</a></b>
            <br>
            SQL requires that all columns within a table contain a unique name. This error usually
            occurs when a user inadvertantly tries to create a table with duplicate column names.
            For example, views 'Photoobj' and 'Galaxy' both contain an 'objid' column, so if
            one tried a select * from both of these into a single table this error would occur.
            The fix is to explicity name the conflicting column as something else, so instead
            of doing 'select ra from photoobj' you could do 'select ra as ra2 from photoobj'.</p>
        <p>
            <b><a name="Q7">What does 'Query results exceed memory limitations' mean?</a></b>
            <br>
            This means the result of the query which you've submitted is greater than the memory
            buffer will allow. This message only applies to 'quick' queries; queries using 'submit'
            do not have any memory restrictions. The easiest thing to do is just use submit
            instead of quick.</p>
        <p>
            <b><a name="waiting">How may I check how many jobs are waiting in a given queue?</a></b>
            <br>
            Go to the <a href="admin.aspx">Queues</a> page by clicking on the link here or in
            the menu-bar.
        </p>
        <p>
            <b><a name="bump">(How) can I bump up my MYDB size limit?</a></b>
            <br>
            You may request additional space - you do not automatically get more space. Please
            email the Help Desk (<b>Contact</b> link at the bottom of the page) after you log
            in. </a>
        </p>
        <p>
            <b><a name="complete">What happens if my query does not complete ?</a></b>
            <br>
            We strictly limit the length of queries for up to eight hours. If your query fails
            to complete in this amount of time you should ask for it to be analyzed and we will
            attempt to make your query more efficient.
        </p>
        <p>
            <b><a name="stuck">Who do I notify if my job doesn't run for a long time (the queue
                appears to be stuck)?</a></b>
            <br>
            Occasionally the service running the jobs hangs (although we hope to have fixed
            it in this version). If you see many waiting jobs and none executing, please email
            the <b>SDSS Help Desk</b> using the <b>Contact</b> link at the bottom of this page.
        </p>
        <p>
            <b><a name="drop">Why can't I drop or create tables outside the MyDB context?</a></b>
            <br>
            This is due to CasJobs' distributed operation and because SQL Server does not allow
            tables to be dropped or created remotely (from a different server via a linked server
            connection). For more information, please see the <a href="Guide.aspx#distributed">CasJobs
                Limitations due to Distributed Execution</a> section in the Help page.
        </p>
        <p>
            <b><a name="enum">How can I add a <i>count</i> or enumerator column to my table?</a></b>
            <br>
            If you need to add an enumerator (an int id) column to your table (e.g., for use
            in the neighbors search type queries), you can do it as described in the <a href="aqueries.aspx#enum">
                Enumerator Column</a> example in the <a href="aqueries.aspx">Advanced CasJobs Queries</a>
            page.
        </p>
        <p>
            <b><a name="funcs">Why can't I run user-defined functions from outside the context of
                the DB in which they are defined?</a></b>
            <br>
            This is due to CasJobs' distributed operation and because SQL Server does not allow
            user-defined functions to be executed remotely (from a different server via a linked
            server connection). For more information, please see the <a href="Guide.aspx#distributed">
                CasJobs Limitations due to Distributed Execution</a> section in the Help page.
        </p>
        <p>
            <b><a name="CL">Why isn't my CasJobs Command-Line (CL) tool working?</a></b>
            <br>
            Two common problems with the CL tool are the Java version compatibility and network
            problems due to either an incorrect <a href="download/casjobs.config.x">config.casjobs</a>
            file or your local proxy or firewall setting. The CL tool is currently <b>only compatible
                with Java SDK v1.5 or higher (v1.6 recommended)</b>. If you are using a compatible
            version of Java, and it is still not working (e.g. giving you the error "Error retrieving
            host info."), then you need to contact the Help Desk (see Contact link below) with
            the contents of your config file and information about your proxy and firewall settings.
        </p>
        <p>
            <b><a name="schema">Where can I find the schema information for various tables, functions
                and procedures similar to the SkyServer Schema Browser?</a></b>
            <br>
            To get the schema for different tables in a given context a la the SkyServer Schema
            Browser, go to the <a href="MyDB.aspx">MyDB</a> page and from the dropdown menu
            at the top left of the page, select the context that you want the schema information
            for (default is your MyDB context). Then you will see the tables for that context
            listed on the left instead of your MyDB tables. Click on one of the tables to see
            its schema information. To view schema for views, functions and procedures, click
            on the appropriate link below the context menu. To go back to your MyDB schema page,
            select MyDB again from the context menu.
        </p>
        <p>
            <b><a name="crossid">How can I cross-identify (find matching objects in SDSS) for my
                list of sources for which I have RA,decs?</a></b>
            <br>
            If your list of RA,decs is of small to moderate size (up to a few hundred objects),
            you might be better off using the <a href="http://skyserver.sdss3.org/public/en/tools/crossid/crossid.asp">
                SkyServer CrossID page</a> to correlate your positions to SDSS objects. For
            longer lists, you will need to use the neighbors search options in CasJobs. The
            first step is to import your list of positions using the <a href="TableImport.aspx">
                CasJobs Import page</a>. If you don't already have a column in your imported
            table to identify each object, you may want to <a href="#enum">add an enumerator column
                as instructed above</a>. After you've done that, the easiest option is to go
            to your MyDB page and click on the table you just imported. If there are columns
            named "ra" and "dec" in a table, a "Neighbors" button appears in the menu at the
            top of the page. You can click on this button and select the options you desire
            to do a neighbors search within the specified radius for each object in your list.
            If this is not good enough for your purposes (e.g., if you want to specify a different
            search radius for each object in your list), then you will have to roll your own
            neighbors search as described in the <a href="aqueries.aspx">Advanced Queries help page</a>
            under <a href="aqueries.aspx#crossapply">Nearest Neighbor Search</a>.
        </p>
        <uc1:Trailer ID="Trailer1" runat="server" cvsTag="$Name$" cvsRev="$Revision: 151075 $">
        </uc1:Trailer>
    </div>
</body>
</html>
