Results 1 to 7 of 7

Thread: Ref Cursor

  1. #1
    Join Date
    Nov 2003
    Posts
    53

    Unanswered: Ref Cursor

    im doing a project that needs to put a string into my oracle select statement. but it seems that the way to do it is to use REF CURSOR, and i notice that i have to code a long code in the cursor. is there any way to do it? i mean to avoid using ref cursor..btw im quite new pls help.

  2. #2
    Join Date
    Jan 2004
    Posts
    37
    I don't really get your problem but it seems you are looking for something like this....
    try this...in case you want the field concatenated with the field
    select 'string '||<fields> from <tablename>;
    this can also be
    in case you only want the string as the output
    select 'string ' from dual;

  3. #3
    Join Date
    Nov 2003
    Posts
    53
    well, lets put it in a simple way, is there any way to execute a sql command that has string in it? say im refering to vb script actually...
    something like this? :
    rsrecordset.execute(SQL)
    this way i can append the string to my select statement without using ref cursor which will slow my code very much. any idea? thanks in advance

  4. #4
    Join Date
    Jan 2004
    Posts
    37
    assuming variables declared...

    str="select 'text' from dual"

    rs.open(str),conn

    text1.text = rs.fields(0)

  5. #5
    Join Date
    Nov 2003
    Posts
    53
    yeah the statement is vb script right? is there a similar way of writing it that way in oracle?

  6. #6
    Join Date
    Jan 2004
    Posts
    37
    might be what you are looking for can be solved using dynamic SQL in Oracle......

  7. #7
    Join Date
    Nov 2003
    Posts
    53
    from what i get, using ref cursor is one of the way, but i'll look into the dynamic sql that u mentioned..thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •