Set Variable to Recordset column value

I want to set a new variable to value of a column in a
recordset on the page. I tried this but the sytax is causing
browser errors:
<?php $myEndDate = $row_rs_getRenew['ordDateEnd'];?>
This column in the recordset contains a subscription end date
and is of data type DATE.

What is your recordset name? You are setting the variable
correctly.
from below, your recordset should be named rs_getRenew, si
that right? Can
you set other variables froim the recordset?
Have you tried printing the recordset directly and making
sure it contains
info?
if (RS['field] != ''){
$var = RS['field'];}
else { echo 'empty recordset';}
"harrilljj" <[email protected]> wrote in
message
news:e9o73p$edo$[email protected]..
>I want to set a new variable to value of a column in a
recordset on the
>page.
> I tried this but the sytax is causing browser errors:
>
> <?php $myEndDate =
$row_rs_getRenew['ordDateEnd'];?>
>
> This column in the recordset contains a subscription end
date and is of
> data
> type DATE.
>
>

Similar Messages

  • Using Spry Data Set Variable in Recordset

    I have a page that contains a spry data set and a recordset. The recordset uses one of the variables from the spry data set to filter its results. how do I apply the spry data set variable to the recordset?

    I believe passing this the variable through the URL requires you to update the page, right?
    Yes
    Is there anyway to grab the spry data set variable direct and apply it to your recordset filter?
    The SpryDataSet variable can only be used on the clientside (JavaScript) so you will have to get your recordset using JS.
    A page refresh can be set in motion if you add {useCache: false, loadInterval: 500} to your dataset to then set an observer to your dataset to invoke the page refreash function.
    Gramps

  • Assigning variable to a column value

    Hi,
    I am creating a report wherein I use a formula in one of the columns to forecast data. The values obtained in this column (as a result of application of the formula) is to be used to calculate the values for the second column.And the third column value is dependent on the second and so on....
    If I use the column formula directly,then many lines of coding are involved...Is it possible to store the value of a column in a variable and hence forth use it for manipulation in subsequent columns?

    Helios,
    I'm already having the same setup mentioned in the thread. And I'm doing exactly whats given there. But the issue seems to be something different. I'm assigning the value to the Global Variable in the Package through Apex. Here's the Package Code:
    CREATE OR REPLACE PACKAGE Schema1.SPMS_SECURITY_PKG
    AS
    X_app_user_id NUMBER DEFAULT -1;
    FUNCTION USER_ID RETURN NUMBER;
    END SPMS_SECURITY_PKG;
    CREATE OR REPLACE PACKAGE BODY Schema1.spms_security_pkg
    AS
    FUNCTION user_id
    RETURN NUMBER
    IS
    BEGIN
    -- RAISE_APPLICATION_ERROR(-20001,'USER ID'||'*'||X_app_user_id);
    RETURN NVL (x_app_user_id, -1);
    -- RETURN NVL (sys_context('USERENV', 'CURRENT_USER'), -1);
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN -1;
    END;
    And Here is the Trigger Code:
    CREATE OR REPLACE TRIGGER Schema1."USER_DETAILS_TRIGGER"
    BEFORE INSERT OR UPDATE
    ON PMS_SICAL.SPMS_USER_DETAILS REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF INSERTING
    THEN
    :NEW.created_by := spms_security_pkg.user_id;
    :NEW.created_date := SYSDATE;
    :NEW.START_DATE := SYSDATE;
    ELSIF UPDATING
    THEN
    :NEW.updated_by := SPMS_SECURITY_PKG.X_app_user_id;--spms_security_pkg.user_id;
    :NEW.updated_date := SYSDATE;
    END IF;
    END;
    But I always get -1 in the both in the table after the DMLs.

  • Set variables from recordset

    I have an SQL table that I store OrderID, ItemID, Qty.  There are 15 possible ItemID's (will never be more).  I need to output the order into a single table row that shows the orderID and the qty for each item.
    For example:
    <cfquery name="orders" datasource="xyz"
    Select *
    From solditems
    Where orderid = 'Order1"
    </query>
    Would return something like:
    Order1, Item3, 6
    Order1, Item4, 7
    Order1, Item18, 10
    The table needs to look like:
    <tr>
    <td>#orderID#</td>
    <td>#item1qty#</td>
    <td>#item2qty#</td>
    <td>#item3qty#</td>
    <td>#item4qty#</td>
    <td>#item5qty#</td>
    <td>#item6qty#</td>
    <td>#item7qty#</td>
    <td>#item8qty#</td>
    <td>#item9qty#</td>
    <td>#item10qty#</td>
    <td>#item11qty#</td>
    <td>#item12qty#</td>
    <td>#item13qty#</td>
    <td>#item14qty#</td>
    <td>#item15qty#</td>
    </tr>
    I'm at a loss trying to figure out how to match the row from the results of the record set into the right #itemXqty#.
    Hope I explained this well and thanks in advance for pointers in the right direction!
    Gary

    You could do something like
    <cfoutput><table border="1"><tr><th>#orders.orderID#</th></cfoutput>
    <cfoutput query="orders">
        <td>#itemID##qty#</td>
    </cfoutput>
    </tr></table>
    For a start, your query would be more efficient using "select orderID, itemID, qty" instead of "select *" (assuming, of course, that the table has more than the 3 columns).

  • How to set column value dependend on other column value?

    I have a view that selects values from 2 tables with some simple additional joins. Now, i would like to add a column (boolean/bit or varchar2) that represents a flag and is dependen on the value of another column, e.g.
    ID | Value | Flag
    1 | 4711 | 1
    2 | null | 0
    So, the flag should be set to 1 if column 'Value' is not null and to 0 if column 'Value' is null. (In another case, i would like to test for specific values, not just null). How can i do this in ORACEL SQL?

    This statement will update two flag columns. FLAG1 is set to one or zero depending on whether COL1 is null. FLAG2 is set to one of a range of values depending on whether COL1 is a specific value; the default value is ZERO.
    UPDATE your_table
    SET    flag1 = nvl2(col1, 1, 0)
           , flag2 = decode(col1, 5677, 1, 2212, 2, 6276, 3, null, 4, 0)
    /Cheers, APC

  • How to copy a column value in to a variable in Dataflow task?

    Hi All,
    I want to copy a column value to a variable inside the data flow task. Which is the best way to achieve it in SSIS?
    Thanks,
    Sri

    Unless its a conditional based query which returns a single value it doesnt make sense to store result in a variable.
    If query resultset has multiple values then you cant store them in a variable unless its of type object. The easiest way to store values in that case to object variable is by using execute sql task and then setting resultset option as full resultset. Once
    stored you can use for each loop with ado enumerator or script task to iterate through values of resultset.
    Perhaps you could give us some idea on what you're trying to achieve
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Set variable value from a query - is it possible?

    Hi all,
    I need to use a 'precalculated' value in my report measures' calculations.
    Is it possible to set a variable value as a result of a query?
    Thanks in advance,
    Alex

    Hi,
    In my report, I need to calculate one of the columns as a [certain measure] / [result of another query]
    I didn't succeed to include the [result of another query] as a column in my report's request, but it would be very easy to calculate this [result of another query] separately.
    The [result of another query] value is same for all the rows of my report.
    What I'm trying to do is to run a query before my report (e.q. in the Prefix section), set a variable = [result of another query] and then use this variable in the column calculation of the report.
    Is this possible?
    Thanks,
    Alex

  • Setting bind variable to a different value if its null

    Hi,
    I have a report page which displays a table. One of the parameters of the sql query that generates this table is an apex bind variable.
    I want the page to to run a different sql query depending on whether the bind variable is blank or not.
    How can I do this in Apex without having to do use a function?
    It would be good if I good reset the bind variable to another value (generated from a different sql statement) when the page loads.
    Thanks
    Edited by: sam on 17-Feb-2011 07:43

    Hi,
    Thanks, that's really helpful.
    I'm passing a value (:P1_VAR1) as null from page 1 to page 2. On page 2 I have a table with the first column showing primary keys that have links.
    When the user clicks on the link, it refreshes page 2 and sets the value on session :P1_VAR1 to the value of the primary key of the record clicked.
    However, the problem is that when the user goes from page 1 to page 2, I want the :P1_VAR1 to be initialised to the first primary key record from the first record on my table.
    I have a function that gets the id of the first record on my table but I don't know how to set the :P1_VAR1 to this value by modifying the item settings in APEX.
    Please can someone help and give me an example on how this is done?
    Thanks
    Edited by: sam on 17-Feb-2011 07:49

  • How to swap column values using variable in sql?

    Hi,
    I have a table and i want to swap two column values using variable
    please help me

    Hi,
    Let us assume that the DeptNAME and DeptNo columns are of type VARCHAR2. However, DeptNO column is VARCHAR2(10) and DeptNAMe is VARCHAR2(100).
    First of all DeptNo column needs to be modified to be 100.
    i) ALTER TABLE DEPT MODIFY DEPTNO VARCHAR2(100);
    Secondly, you will swap DEPTNAME and DEPTNO values using the SQL as follows:
    ii) update dept t1
    set deptname = (select deptno from dept2 t2 where t1.deptno = t2.deptno),
    deptno = (select deptname from dept2 t2 where t1.deptno = t2.deptno);
    Now, finally you want the deptname columns to be VARCHAR2(10)
    iii) ALTER TABLE DEPT MODIFY DEPTNAME VARCHAR2(10).
    If DEPTNO is a NUMBER column, you cannot alter the datatype unless the table is empty; in that case the whole swapping requirement would be moot.
    Trinath Somanchi,
    ( http://www.myospages.com )

  • How To Capture A Column Value In A Report And Store It In A Variable?

    Portal Version: 3.0.6.6.5
    RDBMS Versjion: 8.1.7.0.0
    OS/Vers. Where Portal is Installed:: SunOS 5.8
    I have a Portal report where I added a checkbox for each row of data that is being displayed. The user can select checkbox for as many rows as he/she wants. The user can then click a button, which iteratively passes the value of a column as a parameter to a procedure.
    I am using the Portal field that ends with a ".FIELD#>" For example, if my report is based on the following SQL statement:
    SELECT EMP_UNID FROM EMPLOYEES WHERE STATUS = 'E'
    Then the field I am using to capture the value is <#EMP_UNID.FIELD#>
    So the <INPUT> looks like:
    <TD>
    <INPUT TYPE="checkbox" NAME="checkboxSelect" value="<#EMP_UNID.FIELD#>">
    </TD>
    And the Javascript code looks like:
    htp.p('<SCRIPT LANGUAGE="JavaScript1.1">');
    htp.p('<!--');
    htp.p('function runAccept() {');
    htp.p('for (var i=0; i<20; i++)');
    htp.p('if (document.formSelect.checkboxSelect.checked == true)');
    htp.p('{');
    htp.p('myRegExp = /"/gi;');
    htp.p('parameter = document.formSelect.checkboxSelect[i].value.replace(myRegExp, "z");');
    htp.p('parameter = parameter.substring(parameter,parameter.indexOf(">")+1,parameter.lastIndexOf("<")-1)');
    htp.p('alert(parameter);');
    -- htp.p('CallableStatement cstmt = null;');
    -- htp.p('cstmt = conn.prepareCall("{call --runAcceptRecord(parameter)}")');
    -- htp.p('cstmt.execute ();');
    htp.p('}');
    htp.p('}');
    htp.p('//-->');
    htp.p('</SCRIPT>');
    The problem, however, is that Portal stores not only the actual value in <#EMP_UNID.FIELD#>, but also some HTML tags, most of which can be removed via the Display Options page. There are some tags that cannot be removed in this fashion, because Portal does not allow nulls in those. So we are stuck with an HTML tag (i.e. <FONT SIZE>) that is stuffed in that variable along with the value. The problem is further complicated by the existence of double quotes within that tag that undesirably terminates the VALUE assignment.
    So for instance, what you might get from Portal is this:
    <TD><INPUT TYPE="checkbox" NAME="checkboxSelect" value="<FONT SIZE="+0">219</FONT>"> </TD><TD ALIGN="RIGHT"><FONT SIZE="+0">219</FONT></TD>
    <TD ALIGN="LEFT"><FONT SIZE="+0">E</FONT></TD>
    It is in the value="<FONT SIZE="+0">219</FONT>" part of the code where the extra double quote is terminating the Javascript code. I have tried escape() and replace() to remove the extra double quotes, but have not got it to work. The problem is happening too early at this point, and what I have tried is after the fact.
    Obviously, the problem is that I shouldn't be using <#EMP_UNID.FIELD#> since the intent of this is to add html tags for display purposes. That is done by Portal, and I thus have no control over it unless I take drastic means and modify Portal's innerworkings, which I don't care to do.
    My question therefore is, what other variable can I use in Reports to capture just the value? I am hoping that there is a variable in Reports like the ones for Forms which has a prefix of A_. Or is there another method for doing this?
    Thanks in advance
    Fred

    I found htf.formcheckbox function which was what I needed. With that, my javascript code was cut down to just a few lines. Didn't need to strip away the html tags. This function will just return the value.
    Refer to:
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=116534.1 for specific example of this function.
    http://technet.oracle.com/doc/appsrvr4082/guides/plsql_r.pdf for a reference list of all htp's.

  • How i pass table column  value to string variable or return to java applete

    Hi Master,
    How do I pass a table column value into string variable. See my code below:
    import java.sql.*;
    public class Waheed {
    public Waheed() {
    public static void main (String args [])
    String s = "9 23 45.4 56.7";
    System.out.println ("going for connection");
    // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select accid from accbal");
    System.out.println ("going for connection");
    while (rset.next())
    s= rset.getString("accid"); this line give me error
    System.out.println (rset.getString("accid"));
    System.out.println (s);
    catch(Exception e){
    e.printStackTrace();
    This line give me an error:
    s= rset.getString("accid");
    s is string variable
    Plese give me an idea how I can pass accid in s variable.
    Thanks.
    Aamir

    See the code sample in the following thread (try using upeercase).
    JDBC  connection
    Kuassi

  • Error trying to run SSIS Package via SQL Server Agent: DTExec: Could not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object

    Situation:
    SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
    Windows 7 - 64 bit.
    The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
    It uses 3 package variables:
    *) SQLCommand (String) to specify the SQL Statement to be executed by the package
    Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
    Value: f:\Output Data.xls
    *) EXCELOutputFIle (String) to specify path and filename of the Excel output file
    Property path: \Package.Variables[User::SQLCommand].Properties[Value]
    Value: select * from CartOrder
    *) VarObjectDataSet (Object) to hold the data returned by SQL Server)
    Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
    Value: System.Object
    It consists out of 2 components:
    *) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
    *) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
    Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
    However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
    This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only.  This makes me wonder if it is uberhaupt possible to set the value of a package variable
    of type Object.
    Can anybody help me on this please ?
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  6:40:20 PM  DTExec: Could
    not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object.  Started:  6:40:20 PM  Finished: 6:40:21 PM  Elapsed:  0.281 seconds.  The package execution failed.  The step failed.
    Thank you very much in advance
    Jurgen

    Hi Visakh,
    thank you for your reply.
    So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
    I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
    first question about the object type package variable.
    Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
    Thx in advance
    Jurgen
    Yes exactly
    You need to set values only forthem which needs to be controlled from outside the package
    Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
    Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to restrict a table with its set of data based on a column value in it?

    Hi,
    I have a scenario in which I have to show a set of data of a pivot table by restricting data based on a column value. I am creating BIP report whose source is from BIA ie.RPD. Based on a column value I want to restrict the data being displayed in the table. Since I also want the hidden data in the first table to be displayed in another table in the same report I cannot restrict the data at the query level i.e at RPD or at BIA. For this reason I used
    <?xdofx:if saw3_ = 1?>
    the pivot table
    <?end if?>
    But it does not restrict any data.
    Also I tried using the if condition inside the table before the row level looping happens. But no good show even then.
    How can I forgo this problem?
    Regards,
    The MM

    Hi,
    See : http://download.oracle.com/docs/cd/E12096_01/books/PubUser/T421739T481157.htm#4535373 regarding column and row.
    Regards,
    Colectionaru

  • How to put a variable column value in a "vlookup"

    Hello there,
    I am trying to put a variably chosen column value in a "vlookup" function.
    Logically this should work, but it does not, and I cannot figger out why.:
    "=vloookup("a", B5:Z28, {=MATCH(4, B4:Z4, 0)})" (replaced brackets with {} for this post)
    I am trying to look up the letter "a" in whatever column matches the "match" criteria.
    The match is matching a specific value of 4 from row B. (This value varies based on other input)
    The vlookup is for finding the letter "a" the whole table in whatever column is returned by the MATCH formula.
    How can I do this?
    (Like I said the formula above is logically correct, but numbers returns a syntax error.)
    Thanks from Alaska
    Message was edited by: John Boyarsky
    Message was edited by: John Boyarsky
    Message was edited by: John Boyarsky

    John,
    Next get rid of the brackets you referred to; unnecessary. If that doesn't do it, calculate the column number in an auxiliary column and refer to that column in your expression.
    Jerry

  • How to set variables values via VBA.

    Anybody please help.
    How to set variables values via VBA in workbook. SAP Netweaver 2004s.

    Pass variable values with VBA and BI 7.0 funtions to Query
    At first a remark u2013 Iu2019ve read a lot of threads saying that passing values to a query can be done by using VBA code only. Iu2019ve tested it but Iu2019m not sufficient with the new BEX 7.0 API and therefore I use a mixture of BEX 7.0 funtionality and VBA. I create a BEX 7.0 design item button passing the values to a query u2013 I hide this button somewhere on the sheet or on a hidden sheet and I then raise the event to click the button from VBA code. Works fine and the maintenance is easier if something changes in the API in the future again.
    How to start:
    Switch to design mode in BEX Analyzer:
    Implement a BEX 7.0 design item u201Cbuttonu201D
    Click on the button to implement the properties
    Make the input for the commands
    data_provider = dataprovider_1
    cmd = process_variables
    subcmd = var_submit
    No comes the part with the variables u2013 Letu2019s assume a query has 4 variables but you only want to change 1 with the button u2013 an organizational unit for instance.
    Make a range somewhere in the excel with the following structure:
    Name    Index   Value
    VAR_NAME_1      1       Variablename
    VAR_VALUE_EXT_1 1       variablevalue
    Value should contain the name of your variable of course and u201Cvalueu201D the value of your variable
    Set a name for this range with EXCEL functionality but without the header:
    Back to the properties of the button: Insert the name of the range with the variables in the field Command Range:
    If you have more variables to process you can of course enhance your Filterrange!
    In the left upper Corner you have a name for your button:
    Now you can raise the button-click in vba like this:
    Application.Run "'" & ThisWorkbook.Name & "'!Sheet2.BUTTON_35_Click"
    regards, Lars

