Subject | Re: [firebird-support] Copy row to row in stored procedure |
---|---|
Author | Martijn Tonies |
Post date | 2009-03-23T13:11:05Z |
Hi,
a "rowtype" variable.
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
2009/3/23, Nick Upson <nick.upson@...>:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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
>But it is not EASY way:It is, however, the -only- way... Firebird PSQL does not (yet) have
>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.
a "rowtype" variable.
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
2009/3/23, Nick Upson <nick.upson@...>:
> insert into tablea (col1, col2, ...) select col1, col2, ... from tablea------------------------------------
> where
>
> 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 exists
>> 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
>>
>>
>>
>>
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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