Subject Re: [firebird-support] Re: Error message
Author Helen Borrie
At 05:50 AM 3/04/2007, you wrote:
>Thanks for the information. I checked to make sure that there was adequate
>disk space available, ran GFIX over the database to fix any problems it
>found (but it didn't find any), and I can connect to the raw database
>without any problems.
>
>The issue comes down to this query:
>
>SELECT FIRST 30 SKIP 0
>JOB.JOB_ID,
>CLIENT.CLIENT_NAME,
>CLIENT_SITE.SITE_DESC,
>JOB.ENTERED_TS,
>JOB_STATUS.JS_NAME,
>TECHNICIAN.TECH_INITIALS,
>JOB.CHARGE_TYPE,
>JOB.JOB_DESC_SHORT
>FROM JOB
>INNER JOIN CLIENT ON (JOB.FK_CLIENT_ID = CLIENT.CLIENT_ID)
>INNER JOIN CLIENT_SITE ON (JOB.FK_SITE_ID = CLIENT_SITE.SITE_ID)
>INNER JOIN JOB_STATUS ON (JOB.FK_JS_ID = JOB_STATUS.JS_ID)
>INNER JOIN JOB_TECH ON (JOB.JOB_ID = JOB_TECH.JOB_ID)
>INNER JOIN TECHNICIAN ON (JOB_TECH.TECH_ID = TECHNICIAN.TECH_ID)
>WHERE JOB.RECORD_INACTIVE <> 'Y' AND FK_CLIENT_ID = 55601
>ORDER BY JOB_ID;
>
>I'm running this in a stored procedure, and I'm not exactly sure why its
>having problems with this.

It is not a valid query to run in a stored procedure....although you
ought to get a proper exception thrown for this (I don't recall which
one). If you do a multi-row select in a SP it has to be in a FOR
SELECT....INTO <:variables> construct.

>It is reporting that the issue is coming from the first INNER JOIN
>to the CLIENT table.

What is being reported?

Try running this exact query in isql (outside the context of the SP
body) and see whether you get an exception at all.

Rewrite the SP with a correct FOR SELECT...INTO query and see what
happens next.

./heLen