Assign the substitution variable to another variable of substitution with truncation of value

I launch sql * more script .sql through a competitor job. Simultaneous work provides date a parameter to the script.  Task log displays the date passed to scrpit as:

Arguments

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

2013/09/01 00:00:00

For aesthetic purposes in the position of the output, I want to convert/truncate the string in a format for the end user of the 09/01/2013.

Try to simply change a variable substitution

(below does not work, but we hope to Telegraph my intention):

Undefine Low_date
Set Low_date = ' 2013-09-01 00:00:00 '
Undefine Low_date_10
Set Low_date_10 = "yyyy-mm-ds."

Select substr ('& Low_Date', 1, 10) in & double Low_date_10;

Guest of "value of the Variable is: & Low_date_10.
/

WHICH PRODUCES:

old: select substr ('& Low_Date', 1, 10) in & double Low_date_10
New: select substr ("2013-09-01 00:00:00 ', 1, 10") in yyyy-mm-double ds

Error from the 8 in the command line:
Select substr ("2013-09-01 00:00:00 ', 1, 10") in yyyy-mm-double ds
Error in the command line column: 8:55
Error report:
SQL error: ORA-00905: lack of keyword
00905 00000 - 'lack the key word'
* Cause:
* Action:
old: prompt "value of the Variable is: & Low_date_10.
New: prompt "value of the Variable is: yyyy-mm-ds."
"Value of the variable is: yyyy-mm-dd"

"I need to get to" value of the Variable is: 01/09/2013.

Hello

SELECT... IN works in PL/SQL.

In SQL * Plus, you can use the COLUMN... New_value, like this:

SET low_date = ' 2013-09-01 00:00:00 '

COLUMN low_date_10_col new_value by low_date_10

SELECT REPLACE (SUBSTR ('& Low_Date', 1, 10))
, '-'
, '/'
) AS low_date_10_col
DOUBLE;

Value of the PROMPT Variable is: & Low_date_10

Tags: Database

