|Subject||Re: [firebird-support] Copy row to row in stored procedure|
> The only way? Isn't it possible to select the name of fields of the tableYes, that would be possible, but only directly with a INSERT INTO ... SELECT
> from system tables and then build a statement that you can execute in a
> stored procedure?
statement as you cannot have a dynamic number of variables.
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
> -----Original Message-----
> From: email@example.com
> [mailto:firstname.lastname@example.org] On Behalf Of Martijn Tonies
> Sent: 23. mars 2009 14:11
> To: email@example.com
> Subject: Re: [firebird-support] Copy row to row in stored procedure
>>But it is not EASY way:
>>1) There may be many columns in a table.
>>2) Columns may be added or deleted in the future.
>>So maintenance cost of such solution is high,
>>and code readability is low.
> It is, however, the -only- way... Firebird PSQL does not (yet) have
> a "rowtype" variable.
> With regards,
> Martijn Tonies
> Upscene Productions
> Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
> Anywhere, MySQL, InterBase, NexusDB and Firebird!
> Database questions? Check the forum:
> 2009/3/23, Nick Upson <nick.upson@...>:
>> insert into tablea (col1, col2, ...) select col1, col2, ... from tablea
>> 2009/3/23 Valeri Mytinski <valeri.mytinski@...>:
>>> I have to copy one (existing) row to another (new) row in the same
>>> table within stored procedure.
>>> 3 steps needed as I see:
>>> 1. Fetch whole row into "record-like" variable or something else.
>>> 2. Change PK in "variable".
>>> 3. Insert new row with values from "variable".
>>> Do you know easy way(s) for this? Or may be special tools for this
>>> in FB?
> 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