ALTER session in cfquery statement

Hello world

Would it not possible to use the alter session in a query?
I would like to do something like this:
< cfquery >
ALTER SESSION SET NLS_COMP = LINGUISTIC;
ALTER SESSION SET NLS_SORT = GENERIC_BASELETTER;
Select geo_indication in the eccgis where country_fk = 'PT' and geo_indication like "% O";
< / cfquery >
As good in sqlDeveloper (oracle, without cfquery...), the application gives an error in CF (of semicolumns?).
Did anyone get an idea?

Thanks in advance,
Michel

Thank you very much.

It is now fixed:
The sort order also has implications on the SEARCH mechanism
Looking for Oxxxxxx you can't find Óbidos
and now:
Search do not look upcase and focus more.

Michel

Tags: ColdFusion

Similar Questions

  • ALTER session set current_schema

    Hello

    We have multiple instances of the database (for example, MR01DEP, MR02DEP,...).

    Each instance is composed of more than stores (called schemas): for example, for MR01DEP, we have STORE1, Bank 2, 3, to MR02DEP we STORE5, STORE6,... and so on.

    Now, using developer PL/SQL, SQL Developer or even SQL Plus, when I connect to these databases, I connect using the user SUP_TMP (who has the privileges necessary for the actions that I have to do), and I have something like this:

    Conn SUP_TMP / < password > @STORE1 (I can connect like this and not with @MR01DEP; However, even @MR01DEP is correct).

    Today, all the tables are on these patterns (STORE1, STORE2,..), and when I connect with the SUP_TMP user, each time, at each meeting, I have to write:

    ALTER session set current_schema = STORE1, or

    ALTER session set current_schema = Bank 1

    At the beginning of every script that I have to run, I want to write a little routine so that I don't need every time to this «alter session set current_schema» statement

    If I connect with SUP_TMP / < password > @STORE1.

    so I see in the instance of v$, as the instance_name is (correct) MR01DEP.

    But I need to somehow get that banks '1', which I use when I connect to it (although, normally, I connect to a database, such as MR01DEP, but I'm specifying STORE1 in the connection string).

    So, in other words, I need that at the beginning of each script, to determine the current connection string I'm specifying after '@', and which is the current_schema.

    If I log in as SUP_TMP / < password > @STORE5, then I'll have something like immediate execution "alter session set current_schema = STORE5'."

    SUP_TMP user should be the I connect each time, but the current pattern of each script in each session, must come from the connection string.

    Is this possible?

    Thank you!

    I know, I specify the store, and it will automatically connect to the correct database (this is the case).

    No - NOT sure that connect you to the right base.

    As said ground that alias 'keep' is on the client and can be mapped to ANY DATABASE at all.

    Also - what you specify with is the DATABASE - this isn't a pattern.

    You're talking about two different things.

    You set the current schema - you connect to a database. TWO DIFFERENT THINGS.

    It may not even be a schema with the same name as the database.

    Do not use the same name for the databases and schemas. Oracle is NOT sql server.

    You can create a trigger AFTER the opening of SESSION to define the schema for you, but you must be able to know which schema must be defined.

  • ALTER session with ADF App statement

    Hello:

    11.1.2.3 Jdev
    RedHat 5.8
    Oracle db 11.2.0.3

    When you use a Web of Fusion ADF application, what are the consequences if we issue the command of database:

    ALTER session set time_zone = - 6; for a particular user

    For example, if the session is passivated? The database session remains with request on passivation module? or weblogic failover?

    Or will be session and users mix?

    Thank you very much.

    Hello

    you don't have a 1:1 data association in web applications. If you need to change the database to a user session you will have to do for each request, which means that you override the method of prepareSession AM ADF BC database alter session statement. So to answer your questions

    The database session remains with request on passivation module?

    N °

    or weblogic failover?

    N °

    Frank

  • ALTER session statement when login

    Hello
    on the 11 G R2,.
    I want the util_3 to change user2 session right on the connection. How is that possible?

    I want to avoid the util_3 of issue:
    ALTER SESSION SET CURRENT_SCHEMA =USER2
    at each connection.

    Thanks for help.

    use
    run immediately "ALTER SESSION SET CURRENT_SCHEMA = SCOTT';"

  • ALTER session nls_date_format not retained

    Hello guys,.

    Here is the environment:

    Oracle 11.2.0.1 on Linux 64-bit RHEL DB

    Oracle 11 g 2 on Windows 2008 R2 32-bit client

    Our product works service (code generated in c ++) and the service opens 5 sessions of database and alter session set nls_date_format questions to HH24:MI:SS DD/MM/YYYY in each of them.

    But searching through the service logs, I see that select statements (to_char (date)) return date in format other than what has been defined via "alter session" i.e. they do not see the part and just JJ-LUN-AA. But the same select instructions out the date in the format of correct/expected (according to alter session statement).

    The problem is that we do an insert in a table taking the current system time and running to_date (< time system >). It is a failure with: ORA-01843: not one month valid. I understand that it must specify a format for the input string, the date system, but we do not and was not a problem for someone else.

    I'm also no disconnected sessions or reconnects.

    Customer Oracle NLS_LANG is: AMERICAN_AMERICA. UTF8.

    This problem occurs for one of our customers who use this product. All other clients do not encounter this problem, as this has been a long-standing code. I'm not saying that the code is perfect and looking at some of the SQLs, we rely on implicit conversion of data in Oracle instead of editing the SQL code, but this has never caused a problem to any other customer.

    I understand the hierarchy of setting NLS_DATE_FORMAT i.e. the database, register of operating system of the customer, the customer Oracle (alter session) and finally to_date/to_char functions.

    It seems that the session format game becomes overloaded as when they restart the service in our product everything is back to normal until a couple of days, when queries in the service connects begin to show the date incorrect without time portion and just JJ-LUN-AA.

    Any help would be appreciated as I had read a lot on the internet with no evidence outside this site including our customer:

    ttp://StackOverflow.com/questions/15396241/CX-Oracle-ora-01843-not-a-valid-month-with-Unicode-parameter h

    Thank you

    Bharath

    Bharath3 wrote:

    ...

    My question is, why the session loses the settings of NLS_DATE when it doesn't happen to anyone else? I think that the format is getting replaced in the sessions but how do I know that? How to find environmental changes to current public meetings?

    Maybe you have a connection pool if every session is used by different... hmm applications or threads. Even if you issue a command of nls alter at the start of the session, some processes could change this setting later. This is why it is best to not depend on any parameter of session happened when the connection was established.

    Best solution: just use the correct format inside the to_Char conversion. Or issue a command to alter session immediately before running the selection.

  • 'ALTER SESSION SET CURRENT_SCHEMA' does not work

    Hello

    in my JAVA application, I need to change a user's session so that it gets access to the tables that are created by the user 'myUser' (see code below).

    The code below shows how I tried to implement with JAVA:

    ---------------------------------------------------------------------------------------------------------
    Statement stmtSchema = con.createStatement ();
    String sql = "ALTER SESSION SET CURRENT_SCHEMA = myUser;"
    check int = stmtSchema.executeUpdate (sql);
    ---------------------------------------------------------------------------------------------------------

    There is no exception later when running the program, but it seems that the SQL in JAVA command will have no effect because when the program tries a SELECT statement after the session I get an exception:

    Java.Sql.SqlException ora-00942: table or view does not exist

    This means that the current_schema has not yet changed.

    When I tried the same command with sqlplus, it works fine.

    Why it does not work with JDBC?

    We use 8.1.3 of Oracle and Oracle 10g Release 2.

    Hello
    just a validation test. You guarantee that the alter session command and the select statement is belonging to the same connection object?
    If the connection object is the same you can post a simple test cases for further investigation?
    Ciao,.
    Giovanni

  • ALTER session isn't wofking

    Hi all

    I created the process to edit the session to control the currency format, in any way the process works fine on the home page, but when you visit another page or return to the home page the session value (currency format) goes back to the previous setting ($). How can I keep this session fixed and consistent across my Web site?

    Also when I change the order of any report that the currency format will be shown in the older framework ($), I use the reports of PPR.

    PS, does not change when moving between pages of session state is same. Also, I tried the application process and process page on new session and the page load.

    Thank you
    Fadi.

    Try to add to the attribute VPD of your application (security settings):

    run immediately "alter session set nls_currency ="? "" ' ;

    .. .adjusted for what you really need.

    To clarify, it is an "equal" sign, followed by two single quotes consecutive, followed by a question mark where you can use the desired currency symbol, followed by three apostrophes, terminated by a semicolon.

    Scott

  • Several alter session and SQL * Net message from dblink in APEX

    Hello

    I have Apex 4.2.3 and I use Glassfish more listener of the Apex.

    Database is 11.2.0.4 under linux

    Looking for the session active database, I see that apex run several alter session with a lot of expectation as SQL * Net message from dblink the.

    Ex:

    ALTER session set NLS_TERRITORY = "AMERICA."

    call the query of disc elapsed to cpu count current lines

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

    Parse 58 0.00 0.00 0 0 0 0

    Run 58 0.06 3.53 267 58 0 0

    Fetch        0      0.00       0.00          0          0          0           0

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

    Total 116 0.06 3.53 267 58 0 0

    Chess in the library during parsing cache: 0

    The analysis of the user id: 277 (recursive depth: 1).

    Elapsed time are waiting on the following events:

    Event waited on times max wait for the Total WHEREAS

    ----------------------------------------   Waited  ----------  ------------

    SQL * Net message to dblink 174 0.00 0.00

    SQL * Net message from dblink 174 3.47 0.03

    ********************************************************************************


    Why he is doing a lot to change session? Why the wait is SQL * Net message from dblink the?

    We have recently to load a new language, but I'm not sure that this is the main problem.



    I think that you have the link db in the workspace schema and data requested by the Apex of this link. For example, it may be

    report which uses db link. Check dba_db_links or user_db_links for the existing links. Check if this link used by Apex.

  • Inverse of command 'ALTER SESSION SET.

    Hello

    I have a READER user and when I connected with this user that I can set the current session settings such as

    alter SESSION set smtp_out_server = '123.345.134.123';
    
    

    or

    alter session force parallel query parallel N;
    
    

    If it would be sysdba or any other user with grant on parameter $ v we could use:

    select value from v$parameter where name = 'smtp_out_server'
    
    

    Is it possible that I can get the current session settings without going through subsidies on the parameter $ v?

    PS: it seems strange, that we have the setter (alter session set), but haven't Get accessor.

    Maybe the function dbms_utility.get_parameter_value, assuming that you have the privileges.

  • ALTER session privilege

    Hello
    Is there a reason why a developer may not have the privilege to alter session? My understanding of this privilege is that they will be able to make changes in only their own session, once they are disconnected the changes are cancelled. Is there any changes he could do in their own session that I (dba) will be wary of?

    Thank you.

    user8869798 wrote:
    Hello
    Is there a reason why a developer may not have the privilege to alter session? My understanding of this privilege is that they will be able to make changes in only their own session, once they are disconnected the changes are cancelled. Is there any changes he could do in their own session that I (dba) will be wary of?

    Thank you.

    Yes, your interpretation is correct that they are looged off the coast of changes back its session. But there are a number of reasons when ppl do not like to give developers alter session privilege.
    There are powerfully parameter during their session, developers can change like:

    
    sort_area_size
    optimizer_mode
    statistics_level
    optimizer_dynamic_sampling
    optimizer_use_pending_statistics
    optimizer_capture_sql_plan_baselines
    optimizer_use_sql_plan_baselines
    parallel_min_time_threshold
    parallel_degree_limit
    parallel_force_local
    optimizer_use_invisible_indexes
    parallel_min_percent
    cursor_sharing
    result_cache_mode
    parallel_instance_group
    hash_area_size
    result_cache_remote_expiration
    object_cache_optimal_size
    object_cache_max_size_percent 
    

    So if these parameter is changed into something weird that they can impact any database, specifically they can lower down the performance of the database and features.

    Best practice always review the requirements of developers and then after checking give privilege to alter session.

    Also check that the parameters can be modified using alter session

    Select the name of the parameter $ v where ISSES_MODIFIABLE = 'TRUE '.

    Hope this helps

  • ORA-02248: invalid option for ALTER SESSION during the connection of the customer

    Hello
    I'm a junior dba and I was hoping if someone could help me with a problem I have. I recently installed on the oracle 10g client on my windows machine. I am trying to remote connect to my database on a unix machine, but I get error trying to connect from the client below.

    ERROR:
    ORA-00604: an error has occurred at the SQL level 1 recursive
    ORA-02248: invalid option for ALTER SESSION

    I did some searching on that and I think it might be something to do with the NLS_LANG setting maybe. I do not know if and to be honest, I'm a little lost on this.

    Any help would be greatly appreciated. See you soon.

    RGS,
    Rob

    Hello

    what the SQL you gave?

    Check the run-> regedit NLS_LANG parameter and change it according to env

  • ALTER SESSION in sql script produces strange results

    Why "alter session set NLS_DATE_FORMAT" would interfere with the operation of a sql script?

    First of all, the script without the ALTER SESSION:
    SQL> !cat doit1.sql
    --alter session set NLS_DATE_FORMAT = "DD-MON-YYYY"
    set pagesize 99
    set trimspool on
    col BIRTH_MONTH for a11
    break on BIRTH_MONTH skip 1
    spo doit.txt
    prompt My Membership
    set feedback off heading off
    select 'As of ' || sysdate from dual;
    set heading on
    --
    select count(*) from dual;
    --
    spool off
    And its execution:
    SQL> @doit1
    My Membership
    
    As of 14-JAN-10
    
      COUNT(*)
    ----------
     1
    Everything is well with the world. Now let's throw in the ALTER SESSION:
    SQL> !cat doit2.sql
    alter session set NLS_DATE_FORMAT = "DD-MON-YYYY"
    set pagesize 99
    set trimspool on
    col BIRTH_MONTH for a11
    break on BIRTH_MONTH skip 1
    spo doit.txt
    prompt My Membership
    set feedback off heading off
    select 'As of ' || sysdate from dual;
    set heading on
    --
    select count(*) from dual;
    --
    spool off
    And its performance
    SQL> @doit2
    set pagesize 99
    *
    ERROR at line 2:
    ORA-00922: missing or invalid option
    
    
    
      COUNT(*)
    ----------
     1
    not spooling currently
    SQL> 
    Don't like the SET commands (I played a bit with many, he does not like one any of them) and does not take account of the order of the opening COIL

    First of all, I've noticed this with a 10.2.0.1 connected to a 10.2.0.4 (windows) client database (HP - UX). Confirmed on my laboratory portable VM, 10.2.0.4 under OEL5, client and db on the same virtual machine.

    You are missing just the leak ';' at the end of the line to alter session. Add to that, it all works.

  • Editing session with javascript State

    Hey everybody,

    I'm under Apex 3.2 and wonder if there is any State of session documentation on change (or reading) with javascript in request. I found the JavaScript API to

    http://download.Oracle.com/docs/CD/E14373_01/apirefs.32/e13369/TOC.htm

    But these features are mostly dealing with page elements. Right now, my solution is to write two GET_SESSION_STATE and SET_SESSION_STATE application processes, using APEX_UTIL to get/set the session values. I call these two application using htmldb_get methods, from session element names.

    It seems to be a clumsy way of doing things, and I'm surprised that Apex was not built in the object that can do it all in one step.

    Is there an easier way to do it?

    Thank you!

    Hello

    
    

    And create the page zero to your application if it did not

    BR, Jari

  • Using the SQL with CFQUERY statement variable

    I generate a SQL statement based on user input. I use loops, etc. to create the string of the current statement.

    Once the SQL string is created I can display it on the screen and it seems fine.

    If I copy the text that appears on the screen and paste it into a CFQUERY, it works very well.

    BUT if I try to the variable output directly in the CFQUERY tags set string - it fails... what gives?

    Here is the text of the string I am generating in a variable called #insertString #.

    INSERT INTO atblProduct (PRODUCTTITLE, RELATEDPRODUCTS, PARTCODENAME, DISPLAY, PRODFAMILYID, DETAILEDDESCRIPTION, overview, APPLICATION type, SPECIALTAB) VALUES (' product ', '1,2,3', ' Code Name', 1, 1, 'Detailed Description', 'Preview', 1, 1)

    in the code below, you will see how I try to run this sql using the variable in a CFQUERY tag. Do I need to use a CF function to ensure it is passed verbatim to the SQL engine?

    < CFQUERY datasource = "mydb" >
    #insertString #.
    < / CFQUERY >

    Try the function PreserveSingleQuotes.

  • ALTER Session timeout in Webcenter content system

    Hello


    The default Session in the Webcenter content system takes an hour. Must I increase to 10 hours. I tried to change it to 10 hours, but the session timeout system is always only one hour.

    Do we need to apply a patch or custom component is required, to increase the Session timeout?


    Here are the steps I took to change the value of timeout of session in 10 hours.

    Test 1:
    Login in Console Weblogic-> deployments-> Expand "Oracle Universal Content Management - Content Server"-> and click on ' / '-> click Settings - > then changed value of timeout of Session in 10 hours.

    Test 2:

    Connect you in Weblogic Console-> deployments-> click "Oracle Universal Content Management - Content Server"-> click Settings - > then changed value of timeout of Session in 10 hours.

    Both did not work

    Can you please how to proceed now.

    Thanks in advance

    Hello

    You've restarted the WLS server admin and server managed UCM after making the changes? Make sure you start wls first, then the University Complutense of Madrid.

    Thank you

    Srinath

Maybe you are looking for

  • Oh no.!

    Someone help me please!

  • 6 GB of RAM, Windows 7 64 - bit said that only 3 GB is available

    just bought new ram for desktop and 2gm today. my computer have 6 GB of ram now, but in the index shows page windows ' 6gm ram (usable 3.18).» My system specs areWin 7 pro 32-bit nCore i3-540NVIDIA geForce 210Intel H57Biso: 6.14

  • BLOCKED INTERNET ACCESS

    MY QUESTION IS ABOUT everything THAT I'M LOOKING ON GOOGLE CHROME BE IT WWW.GOOGLE.COM ONLY SA JUST SHOW YOUR ACCESS to the INTERNET IS BLOCKED ON ONE SITE SA SHOWS THE SAME THING AND WHEN I CLICK ON DIAGNOSE the ERRORS of ITS DISPLAY NO ERROR FOUND.

  • Get the text from other text fields

    Helloon the title page of may document I put the date and the version number of my document. I want those to appear again on every page of my document, but not in the same place as and smaller than on the title page. So, I could simply create new are

  • NFS ODA persists even after the update applied

    Good morning guys,We have improved our ESXi Hypervisor from 5.1 to 5.5 U1 last weekend. I have read on the NFS ODA bug and downloaded the update scheduled to apply last nigth.~ # software esxcli vib install d ' "/ vmfs/volumes/4f27d555-e55efb08-0da4-