Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (Oracle)
 Oracle -> Access Conversion Update
 Forum Locked  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

h20
Starting Member

39 Posts

Posted - 01 December 2000 :  19:20:00  Show Profile
Hello everyone

Now that the forum key issue is out of the way (triggers will be used for Oracle) I went ahead and pushed all of the Access forum tables through ODBC to an Oracle 8i schema. It wenk ok... i guess... All of the tables and fields within were pushed over ok. However, I had to remove all of the relationships first. When a table is pushed to Oracle, regardless of which ODBC driver is used, all of the data types are change to VCHAR2. As you know most of the relationships are based on numerical fields. So now begins the long process of re-structuring the fields from VCHAR2 back to number. It looks as though all of the "NULL" and length attributes of the original text fields are still intact. Man... I am not looking foward to re-structuring that FORUM_CONFIG table... wow look at all of those fields...

Once this process is finished it should only take a day or so to replace all of the autonumber fields with triggers.

I will keep you all posted... Happy Holidays!



<

dust
Starting Member

Australia
18 Posts

Posted - 04 December 2000 :  01:43:19  Show Profile  Send dust an ICQ Message
quote:

Hello everyone

Now that the forum key issue is out of the way (triggers will be used for Oracle) I went ahead and pushed all of the Access forum tables through ODBC to an Oracle 8i schema. It wenk ok... i guess... All of the tables and fields within were pushed over ok. However, I had to remove all of the relationships first. When a table is pushed to Oracle, regardless of which ODBC driver is used, all of the data types are change to VCHAR2. As you know most of the relationships are based on numerical fields. So now begins the long process of re-structuring the fields from VCHAR2 back to number. It looks as though all of the "NULL" and length attributes of the original text fields are still intact. Man... I am not looking foward to re-structuring that FORUM_CONFIG table... wow look at all of those fields...

Once this process is finished it should only take a day or so to replace all of the autonumber fields with triggers.

I will keep you all posted... Happy Holidays!




hi, h20, I am fresh about snitz forum, and just read your guys post about ID's issue.

After I got this 3.1 release, I try to migrate to Oracle 8.1.5, also through ODBC, and most fields r quite OK, some fields even can keep the length of NUMBER type. the first problem I met is about MEMO type date in ACCESS, ODBC try to convert to LONG type in Oracle, but Oracle has lots limitation about LONG type, one cause the problem is one table can not have more than one LONG Type fields, so I restructured the forum_members table. after that seems all tables convert successfully.

Becos I migrated some ACCESS table to Oracle b4, so when I found some autonumber field (IDs), I just created 5 or 6 sequence number and put sequencenumbername.nextval in to insert sql statement, then it fix the problem about IDs, I didn't think much about compability with another database only try to make it work for me

After all those has been done, another issue is datatype, all NUMBER type fields in Oracle r not treated as integer by ODBC or ADO, have to manually add many Cint(rs("xxxx")) like that to make things work. also the Oracle ODBC driver don't accept ";" char at end of SQL statement, I need take them off manually as well.

Finish all steps, the forum finally runing for me, most functions r working perfectly. but another problem come when I try to use search function, I can't use "like %xxxx%" on LONG type field, and also can't use it simply on CLOB as well, then I try to use VARCHAR2 (4000) to instead of LONG, I failed to test string which is 3980 chars long, error message said SQL statement can't be over 4000 then I have to use PL/SQL anonmyous block to write this string in.

I haven't go through all code yet, but I am sure I will hook up with this forum for long time, I wish I can do something for immigrating this forum to ORACLE platforum

-----------------------
Response.redirect HELL

Edited by - dust on 04 December 2000 01:52:15<
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 04 December 2000 :  02:08:14  Show Profile  Visit gor's Homepage

quote:

Becos I migrated some ACCESS table to Oracle b4, so when I found some autonumber field (IDs), I just created 5 or 6 sequence number and put sequencenumbername.nextval in to insert sql statement, then it fix the problem about IDs, I didn't think much about compability with another database only try to make it work for me


The trick is ofcourse to get it to work with all the other supported database, but you're right: getting it to work on Oracle is step one...

btw, maybe you and h20 can join your efforts ? it looks like you allready got the triggers, h20 might have thought of things you didn't etc.

quote:

