Insert Carriage Return into CLOB
I'm creating a clob that will be sent via email as an attachment with errors that occur during a package run. How can I send a carriage return so that the lines in the attachment break up and are easier to read?
This is what I have so far.
LOOP
gv_email_body:= gv_email_body ||
'Amount'||err.amount
||'Vendor: '||err.description
||'Account: '||err.Acct
||chr(13);
END LOOP;
gv_email_body is my clob.
I resolved myself, quite simple.
chr(10)||chr(13)
Similar Messages
-
Insert carriage return into string
can someone tell me how to insert chars like carriage return in to strings in Labview 6.1 ?
Thanksunder the string subpallette you will have the ability to use constants for carriages return, tab, etc. Also when on the front panel you can right click on any text indicator or control and select Codes Display. This will allow you to see the /n's. Hope this helps.
BJD1613
Lead Test Tools Development Engineer
Philips Respironics
Certified LV Architect / Instructor -
Inserting carriage returns in metadata when using fcsvr_client createasset
Anyone know how to insert a carriage returns into a field when using fcsvr_client createasset? For example:
./fcsvr_client createasset paassetspot /dev/6/test.mov PAMD_CUSTNOTES="With \n line \n breaks"You can enter newlines as you type inline without variables; you just have to escape them to the shell.
In bash, do:
./fcsvr_client createasset paassetspot /dev/6/test.mov PAMD_CUSTNOTES=$'With \nline \nbreaks'
(The difference from your initial attempt is the dollar sign and the single quotes.)
In tcsh, you could do:
./fcsvr_client createasset paassetspot /dev/6/test.mov PAMD_CUSTNOTES="With \
? line \
? breaks" -
Error while inserting .doc file into CLOB object in oracle
hello everybody ,
i am trying to insert .doc file into clob column in oracle database.i am using oracle 8i. But i am getting error saying
ORA-01461: can bind a LONG value only for insert into a LONG column
i have no clue.
i am pasting code here
please help me out.
regards
darshan
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.Reader;
import java.sql.Connection;
import java.sql.PreparedStatement;
public class InsertingClob {
public static void main(String[] args) {
File f = new File("E:\\dar
sowres.doc");
int len = (int) f.length();
System.out.println(len);
Connection conn = null;
PreparedStatement ps = null;
try {
FileReader fr = new FileReader(f);
String FILE_INSERT_QUERY = "INSERT INTO RESUMED VALUES(?,?)";
conn = JDBCUtility.getConnection();
ps = conn.prepareStatement(FILE_INSERT_QUERY);
ps.setString(1,"1");
ps.setCharacterStream(2,fr,len);
int result = ps.executeUpdate();
if(result ==1) {
System.out.println("file has been successfully inserted into the db");;
}else {
System.out.println("not inserted");
}catch (Exception e) {
e.printStackTrace();
and the error is
java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
at InsertBlob.main(InsertBlob.java:21)
java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG columnYou may have one of a few errors going for you there:
The error says your column in Oracle is a Long not a CLOB, if it is, then make your column a CLOB.
CLOB's are not suppored in all environments and/or all interfaces (specifically Windoz ODBC has a problem).
I believe a DOC (Windoz MS-Word) file is a BLOB, due to formatting characters in the file.
I had a very similar error using Access and trying to do this, but changing to SAS fixed the problem. It could very well be that your version of ODBC/JDBC drivers does not support it properly. -
Insert XMLTYPE data into CLOB column
Hi,
I am trying to insert XMLTYPE datatype column value into the CLOB datatype column.
I get an error -
ORA - 00932: Inconsistent datatypes: expected CLOB got -
How do I insert xml type data into clob?
Thanks!Here is my sql code:
I have a view :
create or replace view test_view
(id,
code,
desc)
as select
id,
code,
xmlroot(xmlelement("empname", ename), version '1.0') as desc
from employee;
I have a table emp_details_table. The columns in the emp_details_table are
ID number,
CODE varchar2,
EMP_DETAILS CLOB
I am tring to insert the 'test_view' data into the 'emp_details_table' and I get an error cannot insert xmltype data into clob.
insert into emp_details_table
(ID , CODE, EMP_DETAILS)
select
(ID, CODE, DESC) from test_view;
Thanks. -
Inserting carriage returns in a concatenated string
Hi.....
Does anyone know how to insert carriage returns within a concatenated string in a sql statement?
i.e. Select 'John'||'Smith' from dual
I'm trying to return:
John
Smith
as opposed to John Smith
Thanks,
~ChristineAs suggested chr(10) is what you need, but it's not carriage return, but line feed, carriage return is chr(13). See the difference :
TEST@db102 SQL> select 'John'||chr(10)||'Smith' from dual;
'JOHN'||CH
John
Smith
TEST@db102 SQL> ed
Wrote file afiedt.buf
1* select 'John'||chr(13)||'Smith' from dual
TEST@db102 SQL> /
'JOHN'||CH
Smith
TEST@db102 SQL> -
How do you insert a carriage return into a string ?
Hi,
I don't know how to insert a carriage return, \n ,into a string
without the carriage return being interpeted. I am trying to build
a string called queryVariable from the file below so that it equates
to the necessary format for JDBC to execute the query.
SQL script file:
declare @x datetime
select @x = null
exec OSVBAK01...demand_dump PRODUCT,FULL,@x
go
required string format for query:
"declare @x datetime\n"+"select @x = null\n"+
"exec OSVBAK01...demand_dump PRODUCT,FULL,@x";
void Readfile(String path, String infilename) {
try {
File file = new File(path + infilename);
if (!file.exists()) {
System.err.println("File not found");
BufferedReader in = new BufferedReader
(new FileReader(file));
String str;
String queryVariable = "";
StringBuffer sb = new StringBuffer();
while ((str = in.readLine()) != null) {
sb.append("\"").append(str).append("\n\"")
.append("+");
in.close();
queryVariable = sb.toString();
System.out.println(queryVariable);
} catch (IOException e) {
System.err.println(e.getCause());
queryVariable equates to the following after running the code above:
"declare @x datetime
"+"select @x = null
"+"exec OSVBAK01...demand_dump PRODUCT,FULL,@x
"+"go
"+
Any assistance anyone could provide would be greatly appreciated.
Thanks for your time,
YAM-SSMInteresting... that would mean, of course, that in the case of concatenating string literals (outside of loops, as they say), the compiler is optimizing the code to avoid the need for using StringBuffers internally. Actually, it's good to know this, as I wasn't aware of this optimization.
However, the post wasn't meant to be serious... I hoped that was obvious. Everyone's spouting off nearly the same thing for adding strings and line separators and whatever. -
SQLLDR is inserting carriage returns.
Hello. I tried searching but didn't find anything specific to my problem. I have a lot of Access tables to load into Oracle. All of the Access tables get appended into the same Oracle table. I'm exporting the Access tables to a excel spreadsheet then saving as a csv file. I run SQLLDR and it's giving me an error on a column saying invalid number. I switch the number field over to a Varchar2 and it loads. When I view the data in enterprise manager it has a square next to the last number. I did a simple replace on the character using replace(flow_rate,chr(13),'') and inserting that data into a number field again.
I'd like to be able to skip this step in the future. Is there a way to skip the carriage returns when loading.
ThanksThanks for the reply. Yes I am. I have a bunch of Access files on a NT server. I open them and export the table to a xls file on my desktop. I open the file then save it as a CSV on the desktop. I then use WinSCP3 to move the file from the desktop to the UNIX box which is where the Oracle database is located on.
It only puts the carriage return in the last column data is in. I have workaround using the replace function but I'd like to just fix the problem. -
Hi,
I tried inserting PDF file into a CLOB column , in the below example l_bfile is a bfile datatype.
and I'm inserting l_bfile to CLOB column.
l_bfile := bfilename('C:\test', 'test.pdf');
But It is throwing below error:
ORA-06550: line 9, column 42:
PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got FILE
ORA-06550: line 9, column 1:
PL/SQL: SQL Statement ignored
Please advise me on this.
thanks,
Jagu
Edited by: user11221603 on Oct 11, 2012 6:18 AMHi,
Check this thread: How to store PDF file in BLOB column without using indirect datastore
Regards.
Al -
Carriage Returns in Message Area
Hi,
I am using a hidden field "P6_SUBMIT_MESSAGE" to store a message that gets generated from a PL/SQL process. I then use the following trick to display that same message in the message area at the top of my page
Process success message
&P6_SUBMIT_MESSAGE.
How can I get carriage returns into this message. I have tried adding chr(10), chr(13) and even '<'br'>' in the PL/SQL process but no luck. If I use chr(13) and my P6_SUBMIT_MESSAGE is a Textarea (not a Hidden field) I can see the desired results in that text area but even then, the carriage returns are not propagated to the message area at the top of the page.
ThanksI know this is not my thread but i just wanted to say, thanks scott! this works! i'm having the same problem as Robert and tried every possible way like he did with the ch(10) and < b r >... but did not realize to change the page item type, i had it as text area also. Now i changed it to display text (does not save state) and used < b r > for carriage return... it works like a charm!
Thanks again,
Marilyn -
TEXT datatype in Stored Procedure and concat Carriage returns
Anyone,
I am trying to create a stored procedure that will allow me to grab a bunch of 255 Char records in a cursor and concatenate them together adding a carriage return after each row.
Here is pseudo code would look like:
CREATE OR REPLACE PROCEDURE myproc IS
CURSOR c1 IS
SELECT myVARCHAR_255_col
From mytable
where criteria = something
rec c1%ROWTYPE;
var_my_new_TEXT TEXT;
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO rec;
EXIT WHEN c1%NOTFOUND;
IF rec.myVARCHAR_255_col IS NOT NULL THEN
var_my_new_TEXT := CONCAT(rec.myVARCHAR255_col, '%char(13)+char(10)%')
END IF
END LOOP;
CLOSE c1;
END;There is a bit more to code then this but most important issue is how to deal with TEXT datatype? Should/can it be RAW instead. And also how do I get a CARRIAGE RETURN into the body of the column of type TEXT.
Thanks in advance,
MillerIs there a specific reason for concatenating 255 characters at a time and returning it? This example may be of help.
SQL> set long 500
SQL> DESC MYTABLE
Name Null? Type
COL1 NUMBER(2)
COL2 LONG
SQL> select * from mytable;
COL1
COL2
1
This text is very long This text is very long This text is very long This text i
s very long This text is very long This text is very long This text is very long
This text is very long This text is very long This text is very long This text
is very long This text is very long This text is very long This text is very lon
g This text is very long This text is very long This text is very long
SQL> select length(col2) from mytable;
select length(col2) from mytable
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got LONG
SQL> select length('This text is very long This text is very long This text is very long This text i
2 s very long This text is very long This text is very long This text is very long
3 This text is very long This text is very long This text is very long This text
4 is very long This text is very long This text is very long This text is very lon
5 g This text is very long This text is very long This text is very long') from dual;
LENGTH('THISTEXTISVERYLONGTHISTEXTISVERYLONGTHISTEXTISVERYLONGTHISTEXTISVERYLONG
393
SQL> R
1 DECLARE
2 V_VARIABLE VARCHAR2(4000);
3 BEGIN
4 SELECT COL2 INTO V_VARIABLE FROM MYTABLE;
5 DBMS_OUTPUT.PUT_LINE(SUBSTR(V_VARIABLE,1,255));
6 DBMS_OUTPUT.PUT_LINE(SUBSTR(V_VARIABLE,256,138));
7* END;
This text is very long This text is very long This text is very long This text
is very long This text is very long This text is very long This text is very
long This text is very long This text is very long This text is very long This
text is very long Th
is text is very long This text is very long This text is very long This text is
very long This text is very long This text is very long
PL/SQL procedure successfully completed.
SQL> SELECT SUBSTR(COL2,1,255) FROM MYTABLE;
SELECT SUBSTR(COL2,1,255) FROM MYTABLE
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got LONG -
Carriage returns in Spotlight Comments - tip
Because I could paste returns into the Spotlight comment window, I figured there was a way to place carriage returns into the window [without copying a return from TextEdit].
ctrl-return works on my PowerBook
Mac OS X (10.4.3) Titanium PowerBook (15")The email is formatted poorly by the sender.
The screen width for a PC is min 640x480, which is large enough to display the email with the extar carriage returns on every line.
The Blackberry has a much smaller resolution, even with smaller text (which you could try but I wouldn't count on).
The BB removes extra CR/LF's (ie if you have three or four per line, it will only show one), but it isnt going to reformat the entire email.
Especially since the email is generally formatted for a reason.
The sender has not formatted the email (thatws an auto-reply email, right?) for small screens or mobile devices.
If you open the email in outlook and then reduce the window size to 1/4 or smaller than you will see the exact same thing on the Outlook email...
So, there is nothing you can do on the BB. Its the sender who needs to change their emails.
Checked out my Blackberry FAQ's and Links to Needed Articles here
http://darkeen.homelinux.com/index.php/Blackberryfaq -
Regular Expression. Select Statement. Carriage Return
Oracle 9i
Using SQLPLUS
I've read about regular expression and need some translation/explanation.
I have a large table containing a varchar2 (free text) column. Users may have inserted carriage returns when they entered the data. I need to locate rows that contain carriage returns, select and display them. Later I'll need to update those rows to replace the carriage returns with a space.
Can you assist with syntax. I believe use of a regular expression is required.
Thanksfor single characters like <CR> TRANSLATE() Doh. Never post at the end of a long day.
As the other posters have pointed out, one-for-one single character substitution is normally done with REPLACE(), although TRANSLATE() also works. The more normal role for TRANSLATE() is situations where you want to substitute multiple characters, e.g.
SQL> update <your table> set <your column> = replace (<your column> , chr(13)||chr(10), ' ');This substitutes a space for a carriage return and line feed combination.
Cheers, APC -
Exporting Text data from PHP to Oracle CLOB data (Carriage return - issue)
This is my original text content in PHP - Data type - Longtext
SECTION - 1
This a test description.This a test description.
This a test description.This a test description.
This a test description. This a test description.I exported the above content from PHP as a SQL script file (insert into.. ) - export.sql [ insert into table_name (id, text_content) values (1, '') ]
while exporting data from PHP table into export file.. it replaced the "Carriage return" with "\r\n\r\n" in the insert statement for text_content column
When I run this INSERT statement in Oracle (for longtext, I have created a CLOB column in Oracle), the following text_content data is inserted into CLOB column in Oracle.
SECTION - 2
This a test description.This a test description.\r\n\r\nThis a test description.This a
test description.\r\n\r\nThis a test description.This a test description.Now I have created a item named P1_TEXT_CONTENT of type TEXTAREA and try to fetch the CLOB data into this page item.
BUT textarea displays the entire content including "\r\n\r\n" as mentioned in SECTION - 2
I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
What are the options we have?
Thanks,
DeepakDeepakJ wrote:
I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
What are the options we have?Run an update on the Oracle table following the inserts to replace the escaped CR/LFs with real ones:
update foo
set clob_column = replace(clob_column, '\r\n', chr(13) || chr(10));You might want to experiment to see which characters are actually necessary. As an OS X/Linux user I'd probably just use a single LF chr(10). -
Insert into CLOB fails with Oracle ODBC driver version 9.02.00.65
I tried to insert into CLOB using the latest Oracle ODBC driver 9.02.00.65 and it fails. But the same works with earlier versions of ODBC driver earlier to 9.02.00.65 ie., 9.02.00.63.
Here is the code snippet I tried. Any help now is highly appreciated as I am in the crunch time.
I tried the same code snippet with VARCHAR2 column with the same driver and it works.
** CONVDSN.C - This is the ODBC sample code for
** creating File DSN pointers to machine DSNs.
**This code is furnished on an as-is basis as part of the ODBC SDK and is
**intended for example purposes only.
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <sql.h>
#include <sqlext.h>
#include <odbcinst.h>
#include <sqltypes.h>
#define MAXDATALEN 25 //maximum data length per column
#define MAX_COL 15 //maximum column in result set
#define MAX_ROW 100 //maximum number of rows
#define MAXBUFLEN 256
#define SQLERR_FORMAT "SQL Error State:%s, Native Error Code: %lX, ODBC Error: %s"
#define MAXDISPLAYSIZE MAX_COL*(MAXDATALEN+1)
#define SQLWRNMSGTITLE "SQL_SUCCESS_WITH_INFO results"
#define SQLERRCNTDTITLE "SQL_ERROR results continued"
#define SQLWRNMSGTITLE "SQL_SUCCESS_WITH_INFO results"
#define SQLWRNCNTDTITLE "SQL_SUCCESS_WITH_INFO results continued"
#define NULLDATASTRING "SQL_NULL_DATA"
#define SQLERRMSGTITLE "SQL_ERROR results"
// prototypes
void ExpandFileName(LPSTR szFileDSNName, LPCSTR szDSNName);
void MakeLegalName(LPSTR szLegalDSNName, LPCSTR szDSNName);
// main routine: Iterate through the user and system DSNs, creating a pointer
// to each.
void FAR PASCAL DisplayError(SQLRETURN nResult, HWND hWnd, SWORD fHandleType, SQLHANDLE handle);
void insertSelectClob();
void checkRcCode(RETCODE rc);
int main (int argc, char* argv[])
insertSelectClob();
return 0;
void FAR PASCAL DisplayError(SQLRETURN nResult, HWND hWnd, SWORD fHandleType, SQLHANDLE handle)
UCHAR szErrState[SQL_SQLSTATE_SIZE+1]; // SQL Error State string
UCHAR szErrText[SQL_MAX_MESSAGE_LENGTH+1]; // SQL Error Text string
char szBuffer[SQL_SQLSTATE_SIZE+SQL_MAX_MESSAGE_LENGTH+MAXBUFLEN+1];
// formatted Error text Buffer
SWORD wErrMsgLen; // Error message length
UDWORD dwErrCode; // Native Error code
int iSize; // Display Error Text size
SQLRETURN nErrResult; // Return Code from SQLGetDiagRec
SWORD sMsgNum = 1;
SWORD fFirstRun = TRUE;
char szDispBuffer[MAXDISPLAYSIZE+1]; // Display Buffer
szBuffer[0] = '\0';
do
// continue to bring messageboxes till all errors are displayed.
// more than one message box may be reqd. as err text has fixed
// string size.
// initialize display buffer with the string in error text buffer
strcpy(szDispBuffer, szBuffer);
// call SQLGetDiagRec function with proper ODBC handles, repeatedly until
// function returns SQL_NO_DATA. Concatenate all error strings
// in the display buffer and display all results.
while ((nErrResult = SQLGetDiagRec(fHandleType, handle, sMsgNum++,
szErrState, &dwErrCode, szErrText,
SQL_MAX_MESSAGE_LENGTH-1, &wErrMsgLen)) != SQL_NO_DATA)
if(nErrResult == SQL_ERROR || nErrResult == SQL_INVALID_HANDLE)
break;
wsprintf(szBuffer, SQLERR_FORMAT, (LPSTR)szErrState, dwErrCode, (LPSTR)szErrText);
iSize = strlen(szDispBuffer);
if (iSize && (iSize+strlen(szBuffer)+1) >= MAXDISPLAYSIZE)
break;
if (iSize)
strcat(szDispBuffer, "\n");
strcat(szDispBuffer, szBuffer);
// display proper ERROR or WARNING message with proper title
if (nResult == SQL_SUCCESS_WITH_INFO)
MessageBox(hWnd, szDispBuffer, (fFirstRun? SQLWRNMSGTITLE : SQLWRNCNTDTITLE),
MB_OK | MB_ICONINFORMATION);
else
MessageBox(hWnd, szDispBuffer, (fFirstRun? SQLERRMSGTITLE : SQLERRCNTDTITLE),
MB_OK | MB_ICONEXCLAMATION);
if (fFirstRun)
fFirstRun = FALSE;
while (!(nErrResult == SQL_NO_DATA || nErrResult == SQL_ERROR || nErrResult == SQL_INVALID_HANDLE));
void insertSelectClob()
SQLCHAR clobdata[1001];
SQLCHAR resultdata[1001];
SQLINTEGER ind = SQL_DATA_AT_EXEC;
SQLCHAR *bufp;
SQLINTEGER cbOrderID = sizeof(SQLSMALLINT);
SQLSMALLINT sTmp=13;
SQLCHAR *sqlStmt1 = _T("INSERT INTO clobtbl(id, clob1) VALUES(?, ?)");
SQLCHAR *sqlStmt2 = _T("SELECT id, clob1 FROM clobtbl");
// SQLCHAR *sqlStmt1 = _T("INSERT INTO testInsert(id, clob1) VALUES(?, ?)");
// SQLCHAR *sqlStmt2 = _T("SELECT id, clob1 FROM testInsert");
int clobdatalen, chunksize, dtsize, retchklen;
HENV envHnd;
HDBC conHnd;
HSTMT stmtHnd;
RETCODE rc;
int nRowcnt=0;
SQLPOINTER pToken = NULL;
rc = SQL_SUCCESS;
// ENV is allocated
rc = SQLAllocEnv(&envHnd);
// Connection Handle is allocated
rc = SQLAllocConnect(envHnd, &conHnd);
rc = SQLConnect(conHnd, T("testd734"), SQLNTS, T("ipathdba"), SQLNTS, T("ipathdba"), SQLNTS);
printf(_T("Insert CLOB1 using SQLPutData...\n[%s]\n"), sqlStmt1);
// Set CLOB Data
int i;
SQLCHAR ch;
for (i=0, ch=_T('A'); i< sizeof(clobdata)/sizeof(SQLCHAR); ++i, ++ch)
if (ch > _T('Z'))
ch = _T('A');
clobdata[i] = ch;
clobdata[sizeof(clobdata)/sizeof(SQLCHAR)-1] = _T('\0');
clobdatalen = lstrlen(clobdata); // length of characters
chunksize = clobdatalen / 7; // 7 times to put
rc = SQLAllocHandle(SQL_HANDLE_STMT, conHnd, &stmtHnd);
// Step 1: Prepare
rc = SQLPrepare(stmtHnd, sqlStmt1, SQL_NTS);
// checkSQLErr(envHnd, conHnd, stmtHnd, rc);
// Step 2: Bind Parameter with SQL_DATA_AT_EXEC
rc = SQLBindParameter(stmtHnd,
1,
SQL_PARAM_INPUT,
SQL_C_SSHORT,
SQL_INTEGER,
0,
0,
&sTmp,
0,
&cbOrderID);
rc = SQLBindParameter(stmtHnd,
2,
SQL_PARAM_INPUT,
SQL_C_CHAR,
SQL_LONGVARCHAR,
clobdatalen*sizeof(CHAR),
0,
(SQLPOINTER)clobdata,
clobdatalen*sizeof(CHAR),
&ind);
// checkSQLErr(envHnd, conHnd, stmtHnd, rc);
// Step 3: Execute
rc = SQLExecute(stmtHnd);
while (rc == SQL_NEED_DATA) {
rc = SQLParamData(stmtHnd, &pToken);
if (rc == SQL_NEED_DATA) {
for (dtsize=0, bufp = clobdata;
dtsize < clobdatalen;
dtsize += chunksize, bufp += chunksize)
int len;
if (dtsize+chunksize < clobdatalen)
len = chunksize;
rc = SQLPutData(stmtHnd, bufp, len*sizeof(SQLCHAR));
else
len = clobdatalen-dtsize;
rc = SQLPutData(stmtHnd, bufp, SQL_NTS);
rc = SQLParamData(stmtHnd, &pToken);
// Fails as row count retrieved is zero.
rc = SQLRowCount(stmtHnd, &nRowcnt);
if(rc != SQL_SUCCESS)
DisplayError(rc, NULL, SQL_HANDLE_ENV, conHnd);
rc = SQLFreeStmt(stmtHnd, SQL_CLOSE);
printf(_T("Finished Update\n\n"));
rc = SQLAllocStmt(conHnd, &stmtHnd);
if (rc != SQL_SUCCESS)
printf(_T("Failed to allocate STMT\n"));
exit(-1);
// Clear Result Data
memset(resultdata, 0, sizeof(resultdata));
chunksize = clobdatalen / 15; // 15 times to gut
rc = SQLExecDirect(stmtHnd, sqlStmt2, SQL_NTS); // select
if(rc != SQL_SUCCESS)
DisplayError(rc, NULL, SQL_HANDLE_ENV, conHnd);
// Step 2: Fetch
rc = SQLFetch(stmtHnd);
for(dtsize=0, bufp = resultdata;
dtsize > sizeof(resultdata)/sizeof(CHAR) && rc != SQL_NO_DATA;
dtsize += chunksize-1, bufp += chunksize-1)
int len; // len should contain the space for NULL termination
if (dtsize+chunksize<sizeof(resultdata)/sizeof(CHAR))
len = chunksize;
else
len = sizeof(resultdata)/sizeof(CHAR)-dtsize;
// Step 3: GetData
rc = SQLGetData(stmtHnd,
2,
SQL_C_CHAR,
(SQLPOINTER)bufp,
len*sizeof(CHAR),
&retchklen);
if (!_tcscmp(resultdata, clobdata))
printf(_T("Succeeded!!\n\n"));
else
printf(_T("Failed!!\n\n"));
if (conHnd)
SQLFreeConnect(conHnd);
if (envHnd)
SQLFreeEnv(envHnd);
}Hi,
Since 9.2 has been desupported for error correction you will not be able to download that version from OTN. You should ask whoever is providing the training if their is an alternate version you can use. The only versions that you will be able to download from oracle.com is 10.2 11.1, and 11.2.
Maybe you are looking for
-
How do you set up two iPads so that they can share ebooks, etc
My wife and I each have an ipad 2 and we share an iMac. Currently, we have been using the same apple ID, mine, when purchasing music or ebooks. I would like to know the right way to set these up as I upgrade to IOS 5 so that we can both take advant
-
Auto rotation is not working properly with iOS 7.1.2 upgrade
I recently upgraded my iPad to iOS 7.1.2 and noticed that auto rotation isn't functioning properly. How will this problem fix, will I have to wait till the next update ?? It takes too much time, or doesn't happen at all. I have an iPad mini with reti
-
Issue in getting the purchase details
SELECT Tbl_ProductGroupMaster.ProdName, Tbl_ProductGroupMaster.UnitNam, Tbl_Inventory.CrDate, Tbl_Inventory.QtyOpStk, Tbl_Inventory.QtyClStk, Tbl_Inventory.ExcShortage, purchase.SumOfNUnit, sales.SumOfQty FROM Tbl_ProductGroupMaster, Tbl_Inventory, [
-
Using SSAS Security Proxy as a Data Source in SSRS
Hello-- We have a tabular model that is exposed externally to our clients via msmdpump.dll (Configure HTTP Access to Analysis Services on Internet Information Services (IIS) 7.0). We have also created a proxy to use custom security accessing the c
-
New DNG profiles not appearing in Lightroom
DNG profiles created with QPcalibration and Colorchecker Passport are not appearing in the Lightroom profile pulldown menu since I upgraded to Photoshop CC. HELP!