Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by BADCODER

  1. BADCODER

    UTL_FILE

    I am using a cursor to fetch value into a variable, then write this variable to a file. QUESTION: ********* Everytime the loop is executed, the variable v_select is written to a new line in the file. Is there a way to ignore line feed and write the entire output in ONE SINGLE line? CODE...
  2. BADCODER

    UTL_FILE question

    I am using a cursor to fetch value into a variable, then write this variable to a file. QUESTION: ********* Everytime the loop is executed, the variable v_select is written to a new line in the file. Is there a way to ignore line feed and write the entire output in ONE SINGLE line? CODE...
  3. BADCODER

    can REF cursor be opened dynamically?

    Thanks. That's exactly the way v_final_str has been built. Sutle difference, p1_id anf p2_id are bind variables- :p1_id, :p2_id. Now the Ref cursoe is weakly typed, as it has to be opened every time for a new query, similar to above. Thed bind variable get their values from "USING p1id...
  4. BADCODER

    Can REF cursor be opened dynamically?

    This is the declartion: ------------------------ TYPE CTyp IS REF CURSOR; cur CTyp; This the Error LINE: ----------------------- v_open:= 'BEGIN OPEN Cur '||' FOR '||''''||v_final_str||''''||' USING '|| p1_id ||','|| p2_id||','|| p3_id||'; END;'; EXECUTE IMMEDIATE v_open; This is the...
  5. BADCODER

    can REF cursor be opened dynamically?

    This is the declartion: ------------------------ TYPE CTyp IS REF CURSOR; cur CTyp; This the Error LINE: ----------------------- v_open:= 'BEGIN OPEN Cur '||' FOR '||''''||v_final_str||''''||' USING '|| p1_id ||','|| p2_id||','|| p3_id||'; END;'; EXECUTE IMMEDIATE v_open; This is the...
  6. BADCODER

    pl/sql string manipulation...

    can functions REPLACE,TRANSLATE etc be used to make it eaiser? I don't know how to though.
  7. BADCODER

    pl/sql string manipulation

    it works if I hard code that tail. The only thing is I need a way to add it programatically without hardcoding. thanks
  8. BADCODER

    pl/sql string manipulation...

    I am trying to write a function that should accept a query as a parameter and return all the bound columns in that query. Function return_bound_cols(p_sql Varchar2) RETURN VARCHAR2 Example: If the parameter p_sql= 'SELECT C1, C2 FROM T WHERE C3 = :b3 AND C4=:b4 AND C5= 5'; The function...
  9. BADCODER

    pl/sql string manipulation

    I am trying to write a function that should accept a query as a parameter and return all the bound columns in that query. Function return_bound_cols(p_sql Varchar2) RETURN VARCHAR2 Example: If the parameter p_sql= 'SELECT C1, C2 FROM T WHERE C3 = :b3 AND C4=:b4 AND C5= 5'; The function...
  10. BADCODER

    USING claude for dynmic bind varibale query

    Experts, I am stumpted while writing a function returning USING clause based on query's bind vaiable? Example: Input Query: SELECT C1, C2 FROM T1 WHERE C3 = :1 AND C4 = :2 AND C5 = 'GREAT' Function OUTPUT string: 'USING p_C3, p_C4' Thanks!!
  11. BADCODER

    PL/SQL strings

    I have a simple query: Select A, NVL(C1,0), NVL(decode(C2,'YES','GOOD','BAD'),'UNKNOWN') FROM T1; I wan't a function which accepts the above query as input and returns the following query (string NOT the execution result) as output: Select A || NVL(C1,0) ||...

Part and Inventory Search

Back
Top