Maybe you are looking for

  • How can I stop shared files in iBooks being highlighted by different family members?

    I Have family sharing set up which is great for sharing apps and music however I have a problem with iBooks. My wife and I both use ePub files which a re study material. The great thing about these is that we can highlight and add notes to files. THe

  • Image processor always on top?

    When I use image processor (launched by Photoshop or Bridge) Photoshop  go in front (top window) each new picture processed, means every  seconds. It's pretty annoying cause I can't even keep a browser in front... Does anybody have the same problem?

  • Mac Mini 2011 Tech Tool Pro 7

    Hello, I recently bought Tech Tool Pro 7, in ABOUT THIS MAC the info says (Mac mini MID 2011) but when I used for the first time Tech Tool Pro 7, the info was in the report was different, and the report says MAC MINI 2012, LOCATION CHINA... Any ideas

  • Positng error

    Error in document: HRPAY 0000029622 SP1_090 Field Trans.type is a required field for G/L account 106 16370000 Do not assign any objects in cost accounting to account 16370000 I am getting the followinig error in when doing the posting to Finance. Can

  • Writeback from OBIEE to Essbase

    Hi All, We have a requirement to Writeback from OBIEE into Essbase. We are using OBIEE 11.1.1.5.0 & ESSBASE 11.1.2.1.0 Version. Has anyone done this before? Any pointers would be appreciated Thanks, Shyam