After all those has been done, another issue is datatype, all NUMBER type fields in Oracle r not treated as integer by ODBC or ADO, have to manually add many Cint(rs("xxxx")) like that to make things work. also the Oracle ODBC driver don't accept ";" char at end of SQL statement, I need take them off manually as well.
[quote]
hmm, the Cint() would add some extra overhead to the code, though is would also work with the other databases.
As far as I know none of the other database require the ';' at the end of the SQL statement. So removing that wouldn't be a big issue.

[quote]
Finish all steps, the forum finally runing for me, most functions r working perfectly. but another problem come when I try to use search function, I can't use "like %xxxx%" on LONG type field, and also can't use it simply on CLOB as well, then I try to use VARCHAR2 (4000) to instead of LONG, I failed to test string which is 3980 chars long, error message said SQL statement can't be over 4000 then I have to use PL/SQL anonmyous block to write this string in.


It might just not be possible to use 100% identical code for every database. We had do add some extra code for MySql because it doesn't support paging i.e.
If you need extra code for sql-statements that are used a lot, that is bad because that would mean a lot extra databasespecific code. If it are things like this single searchpage that is no big problem.



Pierre Gorissen

If I only had a little humility,
I would be perfect.

Ted Turner<
Go to Top of Page

h20
Starting Member

39 Posts

Posted - 04 December 2000 :  14:04:26  Show Profile
Hey dust... sounds like you are close. I have a couple of questions regarding your achievements so far.

- What version of Access are you using?
- What ODBC driver are you using (Oracle’s Driver or MS Driver)
- How exactly are you getting the tables into Oracle?
Are you saving the Access tables to binary files then importing into Oracle?
Or are you saving as ODBC?
(I know you mentioned that you were using ODBC. However, I have tried many times
to keep the data types at number, but I get a "Zero length fields not allowed" ODBC
error. Just curious as to how you got it to work.)


quote:
. Finish all steps, the forum finally runing for me, most functions r working perfectly. but another problem come when I try to use search function, I can't use "like %xxxx%" on LONG type field, and also can't use it simply on CLOB as well, then I try to use VARCHAR2 (4000) to instead of LONG, I failed to test string which is 3980 chars long, error message said SQL statement can't be over 4000 then I have to use PL/SQL anonymous block to write this string in.


Varchar2 is definitely the way to go... in 8i the max length is 32,767 bytes. The issue your running into when you tried to run a query using 3980 characters is unclear. Was the query string 3980 or was the actual post length 3980 characters? If you are referring to the post being 3980 then that sounds like an ADO issue to me.

If you are using a queries string that is 3980... ( wow ) try to run two queries. First run one that is about 2000 characters long. Then against that result set run the remaining 1980 characters of the query. For example:

-Instead of looking for red+dogs+longhair+housetrained
-first look for red+dogs... than against all of the red dogs look for longhair+housetrained

If the length of the post is 3980 and that is causing the problem then I wonder if the issue is localized on the search function only. Try to view the post manually by navigating to the forum where is resides.

As far as the SQL statements not being formatted correctly here is the solution. The terminating ";" is not the only problem your going to run into. In my opinion we should have a procedure that we pss the SQL to that will mold the SQL statement in an oracle friendly statement.


quote:
Becos I migrated some ACCESS table to Oracle b4, so when I found some autonumber field (IDs), I just created 5 or 6 sequence number and put sequencenumbername.nextval in to insert sql statement, then it fix the problem about IDs, I didn't think much about compability with another database only try to make it work for me


Sounds like you are on the right track here... remember are goal is to eventually get an oracle PL/SQL program that can be executed on the Oracle server that will create all of the tables, PL/SQL procedures, triggers etc... so make sure you try to keep all of the login within schema objects...


<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 05 December 2000 :  20:16:16  Show Profile  Send dust an ICQ Message
quote:

Hey dust... sounds like you are close. I have a couple of questions regarding your achievements so far.


hi, H20, No worries
quote:

- What version of Access are you using?
- What ODBC driver are you using (Oracle’s Driver or MS Driver)
- How exactly are you getting the tables into Oracle?
Are you saving the Access tables to binary files then importing into Oracle?
Or are you saving as ODBC?
(I know you mentioned that you were using ODBC. However, I have tried many times
to keep the data types at number, but I get a "Zero length fields not allowed" ODBC
error. Just curious as to how you got it to work.)



