logs archiveIRC Archive / Freenode / #oracle / 2010 / June / 20 / 1
Snagnever
is there a way to convert a collection to a row?
i have a 'table of record' type
and i have to convert it to rows like those provided on select statements
why is that this channel here at all?
oracle is a fu*king sh*t
ganderson
Snagnever: what exactly is the problem..?
Snagnever
well, the problem NOW is not exactly with oracle
but wit its PHP api
i have to use a type defined inside a collection
ganderson
okay...well, don't throw a fit over Oracle, then :P
Snagnever
but the api simply says it doesnt exist
ganderson
You got some code we can look at?
Snagnever
yes
let me paste on phpfi
thanks for helping me [=
ganderson
Snagnever: np..I might afk on and off b/c I'm at FOSSCon, currently
Snagnever
ganderson, http://pastebin.org/344167
so, i can find nothing about that on google
even oracle's site ignores that
http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/index.html looking here
         

ganderson
Snagnever: what kind of error does that line produce?
Snagnever
arning: oci_new_collection() [function.oci-new-collection]: OCI-22303: type ""."Classificacao.InfoGrupo" not found in C:\www\LabBD2010\index.php on line 35
ganderson
hmm
Snagnever
so
what i think i could to
is transform the collection
in a set of rows
like in a common select
ganderson
Snagnever: from what I'm finding...it sounds like it's failing to get this collection from the DB, right?
Snagnever
yes!
ganderson
http://forums.oracle.com/forums/thread.jspa?threadID=365039 <-- there's mention here (and the php API) says you can specify the schema
Snagnever
let me see
ganderson
so maybe try specifying the schema in all capital letters
e.g. $valores = oci_new_collection($conn, 'Classificacao.InfoGrupo', 'SCHEMA')
Snagnever
wait
what would be my schema?
as labbd is my user
"labbd" ?
ganderson
yea
put it in all caps, though --> 'LABBD'
Snagnever
let me see
ganderson, same error
but
ganderson
hmm
Snagnever
if i define a type in the schema
CREATE OR REPLACE TYPE TestType is table of varchar(100)
it works
ganderson
ah...that may work
Snagnever
but not that inside de collection
ganderson
honestly, I haven't created a type in oracle before, so I'm not completely sure about that
Snagnever
so, it seems it's an api limitation
ganderson
it may be
Snagnever
but i have to finish
my college work
today :(
         

ganderson
aww :/
Snagnever
and i'm not in mood to move to java
ganderson
have you checked some forums?
Snagnever
i'm not confortable with swing api
yes!
there is only one question like mine
ganderson
did you post your question? Someone else may be able to help you off of there
Snagnever
one answere
i've tried here
only you came to help me ;x
ganderson
well, if you sit tight, someone else may be able to help
Snagnever
ganderson,
but
ganderson
you could also check if there's another channel for php programming that might have something
Snagnever
would you know a way
to convert the collection to rows?
it would be a solution
ganderson
hmm
Snagnever
Fix.Convert( Collection );
ganderson
what do you mean by 'rows'?
an array?
Snagnever
no, like the default result
in a SELECT query
ganderson
hmm...I'm not sure I'm completely understanding your question, then
Snagnever
SELECT * FROM (ACollection) like that
ganderson
okay
and you're just trying to display that resultset via PHP?
Snagnever
YES
yes*
sorry for the caps
ganderson
well why not just execute a statement with that query in it and run through the result set, instead of using the collection api
Snagnever
yes
i know
ganderson
okay
Snagnever
but the work says explictly
to use collections
ganderson
oh
Snagnever
it's a fcking college work \=
ganderson
hmm...well I'm not completely up to speed on working with the collections stuff with PHP and oracle. Unfortunately I gotta get going too, so good luck and if you find the solution, don't forget to post it on that forum you found!
Snagnever
ook dude
thanks for trying to help man!
:D
see you!
QaDeS
hiyas. i just ran a little test (mostly using the system tables) against my local XE. i wind up with ~2-3 queries per second. could that be an auto-commit problem, or is there something oyu have to tune before working with XE?
kpanic99
question about fractured block upon server crash
say you have a 32k blocksize, and 8k OS page size, with 512byte disk IO size
now say you have a table with rows that are 2k in size
if you insert say 15 rows into the block, then delete 13 of those
Snagnever
i have a question:
RJarett
you are forgetting alot of other things kpanic99
Snagnever
why define types and exceptions while apis cannot use them?
kpanic99
i'm aware of redo replay
RJarett
yeah and not just that
but it seems like you are trying to do homework or something
kpanic99
but if an insertion MOVEs an old row closer to the head, there is no redo change vector
RJarett
because theory isnt real life
kpanic99
the question:
the undo entry that gets saved prior to flushing block io...
is it the entire block, or just the before image of the affected ROW:?
RJarett
many many more
zasz
why wouldn't you set your db blocks to 8K as well? that way every oracle i/o request the OS only needs to retrieve one block
RJarett
a database wouldnt be very useful if it worked with just 1 block at a time
kpanic99
there are many reasons to reduce the number of rows in a block
RAC is one reason
fewer rows means less contention, less block shipping
RJarett
god i wish i only worked in theory
life would be so easy
zasz
fractured blocks are very rare kpanic99
are you actually having this problem
kpanic99
i can give you a real life repro rjarett if it will get you to be quiet
RJarett
lol
dude stfu
ask your teacher
zasz
ok
RJarett
This isnt real life
kpanic99
i'm a 18 year veteran of clustering, came here to ask the 'experts' about oracle
zasz
(Action) cuts self I AM ALWAYS DISAPPOINTING RJARETT
RJarett
not you zasz
zasz
yesssss
kpanic99
anybody here that can find their anus with both hands?
(Action) that was directed squarely at rjarett for the innocent onlookers
zasz
at least mine doesn't have a di*k in it like yours
o
kpanic99
either you guys are willing to carry on a technical conversation, or you're idiots and i should just move on
looking for someone with a clue, rather than someone who's sole purpose is to flood the channel with insults
RJarett
eh. ex oracle employee who gets pissed at theoretical "homework" style questions which arent even valid to how a system works
kpanic99
"how a system works"
zasz
ask your undo question again
kpanic99
i have worked many fractured block analysis escalations for clients
does the undo store the entire block, or just the before image of the change vector?
zasz
blocks i believe
ill double check
kpanic99
i always thought it was the whole block, but after doing some digging i'm doubting my prior understanding
grazie zasz
RJarett
partial except the first time it is changed while in backup mode.
kpanic99
the concern here is if a row gets moved up closer to the header as a result of shrinking of a row above it, due to an insertion -- the row could wind up lost with larger blocksizes
talking about normal runtime, not online backup mode (which stores the writes in redo instead of flushing to datafiles)
i've worked my share of "unexplained" torn/fractured blocks, and this little revelation might help explain things
zasz
RJarett: wouldn't before images of the entire block be written to UNDO?
since UNDO tablespaces are composed of undo segments (which are in turn composed of extents and blocks)
kpanic99
asking this another way, might you have some tidbit for analyzing undo datablocks themselves
zasz
kpanic have you thought of opening an SR with oracle
RJarett
od
kpanic99
yeah, but lately those don't get very far
hit/miss if the data that comes back is accurate
another angle to consider here, any way to dump the current undo tablespace structures for analysis similar to mining redo log change vectors
thinking of writing a testcase to heavily exercise this scenario, crash the box, and then go shopping for a fractured block with dbv, once identified then look for affected rowid's in redo dump
but to be complete, would need a method to dump the undo as well which I've never done
zasz
such is beyond me but let me know what you find :)
kpanic99
fair enough, i'll ping the results here
Snagnever
hi! has anyone worked with PHP + Oracle with OCI8?
Hi, how do i threat ORACLE exceptions in a external langue, such as Java or PHP or C
Xgc_
Snagnever: The same way you'd treat any exception in that language.
Snagnever
Xgc i can't see how that on php's oci8 api
if a exception is raised by oracle
it simply shows a warning saying that an user exception wasn't caught
but php doesnt throw an exception
and oracle doesnt say WHICH exception
Xgc
Snagnever: It's best to show the exact code that caused the exception and the exact message generated.
Snagnever
Xgc, look
i have a package
and it have its own exceptions.
when calling it inside php, if it raises an exception, oracle says:
Xgc
Snagnever: Because it sounds more like you have an oracle exception that was not handled... and your API doesn't pass the exception to the php layer.
Snagnever
yes! that's the problem, the api is not passing it!
wasn't it supposed to pass?
do i have to set an error code with pragma exception_init and treat them by myself?
RJarett
did you even bother looking at ocierror() ?
Xgc
Snagnever: or you are just not catching it at the php layer.
Snagnever
RJarett
RJarett
'code' and 'message' within it
Snagnever
it's always ORA-06510
'user exception not handled'
if i use the exception_init trick
the error code is the same
RJarett
is your php calling plsql?
Snagnever
but on the error message, it says 'exception -90001 not handled bla bla bla'
RJarett yes
it's calling a package procedure
RJarett
what do you get if you call the package/proc in sqlplus?
Snagnever
same thing
same error, same message
RJarett
so it is in no way related to php
Snagnever
but how to pass the exception?
how to know the actual error?
« prev 1 2 next »