Jump to content
  • 0

Searching this query...


Jimmermania

Question

  • VIP

hello guys, can anyone tell me how can i do this query ? for every vnum of table item_proto which exists on table item_proto_translated replace the locale_name from the translated proto to item_proto.

Link to post

8 answers to this question

Recommended Posts

  • 0

ah okay

 

 

Spoiler

update item_proto set locale_name=(select locale_name from item_proto_translated where vnum=item_proto.vnum);

 

Edited by iMerv3
  • Love 1
Link to post
  • 0
  • VIP
1 hour ago, iMerv3 said:
  Hide contents

update item_proto set locale_name=(select locale_name from item_proto_translated where vnum=item_proto.vnum);

 

Thanks man... when i run it , it says: Column 'locale_name' cannot be null

Link to post
  • 0

The error is clearly understable. But whatever run this

Spoiler

update item_proto_translated set locale_name="noname" where locale_name='';

 

  • Love 1
Link to post
  • 0
  • VIP
12 minutes ago, iMerv3 said:

The error is clearly understable. But whatever run this

  Hide contents

update item_proto_translated set locale_name="noname" where locale_name='';

 

I removed NOT NULL from item_proto and your first query worked.

This error , i think it was because some vnums from item_proto , does not exist on item_proto translated.

 

How can i fix it with query to go to next vnum that exists? i mean, to search ONLY the vnums which exist on both table. If the vnum does not exist on one or other table, move to other vnum

Link to post
  • 0

ah okay

Spoiler

update item_proto set locale_name=coalesce((select locale_name from item_proto_translated where vnum=item_proto .vnum), 'noname');


 

Edited by iMerv3
  • Love 1
Link to post
  • 0
  • VIP
12 minutes ago, iMerv3 said:

ah okay

  Hide contents

update item_proto set locale_name=coalesce((select locale_name from item_proto_translated where vnum=item_proto .vnum), 'noname');


 

this put "noname" at the vnums which not exist. how can i leave them like they are ? i mean not translated and without noname? sorry...

Link to post
  • 0

😀

Spoiler

update item_proto set locale_name=coalesce((select locale_name from item_proto_translated where vnum=item_proto .vnum), item_proto.locale_name);

 

  • Love 1
Link to post
  • 0
  • VIP
16 minutes ago, iMerv3 said:

😀

  Hide contents

update item_proto set locale_name=coalesce((select locale_name from item_proto_translated where vnum=item_proto .vnum), item_proto.locale_name);

 

Thats it... thanks a lot for your time man. Appreciate it.

Link to post
Guest
This topic is now closed to further replies.


Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.