Dynamic Mesaage building - SQL dangling Apostrophe

Hello

I have the problem after... and hoping someone out there can be of assitance.
I inherited a coldfusion application and bugs seem to be always nearby...
The question I have is this:
(1) a SQL query that inserts a line that contains an email msg in a comms audit table and includes the entire html email format
(2) the sql query, however, is defined as follows as attaché
(3) error reports is a SQL one as relates to an apostrophe that hang in the < cfinclude > part of the query (the model creates a message in html format, based on queries etc..)

My question is how to ensure that intergrity of the message and to avoid this error?
I already looked at using 'preservesinglequotes' and cfqueryparam - however without success...

before your query to:
<>
Template = "" #mancbPath #/ mancb_body.cfm ">"

Then use in your query instead of using "".
"#emailmessagebody #

Azadi Saryev
SABAI - Dee.com
http://www.SABAI-Dee.com/

Tags: ColdFusion

Similar Questions

  • The dynamic LOV PL/SQL syntax help

    Hello

    I am trying to create a dynamic lov pl/sql Oracle Apex 3.2 on 11 g. I'm having some trouble with the syntax of the statements below and I would be grateful for any suggestion.
    DECLARE
    BEGIN
    
    IF :p3_current_a_workshop != 0 THEN
    RETURN
    'select distinct workshop_title ||':  '  || presenter_name ||'    $'|| workshop_fee display_value, workshop_id return_value 
    from WORKSHOP
    where session_time = 'A'
    and workshop_status = 'Open'
    or workshop_id = :p3_current_a_workshop
    order by 1';
    
    ELSE
    RETURN
    'select distinct workshop_title ||':  '  || presenter_name ||'    $'|| workshop_fee display_value, workshop_id return_value 
    from WORKSHOP
    where session_time = 'A'
    and workshop_status = 'Open'
    order by 1';
    
    END IF;
    EXCEPTION
            WHEN OTHERS THEN
                HTP.PRN('ERROR'||SQLERRM);          
    END;
    I'm trying to shape the code above out of the example given by apex:
    A function that returns a SQL query with two columns:
    
    IF :MY_ITEM='10' THEN
      RETURN 
      'SELECT ename, empno 
    FROM  emp 
    WHERE depno = 10 
    ORDER BY 1';
    ELSE
      RETURN 
      'SELECT ename, empno 
    FROM emp 
    WHERE depno = :my_item 
    ORDER BY 1';
    END IF;
    ~ Andrew Schultz

    How do you use this procedure?

    You can create and example on apex.oracle.com?

    Lev

    Published by: the January 12, 2011 14:10

  • Design of the dynamic schema through SQL

    Hi all

    Is it possible to design a dynamic schema using SQL?
    Documents or links is greatly appreciated.

    Thank you

    Hello

    Sorry, I don't get you. Design of a scheme is more than dynamic SQL, you must think of tables, relationships, constraints, standardization, etc.. On the dynamic SQL statements, see [using dynamic SQL statements | http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm#CACDDACH]

    Kind regards

  • Performance issues with dynamic action (PL/SQL)

    Hello!


    I have problems of perfomance with dynamic action that is triggered on click of a button.

    I have 5 drop-down lists to select the columns that users want filter, 5 drop-down lists to select an operation and 5 boxes of input values.

    After that, it has a filter button that submits just the page based on the selected filters.

    This part works fine, the data are filtered almost instantly.

    After that, I have 3 selectors 3 boxes where users put the values they wish to update the filtered rows and column

    There is a update button that calls the dynamic action (a procedure which is written below).

    It should be in a straight line, the issue of performance might be the decoding section, because I need to cover the case when the user wants to set a null (@), and when it won't update the 3 columns, but less (he leaves ").

    That's why P99_X_UC1 | ' = decode(' ||) P99_X_UV1 |', "«,» | P99_X_UC1 ||',''@'',null,'|| P99_X_UV1 |')

    However, when I click finally on the button update, my browser freezes and nothing happens on the table.

    Can anyone help me solve this problem and improve the speed of the update?

    Kind regards

    Ivan

    PS The procedure code is below:

    create or replace

    DWP PROCEDURE. PROC_UPD

    (P99_X_UC1 in VARCHAR2,

    P99_X_UV1 in VARCHAR2,

    P99_X_UC2 in VARCHAR2,

    P99_X_UV2 in VARCHAR2,

    P99_X_UC3 in VARCHAR2,

    P99_X_UV3 in VARCHAR2,

    P99_X_COL in VARCHAR2,

    P99_X_O in VARCHAR2,

    P99_X_V in VARCHAR2,

    P99_X_COL2 in VARCHAR2,

    P99_X_O2 in VARCHAR2,

    P99_X_V2 in VARCHAR2,

    P99_X_COL3 in VARCHAR2,

    P99_X_O3 in VARCHAR2,

    P99_X_V3 in VARCHAR2,

    P99_X_COL4 in VARCHAR2,

    P99_X_O4 in VARCHAR2,

    P99_X_V4 in VARCHAR2,

    P99_X_COL5 in VARCHAR2,

    P99_X_O5 in VARCHAR2,

    P99_X_V5 in VARCHAR2,

    P99_X_CD in VARCHAR2,

    P99_X_VD in VARCHAR2

    ) IS

    l_sql_stmt varchar2 (32600);

    nom_table_p varchar2 (30): = ' DWP. IZV_SLOG_DET';

    BEGIN

    l_sql_stmt: = "update". nom_table_p | 'set '.

    || P99_X_UC1 | ' = decode(' ||) P99_X_UV1 |', "«,» | P99_X_UC1 ||',''@'',null,'|| P99_X_UV1 |'),'

    || P99_X_UC2 | ' = decode(' ||) P99_X_UV2 |', "«,» | P99_X_UC2 ||',''@'',null,'|| P99_X_UV2 |'),'

    || P99_X_UC3 | ' = decode(' ||) P99_X_UV3 |', "«,» | P99_X_UC3 ||',''@'',null,'|| P99_X_UV3 |') where ' |

    P99_X_COL | » '|| P99_X_O | » ' || P99_X_V | «and» |

    P99_X_COL2 | » '|| P99_X_O2 | » ' || P99_X_V2 | «and» |

    P99_X_COL3 | » '|| P99_X_O3 | » ' || P99_X_V3 | «and» |

    P99_X_COL4 | » '|| P99_X_O4 | » ' || P99_X_V4 | «and» |

    P99_X_COL5 | » '|| P99_X_O5 | » ' || P99_X_V5 | «and» |

    P99_X_CD |       ' = '         || P99_X_VD;

    -dbms_output.put_line (l_sql_stmt);

    EXECUTE IMMEDIATE l_sql_stmt;

    END;

    Hello Ivan,.

    I don't think that the decoding is relevant performance. Perhaps the update is suspended because another transaction has changes that are uncommitted to any of the affected rows or where clause is not quite selective and has a huge amount of documents to update.

    In addition - and I may be wrong, because I only have a portion of your app - the code here looks like you've got a guy here huge sql injection vulnerability. Perhaps you should consider re - write your logic in the static sql. If this is not possible, you must make sure that the entered user contains only allowed values, for example by P99_X_On white list (i.e. to ensure that they contain only values known as 'is', ')<', ...),="" and="" by="" using="" dbms_assert.enquote_name/enquote_literal="" on="" the="" other="" p99_x_nnn="">

    Kind regards

    Christian

  • Examination of dynamic cursor and SQL performance

    Hello world

    I'm a researcher on internet forums and oracle for what is best for my case.


    I tried to rebuild indexes. I had two methods, both works very well, but I'm looking for which is preferable from the point of view of performance

    1 - the use of cursor as in the link below.

    http://www.think-forward.com/SQL/rebuildunusable.htm


    2 - using dynamic SQL, that generated the script file, then run it.

    coil rebuildall.sql
    Select "change the index ' |" owner: '. ' || index_name |' rebuild online; '
    from dba_indexes where status = "UNUSABLE."
    spool off;

    @rebuildall.sql


    Thanks in advance. Your help is appreciated.

    In both cases, that you use dynamic SQL statements, I think that there is no difference in terms of performance, use the method you feel most comfortable

    In all cases, you can follow the timestamps (time is set on & set timing on) and connect the outputs

    Best regards
    Alfonso Vicente
    www.logos.com.uy

  • dynamic logic in SQL WHERE clause based on the value of the ELEMENT

    Hello

    I have a report based on the following SQL query.
       select dept_no,
           dept_name,
           dept_loc
      from dept
     where dept_loc = :P1_DEPT_LOC
       // If P1_DEPT_LOC is not null, I want the WHERE clause and IF  P1_DEPT_LOC is null, then I don't need the WHERE clause.
       // how can I build this logic in same SQL
    Thank you
    Deepak

    Published by: Deepak_J on March 11, 2010 16:37

    where: P1_DEPT_LOC IS NULL or dept_loc =: P1_DEPT_LOC

    If dept_loc is not null better would be

    where dept_loc = coalesce(:P1_DEPT_LOC,dept_loc)

  • Create education dynamic table in SQL

    Hello

    I am trying to create a table in a select query via a using the dynamic SQL PL/SQL block. This is the query,

    declare
    stmt varchar2 (2000);
    Start
    stmt: = "' CREATE TABLE AS SELECT PATIENT_ID, name FROM employee output" ';
    immediately execute stmt;
    end;
    /

    It throws the following error.

    declare
    *
    ERROR on line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at line 5

    I tried to run the statement without the variable, and it runs very well. I mean

    Start
    run immediately "CREATE TABLE output AS SELECT PATIENT_ID, name OF the employee";
    end;
    /

    works perfectly. Can you please help me with this.

    Thank you

    Hello

    declare
    stmt varchar2(2000);
    begin
    stmt := 'CREATE TABLE output AS SELECT PATIENT_ID, FIRST_NAME FROM employee';
    execute immediate stmt;
    end;
    

    Nothing different from what Anurag has shown above.
    But you will need to consider a few things.
    (1) since it is possible it is not a must to use
    (2) it is considered to be a poor design where in it need to create tables on the fly.
    (3) whether it is absolutely mandatory. If you can give us an idea of your condition. I don't know that the gurus here can give you suggestions
    (4) this kind of design will be will lead you into problems sooner or later for sure

    Kind regards
    Bobin

  • Content of dynamically looped for SQL Insert

    I have a form that is created when a user selects the number of lines they need ultimately to decide on the number of records they will be insert into a SQL database. After there include the information in the form and send it, I have a page that contains the SQL query. I'm looking for at the request of the same number of rows as there are in the table in a loop. However, I can't get the query to run because of double variables. For example in a form simple submission if I had a form called 'Name' text field, it would be to insert in the database "#form.name # If the user has selected 10 lines, I would need to insert each line like "#form.name1 #", "#form.name2 #", etc.. If my variable for the number of lines is 'I' so my whole variable for the loop would be "#form.name #i # ' does not. Hope, it is not too complicated, and any help would be appreciated.

    Who did it! Thank you very much!

  • Build SQL statements for the conversion error

    Hello

    I started a conversion after having dropped any object that has been marked blocking conversion (and refreshed + re-read the database).

    But the conversion fails with:

    DMU conversion error generating SQL.PNG

    Hello

    At the revealid of track that he was opening and closing of session trigger failed.

    I disabled the trigger, and now the conversion has kciked off as expected.

    Thank you.

    BR,

    Kim

  • dynamic replacement using SQL only

    Hello

    File name of table
    CREATE TABLE file_name_table AS
    ( SELECT 'FILE_A_[PATTERN1]_[PETTERN2].txt' AS file_name FROM DUAL
    UNION
    SELECT 'FILE_B_[PATTERN3].txt' FROM DUAL
    UNION
    SELECT 'FILE_B_[PATTERN3]_[PATTERN4].txt' FROM DUAL)
    Table model
    CREATE TABLE pattern_table AS
    ( SELECT '[PATTERN1]' AS pattern, 'P00191' AS pattern_value  FROM DUAL
    UNION
    SELECT '[PATTERN2]' AS pattern, 'P00293' AS pattern_value  FROM DUAL
    UNION
    SELECT '[PATTERN3]' AS pattern, 'p567' AS pattern_value  FROM DUAL
    UNION
    SELECT '[PATTERN4]' AS pattern, 'p879' AS pattern_value  FROM DUAL
    UNION
    SELECT '[PATTERN5]' AS pattern, 'p005' AS pattern_value  FROM DUAL)
    Now I need a vision that will show out follwing
     'FILE_A_P00191_P00293.txt'
     'FILE_B_p567.txt'
     'FILE_B_p567_p879.txt'
    basically the in the output will be the model and the model of filename will be replaced by the value of schema table model. I hope I am clear. Help, please.

    Published by: Mr leroy on May 22, 2013 13:25 - the fixed output.
    select file_name from (
    select
      rn
      ,f file_name
    from
     file_name_table
    ,pattern_table
    where
    instr(file_name, pattern(+)) > 0
    model
    partition by (file_name)
    dimension by (row_number() over (partition by file_name order by pattern) rn)
    measures (file_name f, pattern p, pattern_value pv)
    rules(
    f[rn] order by rn desc =replace(nvl(f[cv()+1],f[cv()]),p[cv(rn)],pv[cv(rn)])
    )
    )
    where rn = 1
    
    FILE_NAME
    "FILE_B_p567_p879.txt"
    "FILE_B_p567.txt"
    "FILE_A_P00191_P00293.txt"
    

    Published by: chris227 on 22.05.2013 03:38
    outer join

  • Build SQL query

    Hello

    I have the following query, which returns the active requests created and closed per year. The question is that I need to accumulate the active requests last year to next year, created, in the end, the assets must be 0. Can anyone help?

    Query:

    SELECT ANO, ABERTOS AS ABERTOS, ONLY, ACTIVOS
    Of
    (SELECT NEW. ANO AS ANO, ABERTOS, ONLY, ABERTOS-ONLY AS ACTIVOS
    (SELECT CAL. AS ANO ANO, / * CRIAÇÃO. KEY_CATALOGO, * / COUNT (*) AS ABERTOS
    of dm_facto_t CRIAÇÃO
    LEFT JOIN DIM_CALENDARIO_T CAL
    ON CRIAÇÃO. KEY_CALENDARIO = CAL. KEY_CALENDARIO
    where key_tipo_facto = 17
    GROUP OF CAL. -ANO, CRIAÇÃO. KEY_CATALOGO
    ORDER BY CAL. NEW YEAR CSA)
    LEFT JOIN)
    SELECT CAL. ANO, / * FECHO. KEY_CATALOGO, * / COUNT (*) AS ONLY
    of dm_facto_t FECHO
    LEFT JOIN DIM_CALENDARIO_T CAL
    ON FECHO. KEY_CALENDARIO = CAL. KEY_CALENDARIO
    where key_tipo_facto = 18
    GROUP OF CAL. -ANO, FECHO. KEY_CATALOGO
    ORDER BY CAL. FECHOS ANO CSA)
    ON NEW. ANO = FECHOS. ANO);

    Result


    Year active closed established
    2008 1477 1452 25
    2009 1933 1684 249
    4270 4187 2010 - 83
    4086 3895 2011 - 191

    Thank you!
    with t as ( select 2008 yr, 25 active from dual union all
                    select 2009, 249 from dual union all
                    select 2010, -83 from dual union all
                    select 2011, -191 from dual )
      select t.*, sum(active) over (order by yr) running_total  from t
    
    YR     ACTIVE     RUNNING_TOTAL
    2008     25     25
    2009     249     274
    2010     -83     191
    2011     -191     0
    
  • SQL dynamic stored procedure call

    I want to run the following command (which I build dynamically) to pl/sql, stored procedure, but I get the error message
    How can I run this command from pl/sql after I built it dynamically?


    exec RESEND_MISSING_UFMS (June 5, 13 04.00.00.000000000 AM ', June 6, 13 04.00.00.000000000 AM', 'VPS'); < < works very well on the sql prompt.


    create or replace procedure tranhost.ufm_resubmit
    AS
    v_time1 varchar2 (50);
    v_time2 varchar2 (50);
    cmd_str1 varchar2 (100);
    cmd_str2 varchar2 (100);

    BEGIN
    Select to_char (sysdate-1,' MON-JJ-AA "") in the double v_time1;
    Select to_char(sysdate,'DD-MON-YY') in the double v_time2;

    -next fails with ORA-00900: invalid sql statement.

    immediately run "exec RESEND_MISSING_UFMS('''||) v_time1 | "04.00.00.000000000 AM","' | v_time2 | ("04.00.00.000000000 AM VPS",""); " ;

    END;
    /
    CREATE OR REPLACE PROCEDURE tranhost.ufm_resubmit
    AS
       v_time1    VARCHAR2 (50);
       v_time2    VARCHAR2 (50);
       cmd_str1   VARCHAR2 (100);
       cmd_str2   VARCHAR2 (100);
       var_sql    VARCHAR2 (300);
    BEGIN
       SELECT TO_CHAR (SYSDATE - 1, 'DD-MON-YY')
         INTO v_time1
         FROM DUAL;
    
       SELECT TO_CHAR (SYSDATE, 'DD-MON-YY')
         INTO v_time2
         FROM DUAL;
    
    -- follownig fails with ORA-00900: invalid sql statement .
       var_sql :=
             'BEGIN RESEND_MISSING_UFMS('''
          || v_time1
          || ' 04.00.00.000000000 AM'','''
          || v_time2
          || ' 04.00.00.000000000 AM'',''VPS''); END;';
       DBMS_OUTPUT.put_line (' Block :' || var_sql);
    
       EXECUTE IMMEDIATE var_sql;
    END;
    
  • Use Dynamic Actions with pl/sql, calling a javascript alert function

    Hello

    I use Apex 4.0.1.00.03 with IE7.

    The problem I have is:

    I am converting an Oracle Forms application that has a lot of logic in it. In the application forms, it is a pl/sql function, based on a If/else condition call a popup alert box, which displays a warning message. He called pl/sql functions that return raising to the IF statement.

    Example of pl/sql code:

    If check_records() > 0 Then
    message to the alert box
    ElsIf TypeA_record then
    message to the alert box
    On the other
    message to the alert box
    End If;

    I need to replicate this functionality to the Apex 4. I tried to create dynamic Action on a page element, using a pl/sql function, however, when I call the popup javascript, this code not popup an alert box. I need the pl/sql to be run when the element of the page changes, not when the page is sent.

    The code I used to test the pl/sql code, which does not work in dynamic Actions > pl/sql is:

    Begin
    HTP.p ("< script type =" text/javascript"> '");
    HTP.p ("alert ("today runs javascript code!");"
    );
    HTP.p ("< /script >");
    End;

    I need to create a pl/sql function that can do alert areas based on an IF condition.

    Could someone point me in the right direction? Using dynamic shares the best way forward? I need to trigger on a page element, change the value.

    Works fine now.
    In the javascript code, I changed:

    get.addParam ('x 01', $v ('P105_PREP_TYPE'));

    by

    get.addParam ('x 01', $v ('P1_PREP_TYPE'));

    P1_PREP_TYPE is the correct name of the element.
    Now when I choose the OTHER, 1 message.

    Concerning

  • dynamic sql cursor

    Hi all


    How can I use a dynamic cursor in sql.


    Thank you
    Concerning

    Hitesh

    http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a96109/pco09dyn.htm

  • Tables created in a stored procedure cannot be used with dynamic SQL? The impact?

    There is a thread on the forum which explains how to create tables within a stored procedure (How to create a table in a stored procedure , however, it does create a table as such, but not how to use it (insert, select, update, etc.) the table in the stored procedure.) Looking around and in the light of the tests, it seems that you need to use dynamic SQL statements to execute ddl in a stored procedure in Oracle DB. In addition, it also seems that you cannot use dynamic SQL statements for reuse (insert, select, update, etc.) the table that was created in the stored procedure? Is this really the case?

    If this is the case, I am afraid that if tables cannot be 'created and used"in a stored procedure using the dynamic SQL, as is the case with most of the servers of DB dynamic SQL is not a part of the implementation plan and, therefore, is quite expensive (slow). This is the case with Oracle, and if yes what is the performance impact? (Apparently, with Informix, yield loss is about 3 - 4 times, MS SQL - 4 - 5 times and so on).

    In summary, tables created within a stored procedure cannot be 'used' with dynamic SQL, and if so, what is the impact of performance as such?

    Thank you and best regards,
    Amedeo.

    Published by: AGF on March 17, 2009 10:51

    AGF says:
    Hi, Frank.

    Thank you for your response. I understand that the dynamic SQL is required in this context.

    Unfortunately, I am yet to discover "that seeks to" using temporary tables inside stored procedures. I'm helping a migration from MySQL to Oracle DB, and this was one of the dilemmas encountered. I'll post what is the attempt, when more.

    In Oracle, we use [global temporary Tables | http://www.psoug.org/reference/OLD/gtt.html?PHPSESSID=67b3adaeaf970906c5e037b23ed380c2] aka TWG these tables need only be created once everything like a normal table, but they act differently when they are used. The data inserted in TWG will be visible at the session that inserted data, allowing you to use the table for their own temporary needs while not collide with them of all sessions. The data of the TWG will be automatically deleted (if not deleted programmatically) when a) a commit is issued or b) the session ends according to the parameter that is used during the creation of the TWG. There is no real need in Oracle to create tables dynamically in code.

    I noticed that many people say that the "Creation of the tables within a stored procedure" is not a good idea, but nobody seems necessarily explain why? Think you could elaborate a little bit? Would be appreciated.

    The main reason is that when you come to compile PL/SQL code on the database, all explicit references to tables in the code must correspond to an existing table, otherwise a djab error will occur. This is necessary so that Oracle can validate the columns that are referenced, the data types of those columns etc.. These compilation controls are an important element to ensure that the compiled code is as error free as possible (there is no accounting for the logic of programmers though ;)).

    If you start to create tables dynamically in your PL/SQL code, so any time you want to reference this table you must ensure that you write your SQL queries dynamically too. Once you start doing this, then Oracle will not be able to validate your SQL syntax, check the types of data or SQL logic. This makes your code more difficult to write and harder to debug, because inevitably it contains errors. It also means that for example if you want to write a simple query to get that one out in a variable value (which would take a single line of SQL with static tables), you end up writing a dynamic slider all for her. Very heavy and very messy. You also get the situation in which, if you create tables dynamically in the code, you are also likely to drop tables dynamically in code. If it is a fixed table name, then in an environment multi-user, you get in a mess well when different user sessions are trying to determine if the table exists already or is the last one to use so they can drop etc. What headache! If you create tables with table names, then variable Dynamics not only make you a lot end up creating (and falling) of objects on the database, which can cause an overload on the update of the data dictionary, but how can ensure you that you clean the tables, if your code has an exception any. Indeed, you'll find yourself with redundant tables lying around on your database, may contain sensitive data that should be removed.

    With the TWG, you have none of these issues.

    Also, what is the impact on the performance of the dynamic SQL statements in Oracle? I read some contrasting opinions, some indicating that it is not a lot of difference between static SQL and SQL dynamic in more recent versions of Oracle DB (Re: why dynamic sql is slower than static sql is this true?)

    When the query runs on the database, there will be no difference in performance because it is just a request for enforcement in the SQL engine. Performance problems may occur if your dynamic query is not binding variable in the query correctly (because this would cause difficult analysis of the query rather than sweet), and also the extra time, to dynamically write the query running.

    Another risk of dynamic query is SQL injection which may result in a security risk on the database.

    Good programming will have little need for the tables of dynamically created dynamically or SQL.

Maybe you are looking for

  • Satellite L755 - failures of recovery appeared in audit mode

    Chess appeared in audit mode in the 4 DVDs + environment (DVD 5) made 2 attempts throughout the DVD s, all DVDs have folders and files stored on it.no more impressed with a machine which is only 2 weeks, I could take a chance and guess the stuff on t

  • Format NSV URL has changed!

    In LV2010, it seems that you now have to include the prefix psp Example: NI.var .psp://crio-hpu1/hpu System Parameters/HPIM.HE_PID_Kc where previously it was acceptable to just have: cRIO-HPU1/HPU System Parameters/HPIM.HE_PID_Kc Does anyone know whe

  • Problem very easy propably

    I use a updated the "TCP Communicator - active" in examples of Labview to communicate with an Ethernet device. Works fine but I want to use it as a Sub Vi since it will be a much larger part of a system. This is where my problem is. Chain control is

  • Whenever I try to delete files from my USB, the message saying that you can not delete the file, the disk is write protected

    original title: write protection Whenever I try to delete files from my USB, the message saying that you can not delete the file, the disc is write protected is displayed. What I can do to undo the write protection?

  • Failure of geolocation BB10 Simulator

    I'm trying to get the current location with navigator.geolocation.getCurrentPosition, but it keeps failing. Location services are turned on. I get this error PositionError {code: 2, message: "Manager offline", POSITION_UNAVAILABLE: 2, PERMISSION_DENI