Access version 97.
Oracle's ODBC driver
Use ODBC, I got your error message b4 when I tried to import another access table into Oracle, but I didn't get any error message this time about type. another most import thing is if table name is not upper case or any space inside, the table name xxx xxx will change to "xxx xxx" , this is really drived me crazy for a while, becos most OCBC driver can't seperate xxx xxx and "xxx xxx" .

quote:

Varchar2 is definitely the way to go... in 8i the max length is 32,767 bytes. The issue your running into when you tried to run a query using 3980 characters is unclear. Was the query string 3980 or was the actual post length 3980 characters? If you are referring to the post being 3980 then that sounds like an ADO issue to me.


follow is Oracle documentation
at "\Ora815\doc\server.815\a67779\ch2.htm"
1 VARCHAR2(size) Variable-length character string having maximum length size bytes. Maximum size is 4000, and minimum is 1. You must specify size for VARCHAR2.

I never try over 4000, so don't know can use over 4000 or not. I will try it now :)

the string which I wanna insert is 3980 long, and I got error message from oracle, ADO can pass it to oracle without problem.


Response.redirect HELL<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 05 December 2000 :  20:16:55  Show Profile  Send dust an ICQ Message

quote:

If you are using a queries string that is 3980... ( wow ) try to run two queries. First run one that is about 2000 characters long. Then against that result set run the remaining 1980 characters of the query. For example:

-Instead of looking for red+dogs+longhair+housetrained
-first look for red+dogs... than against all of the red dogs look for longhair+housetrained

If the length of the post is 3980 and that is causing the problem then I wonder if the issue is localized on the search function only. Try to view the post manually by navigating to the forum where is resides.




yes, u r right, the string with length 3980 is just for testing, just try to push up to Varchar2 limit :)

quote:

As far as the SQL statements not being formatted correctly here is the solution. The terminating ";" is not the only problem your going to run into. In my opinion we should have a procedure that we pss the SQL to that will mold the SQL statement in an oracle friendly statement.



yes, I forgot to metion about left join problem, I can't run those query with left join at all, have to change to Oracle grammer "(+)" and move table name after FROM.

quote:

Sounds like you are on the right track here... remember are goal is to eventually get an oracle PL/SQL program that can be executed on the Oracle server that will create all of the tables, PL/SQL procedures, triggers etc... so make sure you try to keep all of the login within schema objects...



After importing tables, I lost all relationships information between tables, I can't change it with exist tables, but I've writen all scripts can generate all tables, I can put those scripts into a PL/SQL procedure, but until now, I didn't find any requirment for using triggers :) I know it's definitly need to create combination ID keys, but I used sequences number :)

Response.redirect HELL<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 05 December 2000 :  20:17:33  Show Profile  Send dust an ICQ Message
quote:

It might just not be possible to use 100% identical code for every database. We had do add some extra code for MySql because it doesn't support paging i.e.
If you need extra code for sql-statements that are used a lot, that is bad because that would mean a lot extra databasespecific code. If it are things like this single searchpage that is no big problem.


Yes, Pierre Gorissen, exactly ! certainly Oracle is diff with SQL server server, DB2.. in some way... but we will try to make as less as possible databasespecific code in program.


Response.redirect HELL<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 05 December 2000 :  20:22:56  Show Profile  Send dust an ICQ Message
I try to post all replies in one post, but I got error message, said binary or string will be truncated.. so I post them seperately.

and I tried varchar(4001) in table, no luck

forgot to metion about DATE format, need put TO_DATE()function into SQL statement to make update date value work. also need alter table some DATE type fields to "DATE DEFAULT SYSDATE".



Edited by - dust on 05 December 2000 21:10:10<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 06 December 2000 :  01:40:52  Show Profile  Send dust an ICQ Message
Save me !!!!!!!!!!!!!!!!

I drop old Forum_reply table and create a new one, after that, I found this problem, I worked whole day on it, can't solve it

this is screen shot

SELECT FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_ICQ, FORUM_MEMBERS.M_YAHOO, FORUM_MEMBERS.M_AIM, FORUM_MEMBERS.M_TITLE, FORUM_MEMBERS.M_Homepage, FORUM_MEMBERS.M_LEVEL, FORUM_MEMBERS.M_POSTS, FORUM_MEMBERS.M_COUNTRY, FORUM_REPLY.REPLY_ID, FORUM_REPLY.R_AUTHOR, FORUM_REPLY.TOPIC_ID, FORUM_REPLY.R_MESSAGE, FORUM_REPLY.R_DATE FROM FORUM_MEMBERS , FORUM_REPLY WHERE FORUM_MEMBERS.MEMBER_ID = FORUM_REPLY.R_AUTHOR AND FORUM_REPLY.TOPIC_ID =41 ORDER BY FORUM_REPLY.R_DATE
Provider error '80004005'

