RE: [sqlite] Trigger on Attached Database

2007-06-22 Thread Marc Ruff
Try to create a TEMPorary trigger after the ATTACH command.

Regards
Marc

>Is it possible to do this:
>
>   Open DB1
>
>   Attatch DB2
>
>
>In DB1 have a trigger that does
>
>  Insert into DB2. ?
>
>Theoretically it seems possible but we couldn't get it to work. Before I
>investigate further just want to know if it is possible
>
>Thanks.



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



AW: [sqlite] Trigger on Attached Database

2007-06-21 Thread Marc Ruff
Just forgot to mention:
Referencing in previous open/attached databases should also be possible with
foreign key constraints, when they will be enforced...

Marc

On Thu, 2007-06-21 at 11:57 +0200, Andre du Plessis wrote:
>> Is it possible to do this:
>> 
>>Open DB1
>> 
>>Attatch DB2
>> 
>> In DB1 have a trigger that does
>> 
>>   Insert into DB2. ?
>> 
>> Theoretically it seems possible but we couldn't get it to work. Before I
>> investigate further just want to know if it is possible

>No. A trigger may only reference objects in it's own database.
>You should be getting an error message along the lines of
>"cannot reference object in database XXX" when you create
>the trigger.
>
>Dan.
>

It would be very helpful to have the possibility creating a trigger in DB2
referencing DB1.
"Open DB1"
"Attach DB2" (DB2 has trigger: "Insert into DB1")

Of course, if just
"Open DB2" (DB2 has trigger: "Insert into DB1")
This would give an error.

Marc



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Trigger on Attached Database

2007-06-21 Thread Marc Ruff


On Thu, 2007-06-21 at 11:57 +0200, Andre du Plessis wrote:
>> Is it possible to do this:
>> 
>>Open DB1
>> 
>>Attatch DB2
>> 
>> In DB1 have a trigger that does
>> 
>>   Insert into DB2. ?
>> 
>> Theoretically it seems possible but we couldn't get it to work. Before I
>> investigate further just want to know if it is possible

>No. A trigger may only reference objects in it's own database.
>You should be getting an error message along the lines of
>"cannot reference object in database XXX" when you create
>the trigger.
>
>Dan.
>

It would be very helpful to have the possibility creating a trigger in DB2
referencing DB1.
"Open DB1"
"Attach DB2" (DB2 has trigger: "Insert into DB1")

Of course, if just
"Open DB2" (DB2 has trigger: "Insert into DB1")
This would give an error.

Marc




-
To unsubscribe, send email to [EMAIL PROTECTED]

-



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Trigger on Attached Database

2007-06-21 Thread Dan Kennedy
On Thu, 2007-06-21 at 11:57 +0200, Andre du Plessis wrote:
> Is it possible to do this:
> 
>  
> 
>Open DB1
> 
>Attatch DB2
> 
>  
> 
> 
> 
> In DB1 have a trigger that does
> 
>   Insert into DB2. ?
> 
>  
> 
> 
> 
> Theoretically it seems possible but we couldn't get it to work. Before I
> investigate further just want to know if it is possible

No. A trigger may only reference objects in it's own database.
You should be getting an error message along the lines of
"cannot reference object in database XXX" when you create
the trigger.

Dan.





-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Trigger on Attached Database

2007-06-21 Thread Andre du Plessis
Is it possible to do this:

 

   Open DB1

   Attatch DB2

 

 

In DB1 have a trigger that does

  Insert into DB2. ?

 

 

Theoretically it seems possible but we couldn't get it to work. Before I
investigate further just want to know if it is possible

 

Thanks.