ORA-01756: City channel

Hello
I try to have something like:

ALTER DATABASE DATAFILE 'm:\bases\mydb\data\amapp.dbf' SIZE 335544320;

But:
SQL> select 'ALTER DATABASE DATAFILE '||name,'' RESIZE'||bytes';' from v$datafile;
ERROR:
ORA-01756: quoted string not properly terminated


SQL> select 'ALTER DATABASE DATAFILE '||name,' RESIZE'||bytes';' from v$datafile;
select 'ALTER DATABASE DATAFILE '||name,' RESIZE'||bytes';' from v$datafile
                                                        *
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
Can anyone help?

Thank you.

>
"ALTER DATABASE DATAFILE ' | name, "RESIZE" | bytes ';' v $ datafile
>
Try

'ALTER DATABASE DATAFILE ''' || name || ''' RESIZE ' || bytes || ';' FROM V$DATAFILE

Tags: Database

Similar Questions

  • ORA-01756: city not properly finished chain

    Hello

    I have try this sql statement:

    INSERT INTO orders (Order_Id, short_description, description) VALUES ("1122, 'P29384', ' 50% discount Playin'TV for 1st 3 months");

    I got this error:

    ORA-01756: city not properly finished chain

    I know that it is because there is already a string in quotes in the text, I try to insert. However, how can I insert in my table with that '?

    Two ways...

    double quote the quotation marks in the string:

    INSERT INTO orders (Order_Id,short_description,description) VALUES(1122, 'P29384', '50% Off Playin''TV For 1st 3 Mths');
    

    Or use Q strings:

    INSERT INTO orders (Order_Id,short_description,description) VALUES(1122, 'P29384', q'[50% Off Playin'TV For 1st 3 Mths]');
    
  • Oracle/PLSQL: Error ORA-01756

    Hello

    I'm new to PL/SQL and my script keeps ORA-01756, not finished string. Here is the code:

    DECLARE
    query_str VARCHAR2 (60);
    BEGIN
    plsql_block: = ' SELECT ' grant execute on | object_name | "to dummy_user;"
    From user_objects
    WHERE type_objet = 'PACKAGE '.
    Query_str EXECUTE IMMEDIATE
    END;

    I want this implementation in DBSM_SCHEDULER WORK, but he constantly Gets the error.

    If I ran is separately as:
    ' SELECT ' grant execute on | object_name | "to dummy_user;"
    From user_objects
    WHERE type_objet = 'PACKAGE '.

    There's no problem.

    Can someone give me advice or recommendation which is exactly the problem.
    I would be really grateful for some assistance :)

    Kind regards
    Emil Bolokanov

    Hello

    >
    SELECT "grant execute on | object_name | "to dummy_user;"
    From user_objects
    WHERE type_objet = 'PROCEDURE '.
    >

    This is for change

    SELECT 'grant execute on ' || object_name || ' to dummy_user'
    FROM user_objects
    WHERE object_type = 'PROCEDURE';
    

    To run it

    Just type

    exec NEW_1 ('aa');

    This should be good for you. As there is an already available dummy_user.

    see you soon

    VT

  • PACKAGE BODY APPS. AD_ZD_ADOP contains errors

    APP TIER - Linux - SLES 11 - SP2 - x86_64

    DB LEVEL - Linux for system Z - SLES 11 - SP2 - s390

    I encounter errors in the body to Package APPS. AD_ZD_ADOP, that has brought all the patches to a status quo on our schedule instance.

    The sequence of events have been

    The following hotfixes have been applied.

    1. Patch 19462638
    2. Patch 19197270
    3. Patch 21132723
    4. 19330775
    5. 20677045
    6. 19259764

    Doc 1617461.1 was followed - B path of

    After Patch 19259764 has been applied, all steps until step 8 of Doc 1617461.1 have been completed.

    Failure of the fs_clone step (step 9). My colleague opened a SR - advice was far from expected.

    Yesterday, I took this with success and more cloned the fix for the file system to perform file system (1383621.1) - however, I'm still not able to run fs_clone with success.

    Even a basic ADADMIN session fails.

    Here are the errors while trying to compile APPS package bodies. AD_ZD_ADOP

    SQL > alter package APPS. AD_ZD_ADOP compile body;

    WARNING: The bodies of Package modified with compilation errors.

    SQL > show errors;
    Errors for BODY of PACKAGE applications. AD_ZD_ADOP:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    2503/3 PL/SQL: statement ignored
    2503/7 PLS-00201: identifier ' SYS. DBMS_METADATA_UTIL' must be declared
    SQL >

    Also while trying to launch ADADMIN, I get errors themselves.

    Error of Administration AD:

    ORA-04063: package body "APPS. AD_ZD_ADOP"contains errors

    Could not insert the record of the action in the table of patches

    Error of Administration AD:

    Error when you try to insert adadmin task CMP_INVALID action

    Update running adadmin of failure actions

    Error of Administration AD:

    The following ORACLE error:

    ORA-01756: city not properly finished chain

    occurred while executing the SQL statement:

    UPDATE ad_adop_session_patches set status = 'F' where status = 'R' and

    as numero_de_bogue ' ADADMIN

    Error of Administration AD:

    Table ad_adop_session_patches update errors

    You must check the file

    /U02/fs_ne/EBSapps/log/ADadmin/log/ADadmin.log

    to find errors.

    Can someone please. I have also a SR - but nice try various channels to find a solution.

    Hello

    The necessary subsidies on the SYS package may be missing. DBMS_METADATA_UTIL.

    Try this command (as sysdba) and compile the package:

    Grant execute on SYS. DBMS_METADATA_UTIL applications;

    Kind regards

    Bashar

  • How to search for strings of characters defined, including accents in sqlplus?

    Hello

    the task is to find all the entries in the table produced in coloumn txtvi [defined as: VARCHAR2 (40 BYTE)] where the chain consists not only of these characters:

    -_ #., 0 - 9 a - za - zaouaou)

    The result set should be stored with characters that are not allowed.

    Example "Ziel/result" is not allowed; the "/" is not in the above defined characters

    DB-Version: 10.2.0.4.0

    NLS settings have the value:

    NLS_LANGUAGE AMERICAN

    NLS_CHARACTERSET UTF8

    First attempt was to use regular expressions in sqlplus:

    Select txtvi from product including the no regexp_like (txtvi,'^ [-_ #., 0 - 9 a - za - zaouaou ()] + $') order of txtvi.

    All combinations in the regexp_like has not given the correct result. As a result all games I found permits strings with accents.

    That would be the problem?

    Now, I started to watch all the channels with the German umlaut 'a' only.

    I've known that there are several titles with 'a '. An example: '% Fahrgastzahler % '.

    I started sqlplus in shell Korn on AIX 6.1 ($nls_lang = AMERICAN_AMERICA. UTF8)

    to find all strings containing a German umlaut:

    SQL > select txtvi from product where txtvi like '% a % ';

    ERROR:

    ORA-01756: city not properly finished chain

    I thought to do a simpler test:

    SQL > select 'a' twice.

    ERROR:

    ORA-01756: city not properly finished chain

    With 'o'.

    SQL > select 'o' double;

    '

    -

    o

    With

    SQL > select text product where the text like "% number % ';

    TXTVI

    ----------------------------------------

    Fahrgastzahlung #27N0

    Investigation Fahrgastzahler

    Great, there is a result. But it is not a solution. I'll find all rows with accents.

    Why is there an error ora-01756? I get the same error with the German ss, but u works as o.

    Only a problem in point 10.2?

    A test more in DB-Version: 11.2.0.3.0 with NLS_CHARACTERSET AL32UTF8

    and sqlplus ($nls_lang = AMERICAN_AMERICA. UTF8)

    SQL > select 'o' double;

    '�'

    ---------

    is

    SQL > select 'a' twice.

    ERROR:

    ORA-01756: city not properly finished chain

    No possible use of sqldeveloper:

    The sqldeveloper on a Win7 customer were not properly demonstrating accents. Results of German umlauts are empty every time.

    Yes, there is a problem with accents.

    Any idea how this problem can be solved?

    My suspicions were confirmed. The result of DUMPING indicates that problematic content is encoded in WE8ISO8859P1/WE8MSWIN1252 and not in UTF8, as it should. You see that the binary code of 'u' is 0xFC and for "O" 0xD6. Here's the WE8ISO8859P1/WE8MSWIN1252 codes, not UTF8 codes.

    Similarly, the test with "od" shows the code for "o" as 0xF6 on your terminal. It is, once again, a code WE8ISO8859P1/WE8MSWIN1252 and not UTF8 code, so the value of NLS_LANG is incorrect. Character set NLS_LANG must match the source of data, not the database character set. You correctly see the umlauts on the screen, because the screen is configured to WE8ISO8859P1 or WE8MSWIN1252 and these codes are retrieved not converted (NLS_LANG = DB charset).

    You should:

    1 recode your data to the right encoding, for example with the UPDATE tab1 SET col1 = CONVERT(col1,'UTF8','WE8MSWIN1252') WHERE... Note that this conversion be done several longer strings, so you must make sure that they will always go in the target column and you do not get errors "value too long."

    2. review and correct the NLS_LANG value for all customers. The mentioned AIX session should run with NLS_LANG value WE8ISO8859P1. You will see the data correctly with this setting once the data are converted as described in 1 above.

    Your tests research should work much better with a correct database.

    Thank you

    Sergiusz

  • Oracle regular expressions - splits the string into words for

    Hello

    Nice day!

    My requirement is to split the string into words.

    So I need to identify the new line character and the semicolon (;), comma and space like terminator for string entry.

    Please note that I am currently embedded blank and the comma as separator, as shown below.

    Select regexp_substr('test)
    TO
    string in words, "([^, [: blanc:]] +) (', 1, 1) double;"

    How to integrate the semicolons and line break characters in regular expression Oracle?

    Please notify.

    Thanks and greetings

    Sree

    This has nothing to do with REGEXP. Is SQL * more parser does not not a semicolon at the end of the line:

    SQL > select ' testto, mm\;
    ERROR:
    ORA-01756: city not properly finished chain

    SQL >

    Just break the chain:

    SQL > select regexp_substr ('testto, mm\;' |) '
    2 string into words
    3 \w+',1,level ',') of double
    4. connect by level<= regexp_count('testto,mm\;'="" ||="">
    5 string in words
    6      ','\w+')
    7.

    REGEXP_SUBSTR ('TESTTO, MM\;' |') STRINGIN
    --------------------------------------
    Testto
    mm
    string
    in
    Words

    SQL >

    Or modify SQL * more the character of endpoints:

    SQL > set sqlterm.
    SQL > select regexp_substr ('testto, mm\;)
    2 string into words
    3 \w+',1,level ',') of double
    4. connect by level<=>
    5 string in words
    6      ','\w+')
    7.

    REGEXP_SUBSTR ('TESTTO, MM\;) STRINGINTOWO
    --------------------------------------
    Testto
    mm
    string
    in
    Words

    SQL >

    SY.

  • RMAN command number

    The following command works fine in RMAN

    RMAN > run {}
    2 > set until what time ' to_date (27 November 2013 11:05, "HH24:MI:SS MON-DD-YYYY)";
    {3 >}

    executing command: SET until clause

    but the failure of the following command:

    RMAN > run {}
    2 > set until what time ' to_date (27 November 2013 11:05, "HH24:MI:SS MON-DD-YYYY)";
    3 > restore database;
    {4 >}

    executing command: SET until clause

    From restoration to 27 November 2013 13:53:47
    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03002: failure of the restore command at 11/27/2013 13:53:47
    ORA-01756: city not properly finished chain

    can someone tell me why?

    Thank you

    another single quote is necessary as below

    until ' to_date (27 November 2013 11:05 ',' MON-DD-YYYY HH24:MI:SS') ";

  • Generation of single quotes in strings

    Version: 11.2.0.3

    We have a custom stored procedure called GENERATE_STATS and I want to run this procedure for each schema in the comic book as

    exec ('SCOTT', 'BASIC') generate_stats;

    generate_stats exec ('HR', 'BASIC');

    .

    .

    .

    .

    exec ('XXXXXX', 'BASIC') generate_stats;

    -All except XXXXXX is fixed.

    -XXXX is derived rom DBA_USERS

    I want to generate these commands dynamically as

    SQL > SELECT ' exec generate_stats ("' | username |) (', "'BASIC"); from dba_users;

    ERROR:

    ORA-01756: city not properly finished chain

    -I noticed that, to generate a single quotation mark, you need 4 quotes

    SQL > select "' double.

    '

    -

    '

    SQL > select "',"' double.

    '''

    ---

    ','

    -I managed to create so far without much trouble.

    SQL > SELECT ' exec generate_stats ("' | username |) "',"' from dba_users where rownum < 5;

    ' EXECGENERATE_STATS('''||) USER NAME | " ','' '

    --------------------------------------------------------

    generate_stats exec ("SYS"

    exec generate_stats ("SYSTEM",")

    exec generate_stats ('OUTLN', ')

    generate_stats exec ('DIP', ')

    It took a lot of trial and error to add the remaining portiton BASIC'); to added. The following finally worked.

    SQL > SELECT ' exec generate_stats ("' | username |) (', "BASIC");' from dba_users where rownum < 5;

    ' EXECGENERATE_STATS('''||) USER NAME | " (', "BASIC"); "

    ----------------------------------------------------------------

    generate_stats exec ('SYS', 'BASIC');

    exec ('SYSTEM', 'BASIC') generate_stats;

    generate_stats exec ('OUTLN', 'BASIC');

    exec ('DIVE', 'BASIC') generate_stats;

    To generate the string 'BASIC' . I didn't have to use single quotes 4 as I once did.

    It generated when I placed between her with just two single quotes like that "BASIC");'

    There are a few basic rules I should keep in mind when you try to generate strings with single quotes?

    Hello

    In a string literal, single quotes normally indicate the beginning or the end of the literal.

    If you want to specify a single quote, is to use 2 consecutive single quotes in the literal.  For example, the name of 9 characters O'Higgins could be written in a literal string like this

    'O' Higgins

    ICT that there are 4 single quotes above: 1 to indicate the beginning of the literal string, 2 to represent a single quotation mark in the literal and 1 at the end of the literal.

    If you want a string of characters-1 that contains only a single quote, and then, as you noticed, it was released as 4 of them in a row

    ''''

    If you want to represent the 12 string

    ","BASIC");"

    in a string literal, then you have to put everything in a pair of simple and douuble quotes all quotes that occur in the sting, like this:

    (', "BASIC"); "

    When you asked if there was a rule of THUMB , you were doing a play on words?

    There is a rule of practice. When you use this type of string literal, single quotes always occur in pairs.  You always need a pair to mark the beginning and the end of the literal.  For each single quote representation, you need a pair.  If the string that represents the 12 above string literal contains 4 pairs of single quotes.  I'll write this liteal once again, with the numbers in pairs:

    (', "BASIC"); "

    122 33 44 1

    1 pair surrounds the literal; pairs of 2, 3 and 4 represent single quotes in the literal.

    If ever you have an odd number of single quotes using this notation, then you know that something is wrong.

    It is the older way of the use of single quotes in the string literal.  From Oracle 10, you have the possibility to use Q-notaation as well:

    Q'<', 'basic');="">'

    When you use Q-rating, you can have literals well trained with an odd number of single quotes.  The literal above happens to have 5, 2 that surround the literal.

    See the manual of the SQL language for more info on Q-rating:

    Literals

  • Questions of special character

    Hi all

    We used Toad and inserted - O'Neill.
    ' changed
    He became O¿NEILL
    when we changed back to ' look into a toad, all good.

    He is unable to put in Where clause and appear as a result message.



    ORA-01756: city not properly finished chain
    If you have experience, please share it to us.

    Thanks in advance,

    NY

    Well, one of the three...

    [Name] = "O'Conner".

    SQL> select "O'Conner" from dual;
    select "O'Conner" from dual
           *
    ERROR at line 1:
    ORA-00904: "O'Conner": invalid identifier
    

    [The name] = 'O'Conner'

    SQL> select 'O''Conner' from dual;
    
    'O''CONN
    --------
    O'Conner
    

    [Name] = "O" & Chr (39) & 'Conner '.

    I won't even try to run this being the concatenation operator in Oracle, verticle bars not an ampersand.

  • Problem of recovery with RMAN

    Hello

    I am getting below error while recovering DB via RMAN.


    RMAN > RUN
    2 > {SET until TIME ' to_date (November 13, 2009 13:00 ',' my DD YYYY hh) ";}
    3 > RESTORE database;
    4 > RECOVER DATABASE;
    {5 >}

    executing command: SET until clause
    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03002: failure of the command set to 2009-11-13 14:34:05
    ORA-01756: city not properly finished chain


    Angalina

    Hello

    You can restore and recover the tablespace has fallen only...

    Kind regards
    Deepak

  • This code were not run if an error occurs?

    I created a script to remove tables as below.
     DECLARE
        v_sql VARCHAR2(4000);
     BEGIN
         FOR obj IN (select table_name from user_tables) 
      LOOP
          v_sql := 'drop table  ' || obj.tablename';
          dbms_output.put_line(v_sql);
       EXECUTE IMMEDIATE v_sql;
        END LOOP;
      END;
    But, if oracle encounters an error, say an error like
    ORA-02449: unique/primary keys in table referenced by foreign keys
    This code will break out of the loop and stop the execution. Right?

    After getting the typo is included in your example:

    -ORA-01756: city not properly finished chain
    -component 'TABLENAME' must be declared

    The answer to your question is: right, but you could have tested this easily yourself of course.

    SQL> select constraint_name, constraint_type, table_name from all_constraints where table_name in ('TABLE1', 'TABLE2');
    
    CONSTRAINT_NAME                C TABLE_NAME
    ------------------------------ - ------------------------------
    SYS_C0020788                   P TABLE1
    C1                             R TABLE1
    SYS_C0020789                   P TABLE2
    C2                             R TABLE2
    
    4 rows selected.
    
    Elapsed: 00:00:00.21
    SQL> DECLARE
      2      v_sql VARCHAR2(4000);
      3   BEGIN
      4       FOR obj IN (select table_name from user_tables)
      5  .
    SQL> DECLARE
      2      v_sql VARCHAR2(4000);
      3   BEGIN
      4       FOR obj IN (select table_name from user_tables where table_name in  ('TABLE1', 'TABLE2'))
      5  LOOP
      6        v_sql := 'drop table  ' || obj.tablename';
      7        dbms_output.put_line(v_sql);
      8     EXECUTE IMMEDIATE v_sql;
      9      END LOOP;
     10    END;
     11  /
    ERROR:
    ORA-01756: quoted string not properly terminated
    
    Elapsed: 00:00:00.11
    SQL> DECLARE
      2      v_sql VARCHAR2(4000);
      3   BEGIN
      4       FOR obj IN (select table_name from user_tables where table_name in  ('TABLE1', 'TABLE2'))
      5  LOOP
      6     v_sql := 'drop table  ' || obj.tablename;
      7        dbms_output.put_line(v_sql);
      8     EXECUTE IMMEDIATE v_sql;
      9      END LOOP;
     10    END;
     11  /
       v_sql := 'drop table  ' || obj.tablename;
                                      *
    ERROR at line 6:
    ORA-06550: line 6, column 35:
    PLS-00302: component 'TABLENAME' must be declared
    ORA-06550: line 6, column 4:
    PL/SQL: Statement ignored
    
    Elapsed: 00:00:00.07
    SQL>  DECLARE
      2        v_sql VARCHAR2(4000);
      3     BEGIN
      4         FOR obj IN (select table_name from user_tables where table_name in  ('TABLE1', 'TABLE2'))
      5    LOOP
      6          v_sql := 'drop table  ' || obj.table_name;
      7         dbms_output.put_line(v_sql);
      8      EXECUTE IMMEDIATE v_sql;
      9       END LOOP;
     10     END;
     11  /
    drop table  TABLE2
     DECLARE
    *
    ERROR at line 1:
    ORA-02449: unique/primary keys in table referenced by foreign keys
    ORA-06512: at line 8
    
    Elapsed: 00:00:00.23
    SQL> desc table1
     Name
     ----------------------------------------------------------------------
     COL1
     COL2                                                                   
    
    SQL> desc table2
     Name
     ----------------------------------------------------------------------
     COL1
     COL2                                                                   
    
  • Help with the exception of Pl/SQL 'ora-3150 end of file on the communication channel.

    Hello.

    The code attached to this post opens a slider that load of 99 dblinks from different remote databases of different version.

    He captures the information from these databases and stores them locally on a central database (11.2.0.4.0 version) on different tables.

    The problem I have is that when a database is deleted, the dblink to this database show me the error 'ora-3150 end of file on communication channel' and that's right.

    But he's not going trough the exception that I created, the cursor is closed and does not continue with the cycle.

    The exception I created insert data on DBMONITOR error. DBMONITOR_LOG_ERROR_TABLE in order to catch the error (you'll be able to see all the code on the attachment)

    It's the exception:

    exception

    while others then

    INSERT IN DBMONITOR. DBMONITOR_LOG_ERROR_TABLE (NOMBRE_DBLINK, message, info, FECHA_ERROR, TIPO_PROCEDURE) VALUES (var, SUBSTR (DBMS_UTILITY. (FORMAT_ERROR_STACK, 1, 200), "CONNECTION ERROR", SYSDATE, 'CAPACITY');

    commit;

    end;

    Could help me please on how could intercept this exception?

    Thank you.

    Juan.

    You might have a problem with your connection or mishandling. The end of the file ora-3150, on channel of communication error means that there is a connection, but this link was broken somehow.

    If a database is not reachable, you should get other types of errors.

    For example judgment of the Kingdom or tns - memory could not resolve alias or simliar things.

    Here is a list of typical mistakes I have check and manage when accessing remote databases.

      e_db_link_broken EXCEPTION;  --ORA-02019 connection description for remote database not found
      PRAGMA EXCEPTION_INIT (e_db_link_broken, -02019);
      e_oracle_not_available EXCEPTION;  --ORA-01034 ORACLE not available
      PRAGMA EXCEPTION_INIT (e_oracle_not_available, -01034);
      e_oracle_down EXCEPTION;  --ORA-27101: shared memory realm does not exist
      PRAGMA EXCEPTION_INIT (e_oracle_down, -27101);
      e_no_listener EXCEPTION;  --ORA-12541: TNS:no listener
      PRAGMA EXCEPTION_INIT (e_no_listener, -12541);
      e_no_service EXCEPTION;  --ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
      PRAGMA EXCEPTION_INIT (e_no_service, -12514);
      e_timeout EXCEPTION;  --ORA-12170: TNS:Connect timeout occurred
      PRAGMA EXCEPTION_INIT (e_timeout, -12170);
    

    If you have a long open session and fail to close the db links after recovered information from the remote site?

    In addition, I propose to change your dynamic insertion in a normal insert.

    First extract the data of the DB link dynamically, but just with a select statement. Then do the insertion with the result data.

    Improve your logging table to store messages up to 4000 char CHARACTER. 200 is really small for error messages.

    In addition to the DBMS_UTILITY. FORMAT_ERROR_STACK you must also connect DBMS_UTILITY. FORMAT_ERROR_BACKTRACE. Just to see if you get a better message there.

    WHEN e_db_link_broken or e_oracle_not_available or e_oracle_down or e_no_listener or e_no_service or e_timeout THEN
       INSERT INTO DBMONITOR.DBMONITOR_LOG_ERROR_TABLE (NOMBRE_DBLINK, message, info,FECHA_ERROR,TIPO_PROCEDURE) VALUES(var, 'Remote DB not accessible','ERROR DE CONEXION',SYSDATE,'CAPACITY');
                   -- commit;
    WHEN OTHERS THEN
    
                    INSERT INTO DBMONITOR.DBMONITOR_LOG_ERROR_TABLE (NOMBRE_DBLINK, message, info,FECHA_ERROR,TIPO_PROCEDURE) VALUES(var, SUBSTR(DBMS_UTILITY.FORMAT_ERROR_STACK||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE, 1, 4000),'ERROR DE CONEXION',SYSDATE,'CAPACITY');
                    --commit;
                    end;
    
  • ORA-20001: GET_BLOCK error. ORA-20001: Execution of the statement was due

    Hello
    We did an upgrade to 3.0 APEX to APEX 3.2.
    When I tried to import an application I got the following error:
    ORA-20001: GET_BLOCK error. ORA-20001: Execution of the statement was not successful. ORA-01756: Anfa¼hrungsstrich fehlt EIB Zeichenfolge & lt; pre & gt; Start run immediately "alter session set nls_numeric_characters =" ' | " wwv_flow_api.g_nls_numeric_chars | " ' ; end; & lt; / pre & gt;

    I got the same error when I tried to import another APEX 3.2 application.
    What I did wrong?

    Thank you for your help.
    Concerning
    Siegwin

    Hi Siegwin,

    No, the language should not be a problem...?

    Was the file transferred by FTP...? CR information can be a problem here when
    Export on Unix/Linux and import on windows (or vice versa). You might consider re-export
    He (note not only characters, but also the "File Format" setting) and be careful when
    FTP file transfer (ascii / binary mode).

    If this does not work, you can try the following approach:
    Import the file using SQL * Plus - you need to manually adjust space of work-ID and application ID.
    at the beginning of the script. You will see the same error in SQL * Plus, but then it is easier to
    find the position corrupted in the script and fix.

    Does that help?

    Carsten-

  • Run immediately produced confusing errors

    I have a procedure that removes the selected rows of a table based on a dynamic WHERE condition. The column values are of type VARCHAR2. Using SQL Developer debug mode, I put the finger on the line of boredom to the Execute Immediate statement that produces a ' ORA-00907: lack the right parenthesis "error with or the other of these channels:

    v_sql: = ' DELETE FROM schema.table WHERE (column1 = "Value1" GOLD column1 = "Value2" GOLD column1 = "Value3" ") AND (column2 ="value4")';
    v_sql: = ' REMOVE FROM schema.table WHERE column1 ("Value1", "Value2", "value3") AND column2 IN ("value4")';
    Immediately run v_sql;

    Still in PL/SQL, the same lines running without error:

    DELETE FROM schema.table WHERE (column1 = 'value1' OR column1 = 'value2' GOLD column1 = 'value3') AND (column2 = 'value4');
    REMOVE FROM schema.table WHERE column1 IN ('value1', 'value2', "value3") AND column2 IN ("value4");

    I can even run the same instructions in an anonymous block without error:

    Set serveroutput on
    DECLARE
    v_cnt NUMBER;
    v_sql varchar2 (2000);
    BEGIN
    v_sql: = ' REMOVE FROM schema.table WHERE column1 ("Value1", "Value2", "value3") AND column2 IN ("value4")';
    Immediately run v_sql;
    Run immediately "select count (*) table" in v_cnt;
    dbms_output.put_line (v_cnt);
    Rollback;
    Run immediately "select count (*) table" in v_cnt;
    dbms_output.put_line (v_cnt);
    END;
    /
    I must be blind because neither dynaminc SQL statement needs an another right parenthesis. I even added one to test (same error ORA-00907!). I even tried this

    v_sql: = "DELETE FROM schema.table WHERE ((column1 = '' valeur1 '') OR (column1 = 'value2'))';"

    (same error ORA-00907!)

    I even tried to run the same without parentheses (ORA-00900: invalid SQL statement error). I guess the problem is the single quotes.

    Just for fun I tried that as well

    EXECUTE IMMEDIATE chr (39) | v_sql | Chr (39);

    and, as I suspected, I got the error "invalid SQL statement.

    I even tried this

    EXECUTE IMMEDIATE chr (39) | v_sql;

    and of course I got an ' ORA-01756: not correctly completed string "error.

    When I tried this

    EXECUTE IMMEDIATE v_sql | Chr (39);

    the same error "missing right parenthesis" surfaced.

    I've never had this problem with the Execute Immediate statements before. Unless someone can offer a penny to buy a clue, looks like I have no choice but to make the Immediate Execute in a loop FORALL to each WHERE condition using a variable binding for the value of the column.

    Your procedure changed a bit:
    Removed options CHR (39) and 'DELETE FROM' has been added at the beginning of your v_sql variable.

    CREATE OR REPLACE PROCEDURE delete_rows_proc (
       p_table        IN   VARCHAR2,
       p_schema       IN   VARCHAR2,
       p_columns      IN   VARCHAR2,
       p_col_values   IN   VARCHAR2,
       p_col_delim    IN   VARCHAR2,
       p_val_delim    IN   VARCHAR2
    )
    AS
    /*
    generic procedure to delete selected rows from a table
    
    INPUT PARAMETERS:
    1) P_TABLE (required): table name
    2) P_SCHEMA (required): schema name
    3) P_COLUMNS (required): a delimited string of character type column names
    4) P_COL_VALUES (required): a delimited string of column values
    (must match P_COLUMNS in delimited sequence and number);
    5) P_COL_DELIM (required): column delimiter for P_COLUMNS and P_COL_VALUES;
    must be a keyboard character delimiter that DOES NOT appear elsewhere in the column values;
    6) P_VAL_DELIM (required): column value delimiter for P_COL_VALUES;
    must be a keyboard character delimiter that DOES NOT appear elsewhere in the column values;
    must be different from P_COL_DELIM
    
    NOTE: if P_COLUMNS is not null then P_COL_VALUES cannot be null
    
    example of P_COLUMNS and P_COL_VALUES:
    P_COLUMNS = 'column1#column2'
    P_COL_VALUES = 'value1,value2#value4'
    P_COL_DELIM = '#'
    P_VAL_DELIM = ','
    deletes rows WHERE ((column1 = 'value1') OR (column1 = 'value2') AND (column2= 'value4')
    */
       v_sql              VARCHAR2 (4000);
       v_where_clause     VARCHAR2 (3900);
       v_from_clause      VARCHAR2 (200);
       v_col              VARCHAR2 (50);
       v_txt              VARCHAR2 (1000);
       i_col_delim_cnt1   INTEGER         := 0;
       i_col_delim_cnt2   INTEGER         := 0;
       x_loop_cnt         INTEGER         := 0;
       y_loop_cnt         INTEGER         := 0;
       delim_txt          VARCHAR2 (1000);
       i_delim_cnt        INTEGER         := 0;
       i_cnt              INTEGER;
       e_delim_not_eq     EXCEPTION;
    
       FUNCTION assemble_or_str (v_col IN VARCHAR2, v_txt IN VARCHAR2)
          RETURN VARCHAR2
       IS
          v_return   VARCHAR2 (1000) := '';
       BEGIN
          IF LENGTH (v_col) > 0
          THEN
    -- add opening parenthesis
             v_return := v_return || '(';
          END IF;
    
          FOR i IN 1 .. i_delim_cnt + 1
          LOOP
             v_return :=
                   v_return
                || '('
                || v_col
                || ' = '
                || CHR (39)
                || get_delimited_text (v_txt, p_val_delim, i)
                || CHR (39)
                || ')';
    
             IF i < i_delim_cnt + 1
             THEN
                v_return := v_return || ' OR ';
             END IF;
          END LOOP;
    
          IF LENGTH (v_return) > 0
          THEN
    -- add closing parenthesis
             v_return := v_return || ')';
          END IF;
    
    --dbms_output.put_line('v_return=' || v_return);
          RETURN v_return;
    -- e.g., v_return = '((column1 = 'value1') OR (column1 = 'value2'))''
       END;
    BEGIN
       IF p_columns IS NOT NULL AND p_col_values IS NOT NULL
       THEN
    -- count the column delimiter in both parameters
          i_col_delim_cnt1 :=
                LENGTH (p_columns)
                - LENGTH (REPLACE (p_columns, p_col_delim, ''));
          i_col_delim_cnt2 :=
               LENGTH (p_col_values)
             - LENGTH (REPLACE (p_col_values, p_col_delim, ''));
    
          IF i_col_delim_cnt1 = i_col_delim_cnt2
          THEN
    -- if both strings have the same # of column delimiters
    -- assemble the where clause
             IF i_col_delim_cnt1 = 0
             THEN
    -- for single column
    -- find how many delimited values are in P_COL_VALUES
                i_delim_cnt :=
                     LENGTH (p_col_values)
                   - LENGTH (REPLACE (p_col_values, p_val_delim, ''));
    
                IF i_delim_cnt > 0
                THEN
    --dbms_output.put_line('i_delim_cnt = ' || i_delim_cnt);
    -- for single column with multiple column values
                   v_where_clause := assemble_or_str (p_columns, p_col_values);
                ELSE
    -- for single column with single column value
                   v_where_clause :=
                        p_columns || ' = ' || CHR (39) || p_col_values
                        || CHR (39);
                END IF;
             ELSE
    -- for multiple columns
                x_loop_cnt := i_col_delim_cnt1 + 1;
    
                FOR x IN 1 .. x_loop_cnt
                LOOP
    -- for each column
                   v_col := get_delimited_text (p_columns, p_col_delim, x);
                   v_txt := get_delimited_text (p_col_values, p_col_delim, x);
    --dbms_output.put_line('loop '||x||': vcol='||v_col);
    --dbms_output.put_line('loop '||x||': v_txt='||v_txt);
                   i_delim_cnt :=
                        LENGTH (v_txt)
                        - LENGTH (REPLACE (v_txt, p_val_delim, ''));
    
                   IF i_delim_cnt > 0
                   THEN
                      v_where_clause :=
                                 v_where_clause || assemble_or_str (v_col, v_txt);
                   ELSE
                      v_where_clause :=
                            v_where_clause
                         || '('
                         || v_col
                         || ' = '
                         || CHR (39)
                         || v_txt
                         || CHR (39)
                         || ')';
                   END IF;
    
                   IF x < x_loop_cnt
                   THEN
                      v_where_clause := v_where_clause || ' AND ';
                   END IF;
                END LOOP;
             END IF;
          ELSE
    -- if i_col_delim_cnt1 i_col_delim_cnt2
    -- raise exception
             RAISE e_delim_not_eq;
          END IF;
       END IF;
    
    -- assemble the dynamic SQL statement
       v_from_clause :=
                      (CASE p_schema
                          WHEN NULL
                             THEN ''
                          ELSE p_schema || '.'
                       END) || p_table;
       v_where_clause :=
           (CASE
               WHEN v_where_clause IS NULL
                  THEN ''
               ELSE ' WHERE ' || v_where_clause
            END
           );
       v_sql := 'DELETE FROM ' || v_from_clause || v_where_clause; -- Added 'DELETE FROM '
       DBMS_OUTPUT.put_line (v_sql);
    
    -- test clauses separately
    -- EXECUTE IMMEDIATE 'DELETE FROM '|| v_from_clause;
    -- EXECUTE IMMEDIATE 'DELETE FROM '|| v_from_clause || v_where_clause;
       EXECUTE IMMEDIATE v_sql;
    
       EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || p_table
                    INTO i_cnt;
    
       DBMS_OUTPUT.put_line ('i_cnt = ' || i_cnt);
       ROLLBACK;
    
       EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || p_table
                    INTO i_cnt;
    
       DBMS_OUTPUT.put_line ('i_cnt = ' || i_cnt);
    --commit;
    EXCEPTION
       WHEN e_delim_not_eq
       THEN
          DBMS_OUTPUT.put_line
             ('ERROR: delimiter number mismatch! A column delimiter was found in the P_COLUMNS string and/or the P_COL_VALUES string; however, the number of column delimiters between the two string does not match. Process cannot be completed.'
             );
    -- WHEN OTHERS THEN
    -- DBMS_OUTPUT.PUT_LINE('Error in DELETE_ROWS_PROC procedure!');
    -- DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END delete_rows_proc;
    /
    
    SQL> SELECT * FROM TABLE1
      2  /
    
    COLUMN1                                            COLUMN2
    -------------------------------------------------- -------------------------------------------------
    value1                                             value3
    value2                                             value3
    value3                                             value3
    value4                                             value3
    value1                                             value4
    value2                                             value4
    value3                                             value4
    value4                                             value4
    
    8 rows selected.
    
    SQL> exec DELETE_ROWS_PROC('TABLE1', 'SCOTT', 'COLUMN1#COLUMN2', 'value1,value2#value4', '#', ',')
    DELETE FROM SCOTT.TABLE1 WHERE ((COLUMN1 = 'value1') OR (COLUMN1 = 'value2')) AND (COLUMN2 = 'value4
    i_cnt = 6
    i_cnt = 8
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    I hope this helps.

    Kind regards
    JO

    Edit: Deleted a wrong comment

  • Dynamic query

    Hello people

    I'm new in this forum and I have a question about a problem to generate a dynamic statement. My problem is when try to run my ASP code or any application, I get an error, I don't know who is bad in my code, please below my PL * SQL. I'm not an expertise in oracle, but I try.
    Basically, my problem is in the statement AS perhaps this sentence, I said bad.
    Common code errors when trying to load my application from asp are:
    ERROR-ORA-01756
    ERROR-ORA-00911
    I appreciate your comments and recommendations

    CREATE OR REPLACE PACKAGE EVEN. TESTPGK2 AS
    TYPE out_cursor IS REF CURSOR;
    PROCEDURE T01_PRUEBA2 (pp IN VARCHAR2, VARCHAR2, outputCursor to out_cursor status);
    END TESTPGK2;

    CREATE OR REPLACE PACKAGE BODY TESTPGK2 AS
    PROCEDURE T01_PRUEBA2 (pp IN VARCHAR2, VARCHAR2, outputCursor to out_cursor status)
    AS

    v_query varchar2 (8000);

    BEGIN
    v_query: = 'SELECT ID_TYP_ACTOR AS CODE, DESCRIPTION AS DESCRIPTION, STATUS AS STATUS OF T01_TIPOS_ACTORES ";
    v_query: = v_query | ' WHERE 1 = 1';
    IF year IS NOT NULL THEN
    v_query: = v_query | "AND DESCRIPCIÓN AS % | pp | % ';

    END IF;
    IF IS NOT NULL condition THEN
    v_query: = v_query | "AND STATUS AS % | status | %' ;

    END IF;
    v_query: = v_query | "ORDER BY ID_TYP_ACTOR";

    OutputCursor OPEN for v_query;


    EXCEPTION
    WHILE OTHERS THEN
    raise_application_error (-20001, "an error has been encountered-' |") SQLCODE |' - ERROR-' | SQLERRM);
    END T01_PRUEBA2;
    END TESTPGK2;

    Hello

    Welcome to the forum!

    First of all, lose the EXCEPTION section. Do not write an article of EXCEPTION unless it is an improvement of the management of the default exceptions.

    You put the SQL statement into a VARCHAR2 variable; It's a very good idea. Allows you to view easily. Before you even try to run it, make sure it does what you want.
    Change the end of your procedure so that it looks like this:

    ...
            v_query := v_query || ' AND ESTATUS LIKE %||status||%' ; 
    
        END IF;
        v_query := v_query || 'ORDER BY ID_TYP_ACTOR'; 
    
        dbms_output.put_line (v_query || ' = v_query');
    
    --  OPEN outputCursor for v_query; 
    
    END T01_PRUEBA2; 
    

    Before you run it, type this command

    SET  SERVEROUTPUT  ON
    

    Otherwise, you will not see the output of dbms_output.
    Now try to perform your procedure. It will produce output something like this:

    SELECT ID_TYP_ACTOR AS CODIGO, DESCRIPCION AS DESCRIPCION, ESTATUS AS ESTATUS
    FROM T01_TIPOS_ACTORES WHERE 1 = 1 AND DESCRIPCION LIKE %||pp||%  AND ESTATUS
    LIKE %||status||%ORDER BY ID_TYP_ACTOR = v_query
    

    Is that what you want? For example, look at the beginning of the last line

    LIKE %||status||%ORDER ...
    

    You want to have. characters and the 6 characters ',' t ', 'a', ', 'u' and ' it? That's what you get when they are inside single quotes. Inside single quotes, ' |' does not mean concatenate, or something special. It's just 2 characters. Inside single quotes, 'status' is not reference a variable named condition, or anything else special. It is only 6 characters. I do not want these things in single quotes. I don't think you want to say:

    ...     v_query := v_query || ' AND ESTATUS LIKE %||status||%' ; 
    

    I think it's much more likely you want to say something like:

    ...     v_query := v_query || ' AND ESTATUS LIKE ''%'
                         || status
                      || '%''' ; 
    

    and the same with the Descripción.

    As mentioned previously, whenever you have a question, view a complete test script that people can run to recreate the problem and test their ideas. This includes not only the package, but the code to call the procedure in the package and CREATE TABLE and INSERT all necessary tables for instructions. After the exit you want from this code, with the data for this example.
    See the FAQ forum {message identifier: = 9360002}

Maybe you are looking for

  • Are there technical problems around where a folder for JPEG files?

    I have a lot of JPEGs (scans of old photographs) on the Photo.  I decided that I would like to have them placed in a file folder too. Is there a difference if I create the folder within the Documents or images, or as a record separately on my file? T

  • How to get on Satellite C660-1J2 factory settings?

    I have the Satellite C660-1J2some can tell me how to reset this computer to when we bought at toshiba, does not create a recovery disk, I don't remember how to do it from computer. I did once? Thanks for the helpTony

  • camera repairs

    Can anyone help with information on the repair of the camera? The viewfinder screen is empty and dark (as if it was off) but it still works, IE. I can take pictures (guess what is in the picture as anything on the viewfinder) and I see the photos unt

  • Elapsed time delay does that once in the state machine

    Hello.  I have problems using the delay to show the seconds remaining on an expectation not in a simple state machine.  I have a front panel countdown indicating the time remaining for the step.  I thought that the delay of elapsed time was the way t

  • HP deskjet 3522: WiFi

    I bought a new router.  Now I can't get the printer to accept the security key. I tried several times and still no luck.  I get a message that the key to security is not just.  Help!