Unspecified error

/newbulletins/topic.asp, line 169

this is source code
----------------------------------------
strSql ="SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_ICQ, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_YAHOO, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_AIM, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_TITLE, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_Homepage, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_LEVEL, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_POSTS, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_COUNTRY, "
strSql = strSql & strTablePrefix & "REPLY.REPLY_ID, "
strSql = strSql & strTablePrefix & "REPLY.R_AUTHOR, "
strSql = strSql & strTablePrefix & "REPLY.TOPIC_ID, "
strSql = strSql & strTablePrefix & "REPLY.R_MESSAGE, "
strSql = strSql & strTablePrefix & "REPLY.R_DATE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS , "
strSql = strSql & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "REPLY.TOPIC_ID =" & Request.QueryString("TOPIC_ID")
strSql = strSql & " ORDER BY " & strTablePrefix & "REPLY.R_DATE"

set rs = Server.CreateObject("ADODB.Recordset")
response.write strSql
rs.cachesize = strPageSize
-->line 169 rs.open strSql, my_Conn, 3

If not (rs.EOF or rs.BOF) then '## No replies found in DB
rs.movefirst
rs.pagesize = strPageSize
rs.absolutepage = mypage '**
maxpages = cint(rs.pagecount)
end if

anyone know why ?


--------------------------------------------
Programming is like sex : One mistake and you have to support for a lifetime.<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 06 December 2000 :  01:43:59  Show Profile  Send dust an ICQ Message
CREATE TABLE FORUM_REPLY(
CAT_ID NUMBER(10),
FORUM_ID NUMBER(10),
TOPIC_ID NUMBER(10),
REPLY_ID NUMBER(10),
R_MAIL NUMBER,
R_AUTHOR NUMBER,
R_MESSAGE VARCHAR2(4000),
R_DATE VARCHAR2(50),
R_IP VARCHAR2(50),
R_MSG VARCHAR2(4000)
)
STORAGE
(
INITIAL 500k
NEXT 500k
MINEXTENTS 1
MAXEXTENTS 1024
PCTINCREASE 0
)
/

this is table creating script, the problem just came after drop and recreated the table, no idea about why it happend...

--------------------------------------------
Programming is like sex : One mistake and you have to support for a lifetime.<
Go to Top of Page

h2o
Starting Member

46 Posts

Posted - 06 December 2000 :  14:33:57  Show Profile
Hey dust...

quote:
Save me !!!!!!!!!!!!!!!!

I drop old Forum_reply table and create a new one, after that, I found this problem, I worked whole day on it, can't solve it



here is what you have...


quote:
rs.open strSql, my_Conn, 3


try to use this...

rs.open strSql, my_Conn, adOpenStatic, adLockReadOnly

You can not have an ado recordset object created by an Oracle connetion that is ReadWrite... you have to force the recordset to be Read only. Oh and by the way... you may be able to side step this issue all together if you would just upgrade your MDAC to 2.6 you kind find it here:

http://www.microsoft.com/data/download.htm#26info

If you still get an error after you change the statement above... try to emulate the query in SQL Plus. Get the SQL statement working first on the Oracle side then implement into your ASP. The "Unspecified Error" means that Oralce has sent an error back to the OLE/DB provider... and the provider has no idea what it means.

I found a way to create the tables within ASP which works much better for Oracle then regular SQL pass-through queries. Basically the idea is passing actual PL/SQL statements to the Oracle DB through ADO instead of just standard SQL. Here is an example:

First you have to create a command object for the Oracle connection like this:

With cmd
.ActiveConnection=conn
.CommandType=adCmdText
.CommandText=" CREATE TABLE TESTTABLE (FIELD VARCHAR(13) NOT NULL, FIELD VARCHAR(13)_
NOT NULL);".Execute
end With

