Him

What is your current RDBMS and are these SQL the ones used in RDBMS?

Have you tried them on Hive?

HTH

Dr Mich Talebzadeh



LinkedIn * 
https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*



http://talebzadehmich.wordpress.com


*Disclaimer:* Use it at your own risk. Any and all responsibility for any
loss, damage or destruction of data or any other property which may arise
from relying on this email's technical content is explicitly disclaimed.
The author will in no case be liable for any monetary damages arising from
such loss, damage or destruction.



On 25 August 2016 at 06:56, Priyanka Raghuvanshi <[email protected]>
wrote:

> Hi  Dr Mich,
>
>
> Thank you for replying.
>
>
> Yes, while creating the table, transactional property has been set as
> true, same implies to other tables.
>
>
> Following in are SQL update query example, same I want to achieve through
> HQL:
>
>
> 1)
>
> UPDATE table1
> SET FAging=t2.FAging,
> PaymentR=t2.PaymentR,
> ArrearsO=t2.ArrearsO ,
> IRemaining=t2.IRemaining,
> Taxi_Association=t2.TaxiAssociation
> From table2 t2
> Left JOIN table1  t1
> ON t2.AccNum COLLATE DATABASE_DEFAULT= t1.AccNo COLLATE DATABASE_DEFAULT
>
> 2)
>
> UPDATE table1
> SET Img_String=CASE WHEN convert(nvarchar,T1.dTimeStamp,103)=Convert(
> nvarchar,getdate(),103) AND T1.Speed>0 then
> isnull(T2.clmn1,'Other') +';Moving;'+ISNULL(T2.PinsStatus,'Performing')
> +';'+CASE WHEN ISNULL(T2.SupplierName,'New') LIKE '%Repo%' THEN
> 'Refurbished' ELSE 'New' END
> ELSE
> isnull(T2.clmn1,'Other') +';Non Moving;'+ISNULL(VEH.PinsStatus
> ,'Performing')+';'+CASE WHEN ISNULL(T2.SupplierName,'New') LIKE '%Repo%'
> THEN 'Refurbished' ELSE 'New' END
> END,
> Moving_or_NonMoving =CASE WHEN convert(nvarchar,T1.dTimeStamp,103)=Convert
> (nvarchar,getdate(),103) AND T1.Speed>0 then
> 'Moving'
> ELSE
> 'Non Moving'
> END,
> InfoWindow= CAST (T1.dTimeStamp as NVARCHAR(20)) + ' <br/> ' + [Address]
> +' @ ' +  cast(T1.Speed as nvarchar) + ' KMPH ['+  isnull(T1.AccountNo,'')
> +'];'+ isnull(T2.ChassisNumber,'') +';'+ isnull(replace(T2.OwnerName,'''','')
> ,'')  +';'+ isnull(T2.clmn1,''),
> Status=T2.PinsStatus
>
> FROM table2 T2
> INNER JOIN table1 T1 on T2.AcqNum=T1.AccoNo
>
> Priyanka Raghuvanshi
> ------------------------------
> *From:* Mich Talebzadeh <[email protected]>
> *Sent:* 24 August 2016 22:02:58
> *To:* user
> *Subject:* Re: Fw: Hive update operation
>
> have the underlying table to be updated been defined as transactional?
>
> can you give the update example?
>
> Dr Mich Talebzadeh
>
>
>
> LinkedIn * 
> https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
> <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*
>
>
>
> http://talebzadehmich.wordpress.com
>
>
> *Disclaimer:* Use it at your own risk. Any and all responsibility for any
> loss, damage or destruction of data or any other property which may arise
> from relying on this email's technical content is explicitly disclaimed.
> The author will in no case be liable for any monetary damages arising from
> such loss, damage or destruction.
>
>
>
> On 24 August 2016 at 14:50, Priyanka Raghuvanshi <[email protected]>
> wrote:
>
>>
>>
>>
>> ------------------------------
>> *From:* Priyanka Raghuvanshi
>> *Sent:* 24 August 2016 19:12
>> *To:* [email protected]
>> *Subject:* Hive update operation
>>
>>
>> Hi,
>>
>>
>> Is it possible to update a table(ORC) using join or column of another
>> table(ORC)?
>>
>>
>> Kind Regards,
>>
>> Priyanka Raghuvanshi
>>
>
>

Reply via email to