Subject Re: [firebird-support] Re: Full Cross Tab but unknown column headers
Author W O
The lines IN AUTONOMOUS TRANSACTION DO
and
INSERT INTO...

are for knowing the errors, you can delete both of them now and try again.

Your version of Firebird needs to compile the following commands and funtions:

CHAR_LENGTH()
IF() THEN
LEFT()
POSITION()
REPLACE()
WHILE() DO
EXECUTE STATEMENT
FOR EXECUTE STATEMENT

With Firebird 2.5.2 the stored procedures works fine, I dont know with which previous version they dont work.

Greetings.

Walter.




On Mon, Dec 30, 2013 at 10:13 AM, Venus Software Operations <venussoftop@...> wrote:
Thanks Walter.  I updated both the SPs with the ones you provided they
commited well.

So I dropped the original CREAR_... SP and recopied your original with
the extra IN AUTONOMOUS line added to it.  But maybe my version of
FireBird is wrong I get an error for the IN line and AUTONOMOUS word is
not highlighted in FlameRobin so it might be a new reserved word which
my version does not have.  I am using FB 2.1.4.18393.  I have also
create the MYTABLE and it's field CREATINGCODE of VARCHAR(2048)

I have also tried to remove the IN line and kept the INSERT line then
nothing is stored in MYTABLE.  I have also tried to remove the
AUTONOMOUS word but kept the IN and INSERT line then too no luck.

Please advise

Thanks and regards
Bhavbhuti

Starting transaction...
Preparing statement:

CREATE PROCEDURE CREAR_TABLA_PIVOT(
   TCNOMBRETABLA VARCHAR(28),
   TCVISTA VARCHAR(28),
....
...
    lcCreate = Left(lcCreate, Char_Length(lcCreate) - 2);

    lcCreate = lcCreate || ');';

IN AUTONOMOUS TRANSACTION DO
    INSERT INTO MYTABLE (CREATINGCODE) VALUES(:lcCreate);

    EXECUTE STATEMENT lcCreate;

    -- Segundo, le agregamos una Primary Key

    EXECUTE STATEMENT
       'ALTER TABLE ' || tcNombreTabla ||
       ' ADD CONSTRAINT PK_' || tcNombreTabla ||
       ' PRIMARY KEY (' || Left(:tcPrimeraColumnaCabecera, Position(' ',
:tcPrimeraColumnaCabecera)) || ')';

END
Error: *** IBPP::SQLException ***
Context: Statement::Prepare(

CREATE PROCEDURE CREAR_TABLA_PIVOT(
   TCNOMBRETABLA VARCHAR(28),
   TCVISTA VARCHAR(28),
...
...
    lcCreate = lcCreate || ');';

IN AUTONOMOUS TRANSACTION DO
    INSERT INTO MYTABLE (CREATINGCODE) VALUES(:lcCreate);

    EXECUTE STATEMENT lcCreate;

    -- Segundo, le agregamos una Primary Key

    EXECUTE STATEMENT
       'ALTER TABLE ' || tcNombreTabla ||
       ' ADD CONSTRAINT PK_' || tcNombreTabla ||
       ' PRIMARY KEY (' || Left(:tcPrimeraColumnaCabecera, Position(' ',
:tcPrimeraColumnaCabecera)) || ')';

END )
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

Engine Code    : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Token unknown - line 46, column 1
IN


Total execution time: 0.016s



On 30-12-2013 07:06 pm, W O wrote:
> IN AUTONOMOUS TRANSACTION DO
>    INSERT INTO MyTable (MyColumn) VALUES(:lcCreate);

--


Thanking you.

Yours Faithfully,
For Venus Software Operations
----
Mr. Bhavbhuti Nathwani
___________________________________________
Softwares for Indian Businesses at: http://www.venussoftop.com

venussoftop@...
venussoftop@...
___________________________________________

Please note: We reserve complete rights for policy changes in the future and the same will be applicable immediately as and when made.  Attachments may get corrupted before reaching you, in such a situation please let us know and we will resend you the same at the earliest.  We do not take any responsibility for data loss of any type and kind.  Data safety remains the sole the responsibility of the users of our softwares.
___________________________________________

Internet email confidentiality:

This message may contain information that may be privileged or confidential.  If you are not the addressee nor are you responsible for the delivery of the message to the addressee indicated in this email, then you may not copy or deliver this email to anyone and you should notify the sender by reply email and then destroy this message.

Please reply email immediately to this message with REMOVE in the subject, if you or your employer do not consent to email of this kind.

Opinions, conclusions and other information in this message that do not relate to the official business of my firm shall be understood as neither given nor endorsed by my company.



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org 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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-digest@yahoogroups.com
    firebird-support-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    http://info.yahoo.com/legal/us/yahoo/utos/terms/