Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
Dynamic statement to fill temp table in dbproc

Dynamic statement to fill temp table in dbproc

2007-06-15       - By Elke Schmidtke

 Back
Hi,

in my procedure I want to fill a temporary table with a select statement that
is dynamic build.
But executing the dynamic statement produces the error:
General error;-9111 ABGL1 Unknown table name:TT_STAT_ABGL

Using 7.5.0.19

CREATE DBPROC PROC_STATISTIK_ABGLEICH
  (IN SANR INT, IN STICHTAG DATE, IN STATISTIK VARCHAR(255), IN BEARBEITER
VARCHAR(120),
  IN NUTZERID INT, IN SCHULEN VARCHAR(800))
AS
VAR
SEL VARCHAR(1000);
...

DROP TABLE TEMP.TT_STAT_ABGL;
TRY
  CREATE TABLE TEMP.TT_STAT_ABGL (
    PERS_NR INT,
    SCHULE INT,
    STUNDEN FIXED(5,2));
  CATCH
    STOP  ($RC, 'ABGL0 ' & $ERRMSG);

SET SEL =   'INSERT INTO TEMP.TT_STAT_ABGL (PERS_NR, SCHULE) ' ||
    'SELECT PERS_NR, SCHUL_ID FROM T_DBV ' ||
    'WHERE BEGINN <= ''' || STICHTAG || ''' AND ''' || STICHTAG || ''' <= ENDE '
||
    'AND SCHUL_ID IN (';
IF SCHULEN = '' THEN
  SET SEL = SEL || 'SELECT SCHUL_ID FROM DBA.T_SCHULE WHERE SCHULAMT_NR=' ||
SANR || ')'
ELSE
  SET SEL = SEL || SCHULEN || ')';
TRY
  EXECUTE SEL;
CATCH
   STOP ($RC, 'ABGL1 ' & $ERRMSG);


Any help ?
Elke


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/maxdb?unsub=mysql@(protected)