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...
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...
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...
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...
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...
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...
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...
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!!
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) ||...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.