Subject | Re: Execute Statement Problem |
---|---|
Author | Adam |
Post date | 2005-12-20T23:54:45Z |
William,
Perhaps you have included the wrong procedures etc.
In your other prost you include the SP source for
REPORT_TARIFFJOURNAL but your test refers to the stored procedure
REPORT_TARIFF.
I assume this is a mistake and replace for REPORT_TARIFFJOURNAL, but
it works fine in iSQL. I also tried the generated query directly and
it works without errors in iSQL. Obviously it returns no data but
there is no error message either.
Execute statement is new in Firebird 1.5. You are using Firebird 1.5
or higher right?
Adam
--- In firebird-support@yahoogroups.com, Wei Yu <william_yuwei@y...>
wrote:
Perhaps you have included the wrong procedures etc.
In your other prost you include the SP source for
REPORT_TARIFFJOURNAL but your test refers to the stored procedure
REPORT_TARIFF.
I assume this is a mistake and replace for REPORT_TARIFFJOURNAL, but
it works fine in iSQL. I also tried the generated query directly and
it works without errors in iSQL. Obviously it returns no data but
there is no error message either.
Execute statement is new in Firebird 1.5. You are using Firebird 1.5
or higher right?
Adam
--- In firebird-support@yahoogroups.com, Wei Yu <william_yuwei@y...>
wrote:
>support@yahoogroups.com, "william_yuwei"
> Hi, Adam
>
> I have emailed all the related DDL (include the store procedures).
>
> Thanks
>
> William
>
> Adam <s3057043@y...> wrote: --- In firebird-
> <william_yuwei@y...> wrote:i.ID and
> >
> > Hi, All
> >
> > I have the following code in one of my store procedure
> > REPORT_TARIFF(divisionid, excludeinvoices):
> >
> > sql_text = 'select m.DESCRIPTION, t.CODE, c.CODE, sum(id.QTY),
> > sum(id.AMOUNT) '
> > || 'from INVOICE i ' ||
> > 'inner join INVOICE_DETAIL id on id.INVOICE_ID =
> > ' ||<> ''B'' '||
> > 'id.PART_ID is null and id.ADJUSTINVENTORY
> > 'inner join INVENTORY iv on iv.ID =id.INVENTORY_ID ' ||
> > 'inner join COUNTRY c on c.ID = iv.COUNTRY_ID ' |||| :last_tariff_invoiceno;
> > 'inner join MATERIAL m on m.ID = iv.MATERIAL_ID ' ||
> > 'inner join TARIFF t on t.ID = m.TARIFF_ID ';
> >
> > if (divisionid > 0) then
> > sql_text = sql_text ||
> > 'where i.DIVISION_ID = ' || divisionid || ' and ' ||
> > 'i.POSTED = ''Y'' and i.INVOICE_NO > '
> > else(id.AMOUNT)
> > sql_text = sql_text ||
> > 'where i.POSTED = ''Y'' and i.INVOICE_NO > ' ||
> > :last_tariff_invoiceno;
> >
> >
> > if (excludeinvoices <> '') then
> > sql_text = sql_text ||
> > ' and i.INVOICE_NO not in (' || excludeinvoices || ') ';
> >
> > sql_text = sql_text ||
> > ' group by m.DESCRIPTION, t.CODE, c.CODE';
> >
> > /*
> > for select m.DESCRIPTION, t.CODE, c.CODE, sum(id.QTY), sum
> > from INVOICE i= :divisionid)) and
> > inner join INVOICE_DETAIL id on id.INVOICE_ID = i.ID and
> > id.PART_ID is null and id.ADJUSTINVENTORY <> 'B'
> > inner join INVENTORY iv on iv.ID = id.INVENTORY_ID
> > inner join COUNTRY c on c.ID = iv.COUNTRY_ID
> > inner join MATERIAL m on m.ID = iv.MATERIAL_ID
> > inner join TARIFF t on t.ID = m.TARIFF_ID
> > where ((:divisionid <= 0) or (i.DIVISION_ID
> > i.POSTED = 'Y' and i.INVOICE_NOunder
> :last_tariff_invoiceno
> > group by m.DESCRIPTION, t.CODE, c.CODE
> > */
> >
> > for execute statement sql_text
> > into :DESCRIPTION, :TARIFF_CODE, :COUNTRY_CODE, :QTY,
> > :INVOICE_AMOUNT
> > do
> > begin
> > suspend;
> > end
> >
> > 1)What is strange is that, when I debug this store procedure
> > IBExpert, everything work just fine, but when I try to run thestore
> > procedure in the SQL editor, select * from report_tariff(-1, ''), I
> > got: Unsuccessful execute caused by an unavailable resource.Variable
> > type (position 3) in EXECUTE STATMENT 'select m.DESCRIPTION,t.CODE,
> > c.CODE, sum(id.QYT),' INTO does not match return.debugger
> >
>
> IBExpert is a simulator not a true debugger. There is no true
> for Firebird stored procedures. That means it may behavedifferently
> in some cases, and in some cases, may behave "better" thanFirebird does.
>token SQL
> > 2)When I using my application against "select * from
> > report_tariffjournal(-1, '')" I got error like: unexpected end of
> > command, Dyanamic SQL Error, Error Code: 249(100000) Invalid
> > Error code = -104"execute
> >
> > What am I doing wrong?
> >
>
> I had a problem before attempting to combine parameters with
> statement. Also make sure your variable is long enough to handlethe
> entire query.Service.
>
>
> Adam
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
>
>
> ---------------------------------
> YAHOO! GROUPS LINKS
>
>
> Visit your group "firebird-support" on the web.
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>
>
> ---------------------------------
>
>
>
>
>
>
> William, Yu
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> [Non-text portions of this message have been removed]
>