How to (in Pro*C) pass a cursor variable as a pointer between functions

I am opening a cursor in a called function that accepts as one argument a pointer to a cursor variable, and a second argument for the sql string defining the cursor select. That works fine, and in that same function can successfully fetch and access the records from the cursor. However, my objective is to fetch the records in another function that calls the first function. I want to pass back to the calling function the pointer to the cursor variable from the first function. In the second (calling) function, is where I want to fetch the records. What I am getting is SQLCODE = -1002 (fetch out of sequence).
Here is the relevent code in the first called function that calls a PL/SQL package procedure to open the cursor, followed by the code in the second calling procedure where I am attempting to fetch the records:
/******Called function code starts here ******/
EXEC SQL INCLUDE SQLCA;
long db_makeCursor(cursorID, SQLstr)
EXEC SQL BEGIN DECLARE SECTION;
sql_cursor cursorID;      / a pointer to a cursor variable */
char *SQLstr;
EXEC SQL END DECLARE SECTION;
long SQLCODE;
EXEC SQL BEGIN DECLARE SECTION;
sql_cursor dbCursor; /* a cursor variable */
EXEC SQL END DECLARE SECTION;
EXEC SQL WHENEVER SQLERROR DO sql_error();
dbCursor = *cursorID;
EXEC SQL EXECUTE
BEGIN
db_util_ref_cursor_pkg.open_dbNameCursor( :dbCursor, :SQLstr );
END;
END-EXEC;
return;
/******Calling function code starts here ******/
EXEC SQL INCLUDE SQLCA;
EXEC SQL BEGIN DECLARE SECTION;
static PROCLOG PROC_Rec;
EXEC SQL END DECLARE SECTION;
long retrieveProcesses( _proclog, sqlForProcLog )
EXEC SQL BEGIN DECLARE SECTION;
PROCLOG _proclog;
char *sqlForProcLog
EXEC SQL END DECLARE SECTION;
long rc;
long SQLCODE;
EXEC SQL BEGIN DECLARE SECTION;
sql_cursor dbCursor; /* a cursor variable */
sql_cursor cursorID;      / a pointer to a cursor variable */
PROCLOG proclog;
short end_ts_ind;
short proc_name_ind;
short comments_ind;
EXEC SQL END DECLARE SECTION;
cursorID = &dbCursorName; /* assign a value to the pointer */
EXEC SQL ALLOCATE :dbCursor;
rc = dbUtilities_makeCursor( cursorID, sqlForProcLog);
if (rc == TRUE)
while (SQLCODE == 0)
EXEC SQL FETCH :dbCursorName INTO
:proclog.PROC_ID,
:proclog.START_TS,
:proclog.END_TS:end_ts_ind,
:proclog.PROC_NAME:proc_name_ind,
:proclog.COMMENTS:comments_ind,
if (SQLCODE == 0)
printf("PROC_ID: %d; COMMENTS: %s\n",proclog.PROC_ID, proclog.COMMENTS);
} /* end retrieveProcesses */

You need to include a loop...
for i=0;i<sqlca.sqlerrd[2];i++)
printf("name %s\n", struct.name)
This allows you to step through your cursor records!!!

