SqlDbx
You are not logged in.
Pages: 1
How can i run a do $$ block in sqldbx acessing a postgres database?
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
Currently anonymous code blocks are not supported.
Will be available in the next release.
Offline
Do you know when this new release will be avaliable?
Offline
Solved in version 6.01.
Thanks
Offline
Pages: 1