English > Scripts and Templates

Some usefull SQL scripts in PVD

(1/1)

VVV_Easy_Programing:
Hello,
there are sometimes that the script is not a good tool for arrange PVD. Happily we have the possibility of use SQL scripts.

First you must start  PVD in Debug Mode (viddb.exe -debug) and then you have in Menu->Help->SQL where you can run a SQL Script (tick the box if the script have several lines).

I publish two examples easy to understand:
1) Now I have problems with IMDB[EN] and the original title (give me a false string 'var ....'). I can solve easily the problem running:
                  update MOVIES set "origtitle"="title" where "origtitle"='var ue_t0=window.ue_t0||+new Date();';
or
                  update MOVIES set "origtitle"="title" where SUBSTR("origtitle",1,3) = 'var';

2) Some strange chars appears in the people IMDB url. I use:
                  update PEOPLE set "url"=replace("url",'?ref_=tt_ov_dr', '/');
                  update PEOPLE set "url"=replace("url",'?ref_=tt_ov_wr', '/');

I anime to all to publish here their own SQL scripts for PVD.

Ivek23:
Use this SQL script if you are missing this part in the imdb url: www.


--- Quote ---update MOVIES set "url"=replace("url",'http://imdb', 'http://www.imdb');
--- End quote ---

Instructions on how to use the SQL script are in the first post.

Here you have some more similar SQL scripts.


--- Quote ---update MOVIES set "url"=replace("url",'http://httpbin.org/response-headers?key=http://www.imdb', 'http://www.imdb');
--- End quote ---


--- Quote ---update MOVIES set "url"=replace("url",'http://httpbin.org/response-headers?key=https://', 'http://');
--- End quote ---


--- Quote ---update MOVIES set "url"=replace("url",'http://httpbin.org/response-headers?key=', '');
--- End quote ---

afrocuban:
I have this problem with some urls from the times IMDb script wasn't updated for a long time before _2b:



--- Code: ---http://www.imdb.comhttps://www.imdb.com
--- End code ---


So I guess this should help?



--- Code: ---update MOVIES set "url"=replace("url",'http://www.imdb.comhttps://www.imdb.com', 'https://www.imdb.com');
--- End code ---

afrocuban:
Related to http://www.videodb.info/forum_en/index.php/topic,4134.msg21969.html#msg21969

The query has to be

--- Code: ---update PEOPLE set "url"=replace("url",'http://imdb', 'http://www.imdb');
--- End code ---

Ivek23:

--- Quote from: afrocuban on December 22, 2023, 11:20:10 pm ---Related to http://www.videodb.info/forum_en/index.php/topic,4134.msg21969.html#msg21969

The query has to be

--- Code: ---update PEOPLE set "url"=replace("url",'http://imdb', 'http://www.imdb');
--- End code ---

--- End quote ---

Of course, I just gave the movies as an example, but you can decide for yourself what you need it for.

Navigation

[0] Message Index

Go to full version