This way is extreamly powerful for Oracle databases. First off this statemnent is sending pure PL/SQL statements (Oracle's native procedure language) to the Oracle DB. No need to worrie about what database version is beeing used... will work for all Oracle DBs. Try this.. let me know how it goes...

I am going to try and use the Oralce ODBC driver instead of Microsofts ODBC driver for Oracle to see the datatypes stay at number and not VARCHAR.



<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 06 December 2000 :  17:49:10  Show Profile  Send dust an ICQ Message
quote:


try to use this...

rs.open strSql, my_Conn, adOpenStatic, adLockReadOnly


I tried all cursor type, whatever forwardonly or static or dynamic..., seems nothing wrong with this, the problem just appeared after I change the table.

quote:

You can not have an ado recordset object created by an Oracle connetion that is ReadWrite... you have to force the recordset to be Read only. Oh and by the way... you may be able to side step this issue all together if you would just upgrade your MDAC to 2.6 you kind find it here:

http://www.microsoft.com/data/download.htm#26info


2.6 don't include any new ODBC or Jet driver than 2.5, I got 2.6 installed

quote:

If you still get an error after you change the statement above... try to emulate the query in SQL Plus. Get the SQL statement working first on the Oracle side then implement into your ASP. The "Unspecified Error" means that Oralce has sent an error back to the OLE/DB provider... and the provider has no idea what it means.



I did that, I try to copy the query string to Sqlplus to run it, sqlplus said miss FROM keyword, then I copy whole string to text edit, change one line to multi-line, rerun multi-line query in sqlplus, it successed. I don't know why, I can't see anything wrong with SQL statement, but just that error message

quote:

I found a way to create the tables within ASP which works much better for Oracle then regular SQL pass-through queries. Basically the idea is passing actual PL/SQL statements to the Oracle DB through ADO instead of just standard SQL. Here is an example:

First you have to create a command object for the Oracle connection like this:

With cmd
.ActiveConnection=conn
.CommandType=adCmdText
.CommandText=" CREATE TABLE TESTTABLE (FIELD VARCHAR(13) NOT NULL, FIELD VARCHAR(13)_
NOT NULL);".Execute
end With

This way is extreamly powerful for Oracle databases. First off this statemnent is sending pure PL/SQL statements (Oracle's native procedure language) to the Oracle DB. No need to worrie about what database version is beeing used... will work for all Oracle DBs. Try this.. let me know how it goes...



u r right, I am just lazy, so use script in sqlplus create table, when I start to put all scripts in ASP installation parts, certainly will use your way.

quote:

I am going to try and use the Oralce ODBC driver instead of Microsofts ODBC driver for Oracle to see the datatypes stay at number and not VARCHAR.


good luck :)



[/quote]

--------------------------------------------
Programming is like sex : One mistake and you have to support for a lifetime.<
Go to Top of Page

h2o
Starting Member

46 Posts

Posted - 06 December 2000 :  18:35:31  Show Profile
quote:
I tried all cursor type, whatever forwardonly or static or dynamic..., seems nothing wrong with this, the problem just appeared after I change the table.


I understand that you are changing the cursor type... leave that at dynamic... however...

you have to and I cannot stress this enough... you have to set the the locking type to adLockReadOnly...

The Microsoft OLE/DB provider for Oracle should have been updated for MDAC 2.6. I am pretty sure it has. Can you paste a copy of the SQL statement that you set into SQL Plus that DID NOT work? Thanks...



<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 07 December 2000 :  18:05:19  Show Profile  Send dust an ICQ Message
Here it is

SELECT FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_ICQ, FORUM_MEMBERS.M_YAHOO, FORUM_MEMBERS.M_AIM, FORUM_MEMBERS.M_TITLE, FORUM_MEMBERS.M_Homepage, FORUM_MEMBERS.M_LEVEL, FORUM_MEMBERS.M_POSTS, FORUM_MEMBERS.M_COUNTRY, FORUM_REPLY.REPLY_ID, FORUM_REPLY.R_AUTHOR, FORUM_REPLY.TOPIC_ID, FORUM_REPLY.R_MESSAGE, FORUM_REPLY.R_DATE FROM FORUM_MEMBERS , FORUM_REPLY WHERE FORUM_MEMBERS.MEMBER_ID = FORUM_REPLY.R_AUTHOR AND FORUM_REPLY.TOPIC_ID =41 ORDER BY FORUM_REPLY.R_DATE
/

but if I put this query in this format, it works.