Similar Messages

  • How do i create and pass a global variable from one vi to several sub-vi's?

    Hi Guys,
    I am trying to create a program that opens several front panels (sub-VI's) in sequence. in each front panel, the user would open a file that the name is obtained from the previous sub-VI. I would like to know how i could pass the filename and refnum of the file thorough from one sub-vi to another. A global variable would do it in VB, but how do we do global vars in LABWIEW. thanks
    Papish

    I put together a sample VI and Sub VI that illustrates how to pass a Refnum and access a data file while in a Sub VI.
    For multiple VIs just repeat the sub VI process.
    You probably don't wanna use a Global Variable if not needed (can add to the mess down the road haha).
    Let me know if it helps you out! Or if I can clarify anything else!
    Chances are if you have seen VI in the forest it hasn't fallen.
    Attachments:
    Passing Refnum.zip ‏21 KB

  • Cursor variable in a Java program

    Hi all,
    I would like to know is how to explicitly pass a cursor variable to a stored procedure after defining it in the java source and to get the result back to the same variable.
    An example would be appreciated.
    Thanks in advance
    Giridhar

    I think java profiler can do the job. There are sharewares i know of like JSprint and JProfiler.

  • How to pass a litral string into cursor variable?

    Hi All
    I have a code like below:
    I need to select the following table,column with the criteria as such but it looks like the literal string does not work for cursor variable.
    I can run the SQL in sqlplus but how I can embed that in PL/SQL code??
    -Thanks so much for the help
    cursor ccol2(Y1 varchar2) is select table_name,column_name from user_tab_columns
    where table_name like 'HPP2TT%' and table_name like '%Y1'
    and column_name not in ('MEMBERID');

    Literal strings are fine in a cursor, however, your logic is likely wrong, and you are not using the Y1 parameter to the cursor correctly. If you are looking for tables that either start with HPP2TT or end with Y1 (whatever you pass as Y1), then you need something more like:
    cursor ccol2(Y1 varchar2) is
    select table_name, column_name
    from user_tab_columns
    where (table_name like 'HPP2TT%' or
           table_name like '%'||Y1) and
          column_name not in ('MEMBERID');In the unlikely event that you are lookig for table that actually do start with HPP2TT and end in whatever is passed in Y1 then your query could be simplified to:
    cursor ccol2(Y1 varchar2) is
    select table_name, column_name
    from user_tab_columns
    where table_name like 'HPP2TT%'||Y1 and
          column_name not in ('MEMBERID');Note in both cases, a single member in-list is bad practice, although Oracle will transform it to an equality predicate instead.
    John

  • How to pass a cursor as IN parameter to a procedure

    Hello
    I want to pass a cursor to a procedure as IN parameter.
    See the below piece of code:
    Cursor mycur is select * from table_name;
    Procedure myproc(mycur IN ...)
    begin
    fetch mycur into v_rec;
    {want to do some updates here}
    end;
    Please suggest how can I pass the cursor?
    Thanks in advance !!!!

    793059 wrote:
    I want to pass a cursor to a procedure as IN parameter.You can use the PL/SQL type called sys_refcursor - and open a ref cursor and pass that to the procedure as input parameter.
    Note that the SQL projection of the cursor is unknown at compilation time - and thus cannot be checked. As this checking only happens at run-time, you may get errors attempting to fetch columns from the ref cursor that does not exist in its projection.
    You also need to ask yourself whether this approach is a logical and robust one - it usually is not. The typical cursor processing template in PL/SQL looks as follows:
    begin
      open cursorVariable;
      loop
        fetch cursorVariable bulk collect into bufferVariable limit MAX_ROWS_FETCH;
        for i in 1..bufferVariable.Count
        loop
          MyProcedure( buffer(i) );   --// <-- Pass a row structure to your procedure and not a cursor
        end loop;
        ..etc..
        exit when cursorVariable%not_found;
      end loop;
      close cursorVariable;
    end;

  • How to pass a CURSOR as an input in a Stored Procedure ?

    Hi all
    I am using Java to work with 2 Oracle DBs, using JDBC.
    I've got a question about using a Oracle Stored Procedure with CURSORs :
    A first stored procedure gets data from the first DB (returns a CURSOR) and I'd like to pass this CURSOR to the second stored procedure as a (Java) IN parameter, so using a "getObject()" then a "setObject()", to insert data from the CURSOR in the second DB.
    This is the theory !
    En reality, the first stored procedure works fine, and returns the cursor, but after that ... I can't even create the second stored procedure. I planed to do something like the following stuff :
    CREATE OR REPLACE PROCEDURE proc_insert_data(cur_ref IN OUT types.ref_cursor) AS
    BEGIN
    LOOP
    FETCH cur_ref INTO FIELD1, FIELD2;
         INSERT INTO TABLENAME VALUES (FIELD1, FIELD2);
    EXIT WHEN cur_ref%NotFound;
    END LOOP;
    END proc_insert_data;
    with a LOOP for each row and then an INSERT.
    But this doesn't seeem to be correct.
    Has anybody an idea to make this stored procedure to work ?
    Thx in advance
    Krystoffff

    Hi Chris,
    When you want to pass a CURSOR to a procedure/function
    you will have to employ a package here. Create a package
    which contains both of your procedures.This package should have a global variable which is of type ref cursor.The IN parameter for the 2nd procedure and the OUT parameter of the first proc should be of type this global cursor var.
    Now you call the first procedure and get the resulting cursor from it, pass it to the second procedure...
    Good luck.
    Regards,
    Madhu

  • On my Mac Pro how can I get voiceover to start reading at a specific point on a document?, on my Mac Pro how can I get voiceover to start reading at a specific point on a document?

    On my Mac Pro how can I get voiceover to start reading at a specific point in a document, and then continue on to the next paragraph and so on?  Thank you.  Ed

    Welcome to the Apple family!!!! 
    How can I cause the VO cursor(box) show-up/start?
    Press Control-Option and F5.   The F5 key is located on the top row of keys 6th key over.  This is a toggling "Keyboard Shortcut" for turning VoiceOver on and off.
    How can I move the VO cursor to various sentences or paragraphs of an article and have it start reading ... and perhaps even continue reading on to the next paragraph(s) ... even to the end of the article?
    How to read a website with VoiceOver
    Step 1:  Go to the Website
    A quick keyboard shortcut is Command-L.  This will jump you up to the address bar.  Start typing where you want to go.  i.e "www.thewebsite.com"
    Step 2:  Working with Webpage
    VoiceOver will automatically start reading the website.  You can pause the speech by hitting the 'Control Button'. 
    If VoiceOver does not being reading the webpage, then you might have to "Interact" with it.  If VoiceOver say "HTML Content" then press Control-Option-Space-Down Arrow to interact with the webpage.
    Use Control-Option-Right Arrow to move throught the website.  This will speak "EVERYTHING" on the page.
    Most website that I've found have their articles labeled as 'Heading'.  You can jump from heading to heading, by pressing Control-Option-Shift-H.
    If you'd like an itemized alphabetical listing of the site, press Control-Option-I 
    Press Control-Option-Space on the link or article you want to view.
    Step 3.  Reading from Top to Bottom
    Once you found and clicked on the the article/link, use the same 'Heading' command, Control-Option-Shift-H to find the title. 
    After finding the title, press Control-Option-A will start reading from the title on. 
    Note:  If there are any other items (ads, pictures, etc) it will read those too. 
    Tip:  You might be able to activate a feature called the 'Reader'.  The Reader isolates the article and elimanates the ads  The keyboard command is Shift-Command-R.  You can also find it in the Menu Bar (Command-Option-M) under the word 'View' then 'Show Reader'. 
    I am using a MACPro with OSX, probably Mavericks 10.9 (where would I look to see if that is the correct information?)
    You can find this information under the 'Apple menu' in the Menu Bar.  To access the Menu Bar, press Control-Option-M. 
    Go to Apple Menu > About This Mac.  This will open up another window.  Use Control-Option-Right Arrow until you hear 'Version'.  If you purchased it brand new from Apple within the last six month, more than likely you have Mavericks. 
    Recommanded Articles. 
    AppleVis- Commonly used Keyboard Commands
    Chapter 2: Learning VoiceOver Basics
    Chapter 6: Browsing the internet
    Apple Accessibility Resource Page
    The  'Commands Help' Voiceover Menu. Control-Option-H-H.  (hit H twice)  is my best friend.  It's a searchable VoiceOver Menu with most of the VoiceOver command.  Example:  You are looking for the 'Read Current Paragraph' keyboard command.   Press Control-Option-H-H and then type Paragraph.  It will then bring up all the commands with the word paragraph.  I believe there are three.   
    As from the Trackpad Commands, I've copied and pasted below from Appendix A: Commands and Gestures
    VoiceOver standard gestures
    If you’re using a Multi-Touch trackpad, you can use VoiceOver gestures. VoiceOver provides a set of standard gestures for navigating and interacting with items on the screen. You can’t modify this set of gestures.
    NOTE:Gestures that don’t mention a specific number of fingers are single-finger gestures.
    General
    Enable the Trackpad Commander and VoiceOver gestures
    VO-Two-finger rotate clockwise
    Disable the Trackpad Commander and VoiceOver gestures
    VO-Two-finger rotate counterclockwise
    Turn the screen curtain on or off
    Three-finger triple-tap
    Mute or unmute VoiceOver
    Three-finger double-tap
    Navigation
    Force the VoiceOver cursor into a horizontal or vertical line when you drag a finger across the trackpad
    Hold down the Shift key and drag a finger horizontally or vertically
    Move the VoiceOver cursor to the next item
    Flick right
    Move the VoiceOver cursor to the previous item
    Flick left
    Move content or the scroll bar (depending on the Trackpad Commander setting)
    Three-finger flick in any direction
    Go to the Dock
    This gesture moves the VoiceOver cursor to the Dock wherever it’s positioned on the screen
    Two-finger double-tap near the bottom of the trackpad
    Go to the menu bar
    Two-finger double-tap near the top of the trackpad
    Open the Application Chooser
    Two-finger double-tap on the left side of the trackpad
    Open the Window Chooser
    Two-finger double-tap on the right side of the trackpad
    Jump to another area of the current application
    Press Control while touching a finger on the trackpad
    Interaction
    Speak the item in the VoiceOver cursor or, if there isn’t an item, play a sound effect to indicate a blank area
    Touch (includes tap or dragging)
    Select an item
    Double-tap anywhere on the trackpad
    You can also split-tap (touch one finger and then tap with a second finger on the trackpad)
    Start interacting with the item in the VoiceOver cursor
    Two-finger flick right
    Stop interacting with the item in the VoiceOver cursor
    Two-finger flick left
    Scroll one page up or down
    Three-finger flick up or down
    Escape (close a menu without making a selection)
    Two-finger scrub back and forth
    Increase or decrease the value of a slider, splitter, stepper, or other control
    Flick up (increase) or flick down (decrease)
    Text
    Read the current page, starting at the top
    Two-finger flick up
    Read from the VoiceOver cursor to the end of the current page
    Two-finger flick down
    Pause or resume speaking
    Two-finger tap
    Describe what’s in the VoiceOver cursor
    Three-finger tap
    Change how VoiceOver reads text (by word, line, sentence, or paragraph)
    Press the Command key while touching a finger on the trackpad
    Rotor
    Change the rotor settings
    Two-finger rotate
    Move to the previous item based on the rotor setting
    Flick up
    Move to the next item based on the rotor setting
    Flick down
    To customize other gestures by assigning VoiceOver commands to them, use the Trackpad Commander.
    Assigning VoiceOver commands to gestures
    If you need a reminder about what a gesture does, press VO-K to start keyboard help, and then use the gesture on the trackpad and listen to the description.
    Learning about keys, keyboard shortcuts, and gestures
    Sorry lots of information.  Enjoy.  You

  • MacBook Pro will not startup, cursor spins forever

    MacBook Pro refuses to startup no matter how long I wait for the spinning cursor to finish. I suspect hardware, because the last successful startup generated some strange bursts of static as it started up.
    I've tried a few successive startups all with the same result. The very last time I held down the "D" key but no diagnostics ever appeared to run.

    If I bought OS from apple store, can I just reload onto the new disk, plug it into bad machine and then select it with opt/alt key at power on?
    Yes.
    The Mac will boot just as easily from an external drive, so if you have an enclosure, you could put your spare drive there initially, or swap drives immediately if you prefer.
    The rub is: if your MacBook is older than about 2011, it needs a Recovery_HD to get the re-download.

  • Passing Ref Cursor to Oracle Stored Procedure Via C#

    Hi all,
    I am new to oracle and stuck with an issue. I have three insert stored procedures for three different tables. Two of them have multiple rows to be inserted, which is currently done via iterating through each row and insert to db in C# code. My requirement is to merge these three procedures in one and instead of iterating from C# code send table rows as (ref cursor or collection) to procedure and the procedure will handle the rest.
    I read that ref cursor only works if you're data is in database as it reference the memory but in my case data is build on client side.
    I am using Oracle 11i and ASP.Net 2.0
    Can any help me on this please?
    Edited by: 929463 on Apr 23, 2012 12:38 AM

    929463 wrote:
    I am new to oracle and stuck with an issue. I have three insert stored procedures for three different tables. Two of them have multiple rows to be inserted, which is currently done via iterating through each row and insert to db in C# code. My requirement is to merge these three procedures in one and instead of iterating from C# code send table rows as (ref cursor or collection) to procedure and the procedure will handle the rest.Why a single procedure? How is the procedure to determine the target table to insert the data into? And please - no dynamic SQL as that is 99% of the time wrong.
    A ref cursor is something that PL/SQL creates - with the purpose of passing the cursor handle to your code. This enables the actual SQL statement for that cursor to be moved from client code, into a PL/SQL stored proc. It abstracts the client from having to understand SQL, understand the data model and so on. All clients use the same PL/SQL proc and thus the same code for creating that cursor. Thus no issue of some clients getting it half right or half wrong and dealing with data inconsistencies between clients.
    The PL/SQL proc can be tuned and optimised, modified for catering for data model changes and so on. Without your client code having to be even recompiled as it is isolated against these server changes.
    For all other interaction (running PL/SQL code, doing insert/update/delete/etc SQL statements), you need to create the cursor yourself in your code.
    Also, the SQL engine only sees cursors. There are no differences between cursors. The client (e.g. PL/SQL) can call it a reference cursor, or an implicit cursor, or a DBMS_SQL cursor.. the SQL engine does not know that and does not care.
    A ref cursor is simply a special type of client interface to a SQL cursor, allowing PL/SQL to create that SQL cursor and then pass the handle of that SQL cursor to other code to consume that cursor.
    Okay, so if you want to insert data, you need in your code to create a cursor. This can be a SQL INSERT cursor - the actual insert statement. Or it can be a PL/SQL call - an anonymous PL/SQL code block that calls a stored proc that performs the insert (after applying validation and business logic).
    The cursor will have one or more bind variables. Your client will pass values for these variables and the server-side code (SQL or PL/SQL) will be executed using this as variable data.
    You can for example create a cursor as follows:
    begin
      DoFunkyInsert( :1, :2, :3 );
    end;
    {code}
    3 bind variables are expected. You can now in the client build an array for each of these variables, containing a 100 values each (total of a 100 rows to insert). Do a single execute of the cursor, and tell Oracle that the bind is actually a 100 element array.
    The complete array ships to Oracle - Oracle opens a loop and execute the cursor for each element in the array.
    This is called bulk binding.
    An alternative approach is to define the bind variable as a collection (a non-scalar value). And then code the PL/SQL procedure to open a loop and iterate through the collection/array, inserting a row per iteration.
    The binding itself is more complex as your code know needs to understand Oracle object types and be able to define an array/collection that is a valid Oracle non-scalar data type.
    The +Oracle Call Interface+ (OCI) is quite flexible in this regard. However, as you work via an abstraction layer (e.g. ADO, OleDB, ODBC, etc) your code is subject to whatever functionality this abstraction layer makes available to your code. And this is seldom includes all the power, functionality and flexibility of the (more complex) OCI itself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • HT1311 I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    http://support.apple.com/kb/HE36
    Regards.

  • How to pass values to variables in WAD 7.0 using java script

    Hi.,
    My requirement is based on WAD 7.0.
    The sales value has to displayed in WAD using graph with various chart types.
    I have created variables for plant and material group in a query.
    I have created drop down box for plant with all plants in it, check box for material group and a Submit button in WAD in FORM tag of HTML coding.
    Once all the values are set in drop down box, checkbox and if the user clicks on submit button, the values has to captured by the variables for which I have created and the graph has to be aligned to the new values in variables.
    Kindly help me how to use java script to get the values from FORM and pass it to variables.
    Regards,
    Selva

    Hi Selva,
    You do not need to use Javascript for this. Instead you can achieve this by using API Commands in WAD 7.0.
    Please configure Action on the ButtonGroup webitem to use 'Commands'.
    ->Choose Command 'Set Variables Values / SET_VARIABLES_STATE' under Commands for Web Templates
    ->Set Display Variable Screen setting to OFF
    ->Choose Query Variable for Plant, Select Variable Type as 'Binding Type', Binding Type as 'Data Provider Selection', Data Provider as the one you have assigned to the Dropdown webitem, Characteristic as 0PLANT or as that assigned to the Dropdown webitem
    ->Repeat above steps for Query Variable Material Group
    Now when you make a selection from the Dropdown webitems, the Chart output will change accordingly. Let me know if this helps.
    --Priya

  • I am having an issue with my adobe acrobat 9 pro. Every time I try to open a pdf from someone it opens it up with my free adobe reader rather than the Acrobat 9 pro so then I don't have all of the functions of 9 pro. How do I get it to open with 9 pro ins

    I am having an issue with my adobe acrobat 9 pro. Every time I try to open a pdf from someone it opens it up with my free adobe reader rather than the Acrobat 9 pro so then I don't have all of the functions of 9 pro. How do I get it to open with 9 pro instead of the free reader?

    It may depend on the plugin that is loaded into your browser. However, right click on a PDF and select the Open With option and go to the default button to select Acrobat as the default. That might do it.

  • How to pass a JavaScript variable into a java method

    I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    myValue = someDynamicValue;
    <% System.out.println(myValue)%>
    </script>
    </head>
    <body>
    </body>
    </html>
    obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
    I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
    NOTE: the java method does not have to be a println() method, it can be any method of my choice.
    NOTE: someDynamicValue is a JavaScript value that can dynamically change

    I don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
    Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side.

  • How to pass a shell variable to rman scripts

    I want to backup datafile to different directory
    depending on the current time,and I can do this to
    pass a shell variable to rman scripts,and this
    variable will used as part of format ,like this:
    backup incremental level=0
    tag rman_inc0_bck
    filesperset 5
    format '$(DIR)/rman_fulldb_%u_%s_%p_%d'
    (database include current controlfile)
    and $(DIR) is shell variable ,but rman will not
    recognize this ,how to achieve this?

    You could send your script to rman thru a pipe | or <<
    echo "backup incremental level=0
    tag rman_inc0_bck
    filesperset 5
    format '$(DIR)/rman_fulldb_%u_%s_%p_%d'
    (database include current controlfile);" | rman target /You could also create a "temp script" and then use it from rman with cmdfile
    sed "s,XXXDIR,$(DIR)," yourtemplate > /tmp/rmanscript.$$
    rman target / cmdfile /tmp/rmanscript.$$
    rm /tmp/rmanscript.$$

  • How to pass a jsp variable into javascript??

    <p><%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
    <p><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <p><html>
    <p><c:set var="binrmapi" value="http://localhost/paas-api/bingorooms.action;jsessionid=XXXXXX?userId=TEST2&sessionId=1&key=1" />
    <p><c:import var="testbinrm" url="${fn:replace(binrmapi, 'XXXXXX', jsessionid)}"/>
    <p><c:set var="tuples" value="${fn:split(testbinrm, '><')}" />
    <p>Time until next game
    <p><c:forEach var="tuple" items="${tuples}">
    <p><c:if test="${fn:contains(tuple, 'row ')}">
    <p> <p><code>
    <p> <c:set var="values" value="${fn:split(tuple, '=\"')}" />
    <p> <font color="blue">
    <p> <c:out value="${values[17]}" />
    <p><c:set var="remainingtime" value="${values[17]}" />
    <p> </font>
    <p> </code>
    <p></c:if>
    <p></c:forEach>
    <p><form name="counter"><input type="text" size="8" name="d2"></form>
    <p><script>
    <p>var milisec=0
    <p>var seconds=eval("document.myForm.remaining").value;
    <p>function display(){
    <p> if (milisec<=0){
    <p> milisec=9
    <p> seconds-=1
    <p>}
    <p>if (seconds<=-1){
    <p> milisec=0
    <p> seconds+=1
    <p> }
    <br>else
    <p> milisec-=1
    <p> document.counter.d2.value=seconds+"."+milisec
    setTimeout("display()",100)
    <p>}
    <p>display()
    <p></script>
    <p></body>
    <p></html>
    <p>This is my code that i was working on, in the jsp part of the script, i get a api call and save a value of time in the variable remainingtime.. and in the javascript, i try to have a countdown clock counting down the remaining time.. but i guess it doesnt work.. how can i get that working? thanks alot
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001

    Re: How to pass a jsp variable into javascript??Here is the sameple one, hope it will solves your problem.
    <html>
    <body>
    <form name=f>
    <%!
    String str = "A String"
    %>
    <script>
    var avariable = <%=str%>
    <script>
    </form>
    </body>
    </html>
    Let me know if you face any problem

Maybe you are looking for

  • 1st generation ipod freezes

    My 1st generation ipod was in the middle of playing a song and then froze.  Now, I can't get it to play and I can't get it to shut off.  It seems none of the buttons are responding.  The battery is charged.  Help, please

  • Did not find EXT_REFERENCE_ID pointed to by field C1_EXT_REFERENCE_ID

    I have WebLogic 32 bit installed on a Windows XP 32 bit platform. And CCB V2.2.0. Upon startup in WebLogic, I get the following error message in the Domain Diagnostic Log file of Web Logic; 101162 User defined listener com.splwg.base.web.startup.SPLW

  • Disabling input

    Hi, How to use "at selection-screen output" event for disabling input of certain fields. Please explain with easy example. Thanks, Mahathi

  • How do I remove all photos from my ipad

    How do I remove all photos from my iPad. I'm going to Europe and have them backed up on my computer, and I need the space for new European photos.

  • Why did the Share dialogue change from display in a frame to not displayed in a frame

    Hello, SharePoint 2013 via TFS install package which installed SharePoint Central Administration v4 and a default SharePoint team site.  This is my system: When I initially started working with my default SharePoint Team Site (SharePoint - 80) and cl