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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL-SQL Array Handling

Status
Not open for further replies.

batmanforever

Programmer
Jul 23, 2003
4
US
Hi,

I have a C code on Win2k machine [ purely C code, not MFC ] that reads off an MS excel database (Office 2k version ).
All is well, expcet that I now need some kind of array handling in my SQL queries.

Here is what I am doing now is:
Pass a number ID value from my C code as a parameter to the SQL SELECT stmt.
So, the SELECT stmt looks like this...

wsprintf( szSql," SELECT Code, StreetID, StreetName FROM [Det$] WHERE Code = %lu OR Code =%lu ORDER BY Code, StreetID", scodeID0, socdeID1);

What I want to do is:
Since, I dont know at compile time, how many ID's I will be searching for, ie I dont know the number of scodeID's, How do I make it read from an array which has these values ?
my C code will first fill in an array with ID values at runtime. This will be fed to the SELECT stmt and it has do do the iteration for the values in the array.

I hope u understood the problem.


 
Your subject says this is PL*SQL and that's ORACLE. This is the Microsoft SQL Server forum and MS SQL Server uses Transact SQL. I suggest posting your question in one of the ORACLE forums.

-SQLBill
 
What the heck is an Excel database? Excel is a spreadsheet not a database application. At any event it appears that SQLBill is correct you are inthe worng forum, you need either an Excel forum, an Accessforum (as that is the database that is Office) or an Oracle forum. Suggest you determine whta backend you actually need to run the statements in and then post inthe correct place.
 
I know MS Excel is not a DB. But I am trying to access the columns and rows in Excel, through PL-SQL, as though they were tables! Its all working fine, except for the dynamic behaviour I need.
Any help / suggestions?

My question is actually, purely PL-SQL...Excel/Access it dosent matter whcih DB I use.
 
Yes it DOES matter which DB you are using. This is the MICROSOFT SQL SERVER forum. Not the ORACLE forum, not the ACCESS forum, not the EXCEL forum.

Again, Microsoft SQL Server doesn't use PL*SQL; it uses Transact SQL (T-SQL). They are two different SQL languages, yes they have similarities but they are still different enough that a script for T-SQL most likely won't work with PL*SQL.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top