Similar Questions

  • The session variable, NQ_SESSION. has no definition of value. (HY000)

    Hi all

    I use OBIEE 11.1.1.6.8 version and have deployed version 6.0 of BASEL RPD. When I go to the dashboard I get the below error

    Error
    View display error

    ODBC driver returned an error (SQLExecDirectW).

    http://192.168.1.18:9704/analytics/res/sk_blafp/common/errorminus.gifError details

    Error codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P

    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 43113] The message returned by OBIS. [nQSError: 23006] The session variable, NQ_SESSION. RPB_Tier1Capital, has no value definition. (HY000)

    SQL published: {call NQSGetQueryColumnInfo ("SELECT saw_0 FROM ((SELECT sum ("head of Accounting Standard in fact"." Standard Accounting head amount "(/1000000) saw_0,"Head of Accounting Standard"". "" Saw_1 head Accounting Standard identifier', '-D2061Legal entity Info "." Customer First Name' saw_2, VALUEOF (NQ_SESSION. RPB_Tier1Capital) saw_3, saw_4 3, '-Dimension Run D1008 '. " Run the Description ' | » -'' || CAST ('-D1008 run Dimension '. ' ") (Run surrogate key' AS VARCHAR (10)) saw_5 'Basel' WHERE ('head of Accounting Standard". ("' Chief Accountant standard identifier" = "CAP058") AND ("-D001 Date Dimension". "") (Date of extraction "=" 2013-10-04 ") AND (" '-D2036 Type of Cosolidation legal entity "". "") Basel consolidate Option Type Description"(" GROUP")) AND ("-Info entity D2061Legal "." ") (Client name' IN ("*) nqgtn(*'')) AND (" "-Dimension run D1008" "." ") Run the Description ' | » -'' || CAST ('-D1008 run Dimension '. ' ") (((Run surrogate key' AS VARCHAR (10)) IN ('Basel II Capital calculation-97000106'))) UNION (SELECT sum ("head of Accounting Standard in fact". "Standard Accounting head amount"(/1000000) saw_0, "Head of Accounting Standard" "." " Saw_1 head Accounting Standard identifier', '-D2061Legal entity Info "." Customer First Name' saw_2, VALUEOF (NQ_SESSION. RPI_TotalEligibleCapital) saw_3, saw_4 4, '-Dimension Run D1008 '. " Run the Description ' | » -'' || CAST ('-D1008 run Dimension '. ' ") (Run surrogate key' AS VARCHAR (10)) saw_5 'Basel' WHERE ('head of Accounting Standard". ("' Chief Accountant standard identifier" = "CAP210") AND ("-D001 Date Dimension". "") (Date of extraction "=" 2013-10-04 ") AND (" '-D2036 Type of Cosolidation legal entity "". "") Basel consolidate Option Type Description"(" GROUP")) AND ("-Info entity D2061Legal "." ") (Client name' IN ("*) nqgtn(*'')) AND (" "-Dimension run D1008" "." ") Run the Description ' | » -'' || CAST ('-D1008 run Dimension '. ' ") (((Run surrogate key' AS VARCHAR (10)) IN ('Basel II Capital calculation-97000106'))) UNION (SELECT sum ("head of Accounting Standard in fact". "Standard Accounting head amount"(*100) saw_0, "Head of Accounting Standard" "." " Saw_1 head Accounting Standard identifier', '-D2061Legal entity Info "." Customer First Name' saw_2, VALUEOF (NQ_SESSION. RPB_Tier1CapitalRatio) saw_3, 6 saw_4, '-Dimension Run D1008 '. " Run the Description ' | » -'' || CAST ('-D1008 run Dimension '. ' ") (Run surrogate key' AS VARCHAR (10)) saw_5 'Basel' WHERE ('head of Accounting Standard". ("' Chief Accountant standard identifier" = "CAP214") AND ("-D001 Date Dimension". "") (Date of extraction "=" 2013-10-04 ") AND (" '-D2036 Type of Cosolidation legal entity "". "") Basel consolidate Option Type Description"(" GROUP")) AND ("-Info entity D2061Legal "." ") (Client name' IN ("*) nqgtn(*'')) AND (" "-Dimension run D1008" "." ") Run the Description ' | » -'' || CAST ('-D1008 run Dimension '. ' ") (((Run surrogate key' AS VARCHAR (10)) IN ('Basel II Capital calculation-97000106'))) UNION (SELECT sum (case where "Accounting Standard head".)) «Standard accountant Chief identifier "=" CAP090 "then"fact head of Accounting Standard".» "" Flat rate of chief accountant "when

    Can someone help me please. I'm new and I have no experience with the available filters.

    The session variable, NQ_SESSION. has no definition of value. (HY000)


    This means that your init block does not work. Check the init block why its not leading is not to any data.

    only when the init block fails in the data, the server checks for the default value of the variable.

    Since there is no default value, you get this error.


    Init blocks can fail because

    1 connection pool does not work.

    2. the table or view does not exist

    3. no data in the table

    4. the filter in the sql in init block is not initialized if his coming of another variable of session.


    in general, no data should bring no results in a report.

    Since you have a session variable as part of the report, and this variable initialization failed, you get this error.

  • Value of the loop variable for begins with the last entry of the previous run

    I have a problem with a loop for... I am a beginner with Labview and perhaps do not follow the order of events (since it runs not on a line-by-line as typical of programming languages), but I think that my problem is trivial.

    Say I'm running a loop for 16 iterations and I want to build a table which, for example, consists of four 0s, 1 4s, four 2s and 3 four s.   I initialize the array outside and using shift registers to be added to the matrix in the loop for.

    However, the first time I run the program I get funky results.  In subsequent runs, the first value in my table is a 3, and the rest of the rest of the table is moved down by 1, so I did that three 3s at the end (for example).

    Can someone help me understand how to solve this problem?

    Thank you

    George


  • How to use the substitution with Adobe Edge Animation effect?

    For my site, I made an animation of an envelope opening and a letter from out of it. I would like to make a link to my email address, but first I want to make an interactive button. Is it possible to animate only when the mouse is on it?

    Hello Aidantoole,

    You need to do with animated along.

    1. make sure that "AutoPlay" is disabled in the properties of your onboard ptoject scene animate.

    2. then turn on game action (OnHover) at the beginning of the time line.

    This will not autoplay the animation and will play only if someone go over it.

    Let me know if you want me to share the detailed procedure.

    Kind regards

    Vivek

  • Out of Java simple assignment to a Variable

    Is it possible to have a variable in a package that is assigned a value returned by a call to the Java method so that I can use this variable across all interfaces in the package. Here's what I'd like to see (pseudocode)

    -Beginning of package execution
    -Java.util.UUID.randomUUID (m:System.NET.SocketAddress.ToString assing to variable 'UUID ()) '.
    -Run interface 1
    -#UUID in a field map
    -Run interface 2
    -card of the same value in a field #UUID
    -Start to end run

    Thank you
    Michael

    Yes it is possible. You must create an odi for this procedure. Inside of the odi procedure take technology java beanshell and write code like below.
    <>
    Java codes hoes here
    String java_v = "Chantal".
    Java codes hoes here
    @>

    Now drag this procedure in the odi package. Then, drag another odi odi package variable. Set mode assign the java variable to the odivariable as follows.
    <@=java_v@>

    Its done. Are you reeady to use variable odi everywhere wherever you need in a single package.

    Chantal
    http://dwteam.in

  • OBIEE 11g - the session variable, NQ_SESSION. VARIABLE, has no definition of value

    Hello

    I see a strange problem when using the SESSION variable in OBIEE 11 g SPR for the level of data security.

    The RPD, I created a new block with the PRODUCT session variable init and wise initialization line is defined.

    SQL -SELECT DISTINCT 'PRODUCT', product_id OF BI_SECURITY WHERE UPPER (USER_ID) is UPPER(':USER')

    Condition of data filter is defined on the tables & Dimension in the application role

    Filter data based on products assigned to the user in the security table is applied.

    User A has produced 15 assigned ID

    User B has 100 product ID assigned

    The user was able to connect to the presentation of OBIEE and see assigned product ID are filtered in the report.

    But when a user B signs he sees below error, when you run the same report

    [nQSError: 23006] The session variable, NQ_SESSION. PRODUCT, has no value definition

    Is there a limit on the number of values in session variable can contain.

    Why the error occurs only for user B?

    Has anyone encountered this problem?

    Thank you

    We found there is nothing in the list of the product id is assigned to user B, so report OBIEE failed with [nQSError: 23006]

    Adding a NULL value is NOT fixed INIT SQL block this problem with access from user B.

  • Help with the session variable PHP CS5.5 - Please

    Hi all

    I am needing a little help with the help of a session variable, and I hope someone can point me in the right direction.

    I created a PHP page that uses the Dreamweaver 'User authentication' feature and the basics of this works very well, to direct a user to the correct page depending on whether they are or are not a valid user. I want to customize the page 'user valid' with people, user name entered in the authentication of the user table... a seemingly simple task using a session variable, but I just seem not to be able to make it work!

    The generated code for the AU on page 1 is the following:

    <? PHP

    Validate request to connect to this site.

    If (! isset {})

    session_start();

    }

    $loginFormAction = $_SERVER ['PHP_SELF'];

    If (isset($_GET['accesscheck'])) {}

    $_SESSION ['PrevUrl'] = $_GET ['accesscheck"];

    }

    If (isset($_POST['txtfirst_name'])) {}

    $loginUsername = $_POST ['txtfirst_name'];

    $password = $_POST ['txtsurname'];

    $MM_fldUserAuthorization = "";

    $MM_redirectLoginSuccess = "member_update.php";

    $MM_redirectLoginFailed = 'login.php ';

    $MM_redirecttoReferrer = false;

    @mysql_select_db ($database_panto, $panto);

    $LoginRS__query = sprintf ("SELECT firstname, name OF web_access WHERE firstname = %s AND family name = %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $panto) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    $loginStrGroup = "";

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}

    Declare two session variables and assign them

    $_SESSION ['MM_Username'] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    If (isset($_SESSION['PrevUrl']) & & false) {}

    $MM_redirectLoginSuccess = $_SESSION ["PrevUrl"];

    }

    Header ("Location:".) $MM_redirectLoginSuccess);

    }

    else {}

    Header ("Location:".) $MM_redirectLoginFailed);

    }

    }

    ? >

    First of all, the text highlighted in red above seems to be setting the session variable that I need. Is this correct?

    If so, what is the code that I need to put on page 2 to use this session variable? or

    I have to do something else on the page 1 to correctly assign the session variable?

    Would be very grateful for your expertise

    Mark

    It seems that you put the columns incorrectly in the user authentication server behavior. This is the SQL query that checks the credentials of the user:

    $LoginRS__query = sprintf ("SELECT firstname, name OF web_access WHERE firstname = %s AND family name = %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    You are looking for first name and last name, while you should look for the user name and password of the user.

    $_SESSION ['MM_Username"] is a session variable that stores the login name of the user. To use it in a page, all that is needed is the page start with session_start(). You can then echo the value to display.

    If you want to display the person's true name, you must create a recordset in the second page, use of $_SESSION ['MM_Username'] to search for the first name and the patronymic. Alternatively, you can change the code like this (I copied only part of it):

    $LoginRS__query = sprintf ("SELECT firstname, surname OF web_access WHERE firstname = %s AND password is %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $panto) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    $loginStrGroup = "";

    $row = mysql_fetch_assoc ($LoginRS);

    $_SESSION ['full_name'] = $row ["FirstName"]. ' ' . $row ['name'];

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}

    Declare two session variables and assign them

    $_SESSION ['MM_Username"] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    You can then use $_SESSION ['full_name'] in a page which begins with session_start().

  • Error display session in the report Variable

    Hi all

    I created the session variable to display the current period of closed from the AP. Variable is etup as initialization of the sage line. The default values are assigned.

    When using this variable in report filter - I get the error message below. Please let me know what mistake I make.


    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 23006] The session variable, NQ_SESSION. CPG_AP_PERIOD_CLOSED, has no value definition. (HY000)
    Issued SQL: SELECT Time. "' Exercise ' saw_0 OF THE time WHERE 'Financial States - AP Transactions'. "' Exercise ' = VALUEOF (NQ_SESSION. ("' CPG_AP_PERIOD_CLOSED ') ORDER BY saw_0


    Thank you
    Poojak

    Session variables are associated with a users session. In other words, that it will be initialized when a user connects to OBIEE. Apparently, the session variable has not been initialized for your user. I don't know why, but you must check the file NQServer.log.

  • How to sort the shared Variable libraries

    I have large libraries SV in my project I want to sort by variable name.  I tried to export to Excel, sort and then import them into the library, but the type did not appear.  It looked like loading each variable then the multiple variables Editor opens with the original (unsorted) list I pressed the fact and then is back to were I started.  Any ideas?

    "In LabVIEW, you can sort variables shared libraries by right-clicking on the library" arrange by "name.

  • Result re set assign the question.

    Just a matter of a novice. I have a code like

    ResultSet rs = psmt.executeQuery ("a request here");

    iterate on the rs.

    RS = psmt.executeQuery ("some other request here");

    on Finally,.
    RS. Close();

    My question is will it create two instance on rs and the other closed left and another cavities not blocked or will he close the two ResultSet?

    Kind regards
    A.

    Ananth Durai says:
    The real question is on the issue finally {rs.close}, will it be close instance?

    No, it won't. Close() is called on the currently referenced object. This is why I pointed out that you should close when done with them resources. Before even thinking of assigning the same variable to another instance and before the variable is out of range.

    If you need two sets of results in the same scope, use two variables. You can close both in the same finally block.

    It will cause the memory leak?

    No doubt. I don't do JDBC, so I'm not going to say categorically that it will be.

    DB

  • Assign the activity overwhelming data transformation

    I created a BPEL process that has the following sequence:
    Transform1-> Invoke1-> Transform2-> Invoke2-> Assign--> adapter InvokeB2b

    Now what happens is that the payload created in the first transformation is overwritted after the invoke in the second transformation. The payload created in the second transformation is not to be replaced by the entitlement, so the output load has just the values that were in the last beneficiary. I have the same variable I update in the two transformations and assign. What should I do so that the output contains all values beginning with the first transformation?

    I'd really appreciate a quick response...
    Thank you very much!!
    POOJA-

    Create different variables for each transformation. Within the entitlement, obtain the required data for these two variables (defined for processing) and assign the output variable.

  • Assign the numeric value of Substitution Variable?

    What I try to do is:

    Read a CSV file via the unix shell and choose some columns in each row
    Transmit the data to a MaxL Script
    Assign the data passed to substitute variables in the MaxL script.

    Problem:

    Two of the columns contain digital data (for example: 0.5 or 60 etc..) I want to set the substitution variables in these digital data (without the quotes). I tried to use

    Edit the < app and cube name > database variable 'Variable' $1;

    but it gives me error
    ERROR - syntax error 1242021-1 ['. 5']
    I tried with quotes single and double, but they value the value of the variable $1

    If I manually set the value of this Variable through the Regional service to 0.5, everything works perfectly. Any ideas on how to do this? the Ser60 does not provide a solution.

    An example is

    startMaxl scriptname.mxl "0.5"

    alter database appname.dbname set variable "VariableName" $1;

    or

    startMaxl scriptname.mxl 0.5

    alter database appname.dbname set variable "VariableName" ' \'$1\' ";

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Why the operator: = is not working when it is in a string concatenated and assigned to a variable?

    I met with an error ORA-00904: "V_DEPTNO": online: 14 (My PL/SQL code is below), while playing with the cursor of reference (for the end of the apprenticeship).
    I debugged it and the problem was solved and it returns the desired output.  However, the solution of it is not sensible for me even if the output
    has been posted/successfully recovered.    Here's a clearer description of the code:


    On line 14, I have a variable called stmt and stmt value concatenated with the string "where deptno =: v_deptno' and then finally assigned to this stmt variable."

    In this line, he returned ORA-00904 but it was fixed by using =: operator instead of the = operator.

     stmt:=stmt || 'where deptno=:v_deptno'; 
    

    In sql pure when it is intended to add where clause for such purpose, the = comparison operator is used.
    Example:

    Select empno,ename,sal from emp where deptno=10;
    

    But in my pl/sql code, =: operator was used.

    Why is this? Can someone explain what it is? Even if I did my research, but I couldn't find the explanation yet.

    All what I've understood so far, is that this may mean the following (I may be wrong):
    1 - everything first, assign the value 10, of v_deptno, who was declared, to easily compare.
    2. compare the value assigned with deptno.
    On this basis, recover data.


    Thus, he worked as a = + tour operator defined in another high programming language such as c#... etc.
    Example:

    int a = 0;
    
    a =+ 1;    //  a was declared as an integer that has value 0
            // then  we tried to increment by 1 or add by one
             // so it would be  a=a+1;  
                    //which is  a=0+1;
    

    It works the same?

    Here's my complete code pl/sql, just in case...

    --ref cursor
    declare 
    
    type emp_refcur  is ref cursor;
    emp_cv emp_refcur;
    emprec emp%rowtype;
    stmt varchar2(299):= 'select * from emp';
    v_deptno number:=10;
    
    begin
    
    if v_deptno is null then
      open emp_cv for stmt;
    
    else
      stmt:= stmt || ' where deptno=:v_deptno';
      open emp_cv for stmt using v_deptno;
    end if;
    
    loop
    fetch emp_cv into emprec;
    exit when emp_cv%notfound;
    dbms_output.put_line(emprec.empno||chr(9)||emprec.ename||chr(9)||emprec.deptno);
    end loop;
    close emp_cv;
    end;
    /
    
    
    
    
    
    
    
    

    I would you to explain and share with me something to read or give me some clues.

    Thanks in advance!

    In this line, he returned ORA-00904 but it was fixed by using =: operator instead of the = operator.

    There is no "=:" operator.

    The colon character ': ' is used to define a binding (placeholder) variable in the query string.

    The value of this variable must be passed ("linked") after analysis and run step so that the query is executed correctly. That's what the USING clause in your code.

    Thus, he worked as a = + tour operator defined in another high programming language such as c#... etc.

    Example:

    1. int a = 0;
    2. a = + 1;    one has been declared as an integer that is set to 0
    3. then we tried to increment by 1 or add one
    4. so it would be a = a + 1;
    5. which is a = 0 + 1;

    It works the same?

    No, nothing to do with it.

  • How to use the substitution in case of construction dim variable

    Hi all

    Lets say I have 3 void / vars - Prevmonth prevmonth-1, prevmonth-2. These change every quarter.

    I want to build a cube that will be who will have only 3 months preceding the fiscal dimension. This will serve once at the end of the quarter.

    What should I do for the substitution if build rules files variables dim? I want to automate the process. We have Sun for other dims build SQL, only the Sun can be built as flat file.

    Or y at - it another way to do this Besides using sub vars? I can try to store 3 variables in a table and then use them to create the cube, but want to see if we can avoid creating an interface more.

    Thank you.

    You can use substitution variables, as in the SQL of the charge state - rules for the Substitution Variables

    See you soon

    John

  • assign the session as the default value of a command prompt variable

    Hi, experts,

    is it possible to assign the session as the default value of a command prompt variable?

    I would attribute the full name of the user of the connection to the default value of a prompt!

    Thank you!

    In the value default of / writing SQL results:

    Select
    case
    When 1 = 2 then table.column
    of another valueof (nq_session.user)
    end
    the area"presentation".

    The table.column must be the type of character data.

    Concerning
    Goran
    http://108obiee.blogspot.com

Maybe you are looking for