[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: What's wrong here ?



I did face a similar problem and a commit did help.
Since truncate doesnt use any RBS so commit may not be
useful so try to put the tables name  in an array and
do the truncate by reading the name of the tables from
the array.

Hope this help

--- Philippe Godin <philippe.godin@VIDEOTRON.CA>
wrote:
> I'm not sure but is it possible that your 2
> procedures aren't communicating
> properly? It seems to me that the $table_name
> variable always keep the same
> value when calling the truncate_the_table procedure.
> You should try to call the procedure with the
> $table_name variable as an
> argument such as:
>
> begin-procedure AC-Truncate-Tables
> begin-select On-Error=SQL-Error
> descr
>    let $table_name = upper(&descr)
>    show 'Truncating table: ' $table_name
>    do truncate_the_table($table_name)
> from PS_AC_TRUNC_TABLES
> end-select
> end-procedure  AC-Truncate-Tables
>
> begin-procedure  truncate_the_table($table_name)
> begin-sql
> truncate table [$table_name]
> end-sql
> end-procedure  truncate_the_table
>
> (If you want to make sure, print the $table_name
> value once in the
> truncate_the_table procedure)
> HTH
> Philippe
>
> -----Original Message-----
> From: Discussion of SQR, Brio Technology's database
> reporting language
> [mailto:SQR-USERS@list.iex.net]On Behalf Of
> Rick_Creel@AONCONS.COM
> Sent: 13 aout, 2001 14:23
> To: SQR-USERS@list.iex.net
> Subject: What's wrong here ?
>
>
> My environemnt is  Oracle 8.06,  SQR 4.34
>
> I have created a table that has a list of table
> names the need to be
> truncated.
> The SQR I have written is supposed to read this list
> of names and issue the
> TRUNCATE TABLE command.  Something funky is
> happening, and I don't know what
> to
> do to fix this.  Can someone please help?
>
> Here is the code exerpt:
>
============================================================================
> =
> begin-procedure AC-Truncate-Tables
> begin-select On-Error=SQL-Error
> descr
>    let $table_name = upper(&descr)
>    show 'Truncating table: ' $table_name
> !   do truncate_the_table
> from PS_AC_TRUNC_TABLES
> end-select
> end-procedure  AC-Truncate-Tables
> !----------------------------------
> begin-procedure  truncate_the_table
> begin-sql
> truncate table [$table_name]
> end-sql
> end-procedure  truncate_the_table
>
============================================================================
> =
>
> If I run the SQR as shown above, keeping the "do
> truncate_the_table" as a
> comment line,
> I get the following displays, which are correct.
>
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTOTAL
> Truncating table: PS_AC_REV_REC_TBL
> Truncating table: PS_AC_BOR_LENT_TBL
> Truncating table: PS_AC_TOT_ACCT_MGR
> Truncating table: PS_AC_BL_RR_TBL
> Truncating table: PS_AC_COST_TBL
> Truncating table: PS_AC_TOT_COST_TBL
> Truncating table: PS_PC_INTFC_BL_TAO
> Truncating table: PS_AC_COSTING_WRK
> Truncating table: PS_AC_GST_TAX_TMP
> Truncating table: PS_AC_GST_CONS_TMP
> Truncating table: PS_AC_TE_REFRESH
>
>
============================================================================
> =
> However, if I uncomment the "do truncate_the_table"
> statement and let the
> program actually
> issue the "truncate table" command, I get these
> displays.
>
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
> Truncating table: PS_AC_TE_SUMTEMP
>
>
============================================================================
>
> As you can see, it repeats the first table name over
> & over & over.
>
> Anyone know why this is happening?
> As always, your help would be greatly appreciated !!


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/