SqlDbx Forum

SqlDbx

You are not logged in.

#1 2019-02-07 14:05:26

NorthWind
Member

Problem with do $$ block

How can i run a do $$ block in sqldbx acessing a postgres database?

Example wrote:

DO $$
    DECLARE r record;
    DECLARE i integer;

    DECLARE __iStartYear integer;
    DECLARE __iStartMonth integer;

    DECLARE __iEndYear integer;
    DECLARE __iEndMonth integer;

    DECLARE __mytext character varying(200);
BEGIN
    i:= 5;

    --RAISE NOTICE  'test'
    --RAISE NOTICE  'test1' || 'test2';

    __mytext := 'Test message';
    --RAISE NOTICE __mytext;
    RAISE NOTICE '%', __mytext;
    RAISE NOTICE '% %', 'arg1', 'arg2';

    --SQL Standard:  "CAST( value AS text )" [or varchar]
    --PostgreSQL short-hand:  "value::text"
    __mytext := 'Test ' || i::text;
    RAISE NOTICE '%', __mytext;

    __mytext := 'mynumber: ' || CAST(i as varchar(33)) || '%';
    RAISE NOTICE '%', __mytext;

    __iStartYear := 2012;
    __iStartMonth := 4;

    __iEndYear := 2016;
    __iEndMonth := 1;

    --PERFORM  'abc';
    SELECT 'abc';

    -- SELECT  __iStartMonth AS TheRunningMonth;


    -- RAISE NOTICE  'The raise_test() function began.' + CAST( i AS text ) ;
    -- FOR r IN SELECT table_schema, table_name FROM information_schema.tables WHERE table_type = 'VIEW' AND table_schema = 'public'
    -- LOOP
    --  EXECUTE 'GRANT ALL ON ' || quote_ident(r.table_schema) || '.' || quote_ident(r.table_name) || ' TO webuser';
    --END LOOP;
END$$;

Offline

#2 2019-02-10 23:36:52

sqldbxhelp
Administrator

Re: Problem with do $$ block

Currently anonymous code blocks are not supported.
Will be available in the next release.

Offline

#3 2019-02-11 17:28:08

NorthWind
Member

Re: Problem with do $$ block

Do you know when this new release will be avaliable?

Offline

#4 2019-02-25 07:58:20

NorthWind
Member

Re: Problem with do $$ block

Solved in version 6.01.

Thanks

Offline

Board footer

Powered by FluxBB