SELECT FORUM_MEMBERS.M_NAME,
FORUM_MEMBERS.M_ICQ,
FORUM_MEMBERS.M_YAHOO,
FORUM_MEMBERS.M_AIM,
FORUM_MEMBERS.M_TITLE,
FORUM_MEMBERS.M_Homepage,
FORUM_MEMBERS.M_LEVEL,
FORUM_MEMBERS.M_POSTS,
FORUM_MEMBERS.M_COUNTRY,
FORUM_REPLY.REPLY_ID,
FORUM_REPLY.R_AUTHOR,
FORUM_REPLY.TOPIC_ID,
FORUM_REPLY.R_MESSAGE,
FORUM_REPLY.R_DATE
FROM FORUM_MEMBERS ,FORUM_REPLY
WHERE FORUM_MEMBERS.MEMBER_ID = FORUM_REPLY.R_AUTHOR AND FORUM_REPLY.TOPIC_ID =41
ORDER BY FORUM_REPLY.R_DATE
/

confusing, how can I generate the chr(10) & chr(13) in SQL statement... tried many ways, none of them works...



--------------------------------------------
Programming is like sex : One mistake and you have to support for a lifetime.<
Go to Top of Page

h2o
Starting Member

46 Posts

Posted - 08 December 2000 :  16:56:26  Show Profile
Hey dust,

quote:
SELECT FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_ICQ, FORUM_MEMBERS.M_YAHOO, FORUM_MEMBERS.M_AIM, FORUM_MEMBERS.M_TITLE, FORUM_MEMBERS.M_Homepage, FORUM_MEMBERS.M_LEVEL, FORUM_MEMBERS.M_POSTS, FORUM_MEMBERS.M_COUNTRY, FORUM_REPLY.REPLY_ID, FORUM_REPLY.R_AUTHOR, FORUM_REPLY.TOPIC_ID, FORUM_REPLY.R_MESSAGE, FORUM_REPLY.R_DATE FROM FORUM_MEMBERS , FORUM_REPLY WHERE FORUM_MEMBERS.MEMBER_ID = FORUM_REPLY.R_AUTHOR AND FORUM_REPLY.TOPIC_ID =41 ORDER BY FORUM_REPLY.R_DATE


What error does SQL Plus give you when you enter this...?

quote:
confusing, how can I generate the chr(10) & chr(13) in SQL statement... tried many ways, none of them works...


I think you can only use the length specifer for VARCHAR in PL/SQL. That query in the example I gave above was actually PL/SQL. Check this out... this is cool:

strProc="BEGIN addtopic("
strProc=strProc & numvar1 & ", '" & charvar1 & "',"
strProc=strProc & numvar2 & ", '" & charvar2 & "'); END;"

dbForum.Execute strProc, dbSQLPassThrough

so this would be the string passed:

BEGIN addtopic(999,'chatacter value',999,'character value'); END;

This makes is so very little code has to be added to the ASP program. If we can convert the SQL statements that do not currently work against Oracle into PL/SQL procedures we can call then from the ASP like the procedure call example I just gave...

What do you think?

<
Go to Top of Page

dust
Starting Member

Australia
18 Posts

Posted - 11 December 2000 :  18:38:34  Show Profile  Send dust an ICQ Message
Hey h20,

quote:

What error does SQL Plus give you when you enter this...?


it said " couldn't find keyword FROM ..."

quote:

I think you can only use the length specifer for VARCHAR in PL/SQL. That query in the example I gave above was actually PL/SQL. Check this out... this is cool:


strProc="BEGIN addtopic("
strProc=strProc & numvar1 & ", '" & charvar1 & "',"
strProc=strProc & numvar2 & ", '" & charvar2 & "'); END;"

dbForum.Execute strProc, dbSQLPassThrough

so this would be the string passed:

BEGIN addtopic(999,'chatacter value',999,'character value'); END;

This makes is so very little code has to be added to the ASP program. If we can convert the SQL statements that do not currently work against Oracle into PL/SQL procedures we can call then from the ASP like the procedure call example I just gave...

What do you think?



sounds good, I tried , it works, but for original problem, finally I found it's caused by R_MESSAGE's type, I use CLOB instead of VARCHAR(4000) b4, but I thought I use VARCHAR(4000) .. and I change back to VARCHAR, it works fine now.

I got few little tools about dealing wiht oracle database, from Benthic company, call Golden32, Goldload, Goldview32, PLedit32. they r really great, u can try them.

--------------------------------------------
Programming is like sex : One mistake and you have to support for a lifetime.<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07